using php md5 instead of mysql password()

git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@581 860744bd-22fc-0310-8c96-e9fe5004b5ca
This commit is contained in:
Andy Blyler committed 2003-02-24 00:13:41 +00:00
1 parent 0896a54a55
commit a1890fb94d
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -29,7 +29,8 @@ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = ""; }
switch ($_REQUEST["action"]) {
case 'login':
$user = db_fetch_row("select * from user where username='" . $_POST["username"] . "' and password = PASSWORD('" . $_POST["password"] . "')");
db_execute("update user set password = '" . md5($_POST["password"]) . "' where username='" . $_POST["username"] . "' and password = PASSWORD('" . $_POST["password"] . "')");
$user = db_fetch_row("select * from user where username='" . $_POST["username"] . "' and password = '" . md5($_POST["password"]) . "'");
if (sizeof($user)) {
/* --- GOOD username/password --- */
+1 -1
View File
@@ -103,7 +103,7 @@ function form_save() {
if (($_POST["password"] == "") && ($_POST["password_confirm"] == "")) {
$password = db_fetch_cell("select password from user where id=" . $_POST["id"]);
}else{
$password = "PASSWORD('" . $_POST["password"] . "')";
$password = "'" . md5($_POST["password"]) . "'";
}
/* check to make sure the passwords match; if not error */