$msg = _("Passwords mismatches"); } elseif (strlen($pass1) < $pass_length_min) { $msg = _("Password is long enought. The minimum is ") . $pass_length_min . _(" characters."); } elseif (strlen($pass1) > $pass_length_max) { $msg = _("Password is too long. The maximum is ") . $pass_length_max . _(" characters."); } elseif (!Session::pass_check_complexity($pass1)) { $msg = _("Password is not complex enought."); } elseif (count($recent_pass) > 0 && in_array(md5($pass1), $recent_pass)) { $msg = _("This password is recently used. Try another."); } elseif (count($user_list = Session::get_list($conn, "WHERE login = '******' and pass = '******'")) > 0) { $msg = _("You must change your old password."); } else { $_SESSION['_user'] = $_SESSION['_backup_user']; unset($_SESSION['_backup_user']); if (preg_match("/pro|demo/", $conf->get_conf("ossim_server_version", FALSE))) { $res = Acl::changepass($conn, $user, $pass1, $current_pass); } else { $res = Session::changepass($conn, $user, $pass1, $current_pass); } if ($res > 0) { if (preg_match("/pro|demo/", $conf->get_conf("ossim_server_version", FALSE))) { Acl::changefirst($conn, $user); } else { Session::changefirst($conn, $user); } header("location:../index.php"); } else { $msg = "Current password does not match"; } } }
if (ossim_error()) { die(ossim_error()); } if ($pass1 != "") { /* check passwords */ if (0 != strcmp($pass1, $pass2)) { $msg = _("Passwords mismatches"); } elseif (strlen($pass1) < 5) { $msg = _("Minimum password length is 5 characters."); } elseif (count($user_list = Session::get_list($conn, "WHERE login = '******' and pass = '******'")) < 1) { $msg = _("Current password is not correct"); } elseif ($pass1 == $oldpass) { $msg = _("You must change your old password."); } else { if (preg_match("/pro|demo/i", $conf->get_conf("ossim_server_version", FALSE))) { Acl::changepass($conn, $user, $pass1); } else { Session::changepass($conn, $user, $pass1); } header("location:../index.php"); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> <?php echo gettext("AlienVault - " . ($opensource ? "Open Source SIM" : ($demo ? "Unified SIEM Demo" : "Unified SIEM"))); ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
} //Modify pass if ($error == false) { if ($cw_pass1 == $cw_pass2) { $res = checkpass($dbconn, $current_pass, $cw_pass1, $cw_pass2, $username); if ($res !== true) { $error = true; $display_class = "customize_show"; $status_class = "ossim_error"; if (is_array($res) && !empty($res)) { $info_error = is_array($info_error) ? array_merge($info_error, $res) : $res; } else { $info_error[] = _("Unknown error to check passwords"); } } else { $result = Acl::changepass($dbconn, $username, $cw_pass1, $current_pass); if ($result <= 0) { $info_error[] = _("Error in the 'Current password' field (Current password does not match)"); $error = true; $display_class = "customize_show"; $status_class = "ossim_error"; } } } else { $info_error[] = _("Error in 'New password' and 'Rewrite passwords' fields (Passwords mismatches)"); $error = true; $display_class = "customize_show"; $status_class = "ossim_error"; } } }