Viewing file: changePass.inc.php3 (1.89 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
if((checkSuperSession($superSession, $REMOTE_ADDR) || (checkNormalSession($session, $REMOTE_ADDR))))
{
require("$mysqlCall");
if(isset($superSession))
{
include("include/rootGui.inc.php3");
$userId = getUserSUId($superSession);
}
else
{
include("include/userGui.inc.php3");
$userId = getUserId($session);
}
$userInfo = getUserInfo($userId);
$oldPass = crypt($oldPass, $userInfo[user]);
/* print("<br>old pass = $oldPass, user = $userInfo[user], curr pass = $userInfo[pass] <br>"); */
if($oldPass != $userInfo[pass])
{
print("Current password provided is incorect.<br>Go Back and try again");
}
else if($newPass1 != $newPass2)
{
print("The second new password entery does not match the first new password entry<br>Go Back and try again");
}
else if((strlen($newPass1) <=5) || (strlen($newPass2) <=5 ))
{
print("New password is to short, must at least 6 char long<br>Go Back and try again");
}
else
{
require("$mysqlCall");
/* print("email = $item_email"); */
$newPass1 = crypt($newPass1, $userInfo[user]);
$query = "replace into $users values('$userInfo[ID]', '$userInfo[user]', '$newPass1', '$userInfo[SuperUser]', '$userInfo[email]', '$userInfo[notify]', '$userInfo[active]','$userInfo[manageUsers]', '$userInfo[addNews]', '$userInfo[manageNews]','$userInfo[manageNewsSpool]','$userInfo[manageTopics]', '$userInfo[manageImages]')";
$mysql_result=mysql_query($query) or die(mysql_error());
if($mysql_result)
{
print("Looks as though that worked :)");
}
else
{
print("Something Wrong Here");
}
}
include("include/guiBase.inc.php3");
}
?>
|