Authentication in ol'bookmarks stopped working after upgrading to PHP 5.2: logging in just returned me to the same login screen. I know nothing about PHP so I'm not sure if this is the correct fix but this patch makes it work again:
olbookmarks/lib/libauth.php
--- olbookmarks-0.7.4/lib/libauth.php 2003-02-09 07:32:11.000000000 +0100
+++ olbookmarks/lib/libauth.php 2007-01-26 16:17:33.000000000 +0100
@@ -33,5 +33,5 @@
dbopen();
- $sql = "select * from $db_table_preferences where login = '$session_loginname'";
+ $sql = "select * from $db_table_preferences where login = '$_SESSION[loginname]'";
$res = dbexec($sql);
if(dbnum($res) == 0)
--- olbookmarks-0.7.4/login/index.php 2003-02-09 07:32:11.000000000 +0100
+++ olbookmarks/login/index.php 2007-01-26 16:17:49.000000000 +0100
@@ -59,5 +59,5 @@
else /* username is valid, check the password */
{
- $sql = "select 1 from $db_table_preferences where login = '$User_Name'";
+ $sql = "select password from $db_table_preferences where login = '$User_Name'";
$sql .= " AND password = PASSWORD('$Password')";
$res = dbexec($sql);
The second one is pretty mysterious: I have no idea how could it work before because as long as you didn't bring back password field in the query, the hash was always computed with empty password and so couldn't match the correct hash in libauth.php... So there could be some other bug too.
But at least it does allow me to login now.
Logged In: YES
user_id=123387
Originator: NO
mysql PASSWORD function is known to have change between versions...
olbookmarks should be able to handle authentication without it (by the way this will not work with postgres so it really should)