X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fhtml%2Fpassword.php;h=837b70fc27942afc3b52d3c8ade23f21bb130703;hb=3c635e52dd5a36f4ef1ef1ee5eee6ae86cf42746;hp=d830a837466679bd762aaa72c2789b9fcd2ae253;hpb=c83030828a4b33bf18cd2e960b9a657aff0f9b44;p=gosa.git diff --git a/gosa-core/html/password.php b/gosa-core/html/password.php index d830a8374..837b70fc2 100644 --- a/gosa-core/html/password.php +++ b/gosa-core/html/password.php @@ -1,21 +1,23 @@ data['MAIN']['COMPILE'])){ /* Check for compile directory */ if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){ - echo sprintf(_("Directory '%s' specified as compile directory is not accessible!"), - $smarty->compile_dir); - exit(); + msg_dialog::display(_("Configuration error"), sprintf(_("Directory '%s' specified as compile directory is not accessible!"), + $smarty->compile_dir), FATAL_ERROR_DIALOG); + exit; } /* Check for old files in compile directory */ @@ -96,7 +98,7 @@ $GLOBALS['t_gettext_message_dir'] = $BASE_DIR.'/locale/'; /* Set the text domain as 'messages' */ $domain = 'messages'; -bindtextdomain($domain, "$BASE_DIR/locale"); +bindtextdomain($domain, LOCALE_DIR); textdomain($domain); /* Generate server list */ @@ -158,7 +160,7 @@ if (isset($_GET['method'])){ $tmp = new passwordMethod($config); $available = $tmp->get_available_methods(); if (!isset($available[$method])){ - echo _("Error: Password method not available!"); + msg_dialog::display(_("Password method"),_("Error: Password method not available!"),FATAL_ERROR_DIALOG); exit; } } @@ -195,7 +197,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])){ $message[]= _("The passwords you've entered as 'New password' and 'Repeated new password' do not match."); } else { if ($_POST['new_password'] == ""){ - $message[]= _("The password you've entered as 'New password' is empty."); + $message[]= msgPool::required(_("New password")); } } @@ -213,10 +215,10 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])){ } /* Validate */ - if (!ereg("^[A-Za-z0-9_.-]+$", $uid)){ - $message[]= _("Please specify a valid username!"); + if (!tests::is_uid($uid)){ + $message[]= msgPool::invalid(_("Login")); } elseif (mb_strlen($_POST["current_password"], 'UTF-8') == 0){ - $message[]= _("Please specify your password!"); + $message[]= msgPool::required(_("Current password")); } else { /* Do we have the selected user somewhere? */ @@ -235,7 +237,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])){ /* Do we need to show error messages? */ if (count ($message) != 0){ /* Show error message and continue editing */ - show_errors($message); + msg_dialog::displayChecks($message); } else { /* Passed quality check, just try to change the password now */ @@ -249,7 +251,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])){ } if ($output != ""){ $message[]= _("External password changer reported a problem: ".$output); - show_errors($message); + msg_dialog::displayChecks($message); } else { if ($method != ""){ change_password ($ui->dn, $_POST['new_password'], 0, $method); @@ -285,6 +287,7 @@ if ($ssl != "" && $config->data['MAIN']['WARNSSL'] == 'true'){ } /* show login screen */ +$smarty->assign("JS",session::get('js')); $smarty->assign ("PHPSESSID", session_id()); if (session::is_set('errors')){ $smarty->assign("errors", session::get('errors'));;