
$is		= md5('#old_password#');
$was	= md5('#new_password_check#');
$will	= md5('#new_password#');
$ses	= '#SESSION_ID#';

$s      = "

    SELECT * 
    FROM zzzzsys_session
    WHERE zzzzsys_session_id = '$ses'

";

$t  = nuRunQuery($s);
$r  = db_fetch_object($t);
$j  = json_decode($r->sss_access);

$s      = "

    SELECT * 
    FROM zzzzsys_user
    WHERE zzzzsys_user_id = '#USER_ID#'
    AND sus_login_password = '$is'

";

$t  = nuRunQuery($s);

if(db_num_rows($t) == 0){

    nuDisplayError('Incorrect Password');
    return;
    
}

//-- added by toms

$p	= nuProcedure('nuCheckPasswordPolicy');

if($p != ''){

	eval($p);
	
	if($check == false){
		return;
	}

}

//--

if($will == $was){

    $s  = "

    UPDATE zzzzsys_user 
    SET sus_login_password = '$will'
    WHERE zzzzsys_user_id = '#RECORD_ID#'
    AND sus_login_password = '$is'
    
    ";

    nuRunQuery($s);

}else{
    nuDisplayError('"Enter New Password" Must be the same as "Re-Enter New Password"');
}







