index d830a837466679bd762aaa72c2789b9fcd2ae253..837b70fc27942afc3b52d3c8ade23f21bb130703 100644 (file)
<?php
/*
<?php
/*
- This code is part of GOsa (https://gosa.gonicus.de)
- Copyright (C) 2003-2007 Cajus Pollmeier
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
function displayPWchanger()
*/
function displayPWchanger()
/* Check if CONFIG_FILE is accessible */
if (!is_readable(CONFIG_DIR."/".CONFIG_FILE)){
/* Check if CONFIG_FILE is accessible */
if (!is_readable(CONFIG_DIR."/".CONFIG_FILE)){
- echo sprintf(_("GOsa configuration %s/%s is not readable. Aborted."), CONFIG_DIR,CONFIG_FILE);
- exit();
+ msg_dialog::display(_("Fatal error"), sprintf(_("GOsa configuration %s/%s is not readable. Aborted."),CONFIG_DIR,CONFIG_FILE), FATAL_ERROR_DIALOG);
+ exit;
}
/* Parse configuration file */
}
/* Parse configuration file */
/* Check for compile directory */
if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
/* 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 */
}
/* Check for old files in compile directory */
/* Set the text domain as 'messages' */
$domain = 'messages';
/* Set the text domain as 'messages' */
$domain = 'messages';
-bindtextdomain($domain, "$BASE_DIR/locale");
+bindtextdomain($domain, LOCALE_DIR);
textdomain($domain);
/* Generate server list */
textdomain($domain);
/* Generate server list */
$tmp = new passwordMethod($config);
$available = $tmp->get_available_methods();
if (!isset($available[$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;
}
}
exit;
}
}
$message[]= _("The passwords you've entered as 'New password' and 'Repeated new password' do not match.");
} else {
if ($_POST['new_password'] == ""){
$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"));
}
}
}
}
}
/* Validate */
}
/* 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){
} 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? */
} else {
/* Do we have the selected user somewhere? */
/* Do we need to show error messages? */
if (count ($message) != 0){
/* Show error message and continue editing */
/* 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 */
} else {
/* Passed quality check, just try to change the password now */
}
if ($output != ""){
$message[]= _("External password changer reported a problem: ".$output);
}
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);
} else {
if ($method != ""){
change_password ($ui->dn, $_POST['new_password'], 0, $method);
}
/* show login screen */
}
/* 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'));;
$smarty->assign ("PHPSESSID", session_id());
if (session::is_set('errors')){
$smarty->assign("errors", session::get('errors'));;