From 52cf654c20ce983bfdbc169c7a9e241b60869873 Mon Sep 17 00:00:00 2001 From: steveminutillo Date: Wed, 6 Jun 2007 03:34:15 +0000 Subject: [PATCH] save a hash of the password instead of the password itself in the DB (requires schema upgrade, just run install.php again) --- fof-db.php | 4 ++-- install.php | 21 ++++++++++++++++++--- login.php | 2 +- prefs.php | 5 +++-- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/fof-db.php b/fof-db.php index 7ddd82f..4e81bbf 100644 --- a/fof-db.php +++ b/fof-db.php @@ -58,7 +58,7 @@ function fof_db_query($sql, $live=0) //echo "
";
       //print_r(debug_backtrace());
       //echo "
"; - die("Cannot query database. Have you run install.php? MySQL says: ". mysql_error() . ""); + die("Cannot query database. Have you run install.php to create or upgrade your installation? MySQL says: ". mysql_error() . ""); } return $result; } @@ -306,7 +306,7 @@ function fof_db_authenticate($user_name, $user_password_hash) { global $FOF_USER_TABLE, $FOF_ITEM_TABLE, $FOF_ITEM_TAG_TABLE, $fof_connection, $fof_user_id, $fof_user_name, $fof_user_level, $fof_user_prefs; - $sql = "select * from $FOF_USER_TABLE where user_name = '$user_name' and md5(user_password) = '" . mysql_escape_string($user_password_hash) . "'"; + $sql = "select * from $FOF_USER_TABLE where user_name = '$user_name' and user_password_hash = '" . mysql_escape_string($user_password_hash) . "'"; $result = fof_db_query($sql); diff --git a/install.php b/install.php index 7760649..aa69026 100644 --- a/install.php +++ b/install.php @@ -34,9 +34,9 @@ header("Content-Type: text/html; charset=utf-8"); Login as admin, and start subscribing!'; } @@ -108,7 +108,7 @@ $tables[] = << Tables exist.

+
"; +} +?> + Inserting initial data...