From 70c1db5f9a01977956656e916a9b53c189fbac7e Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 5 Jul 2010 12:42:55 +0000 Subject: [PATCH] Enforce password changed if password is expired. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@18929 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/main.php | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index 2f19db629..04c374026 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -187,6 +187,28 @@ if($reload_navigation){ $plist->gen_headlines(); $plist->gen_menu(); +/* check if we are using account expiration */ +$smarty->assign("hideMenus", FALSE); +if ($config->get_cfg_value("handleExpiredAccounts") == "true"){ + $expired= ldap_expired_account($config, $ui->dn, $ui->username); + if ($expired == 2){ + new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ; + msg_dialog::display(_("Password change"), _("Your password is about to expire, please change your password!"), INFO_DIALOG); + } elseif ($expired == 3){ + $smarty->assign("hideMenus", TRUE); + $plug = (isset($_GET['plug'])) ? $_GET['plug'] : null; + foreach ($plist->dirlist as $key => $value){ + if (preg_match("/\bpassword\b/i",$value)){ + if($plug != $key) { + $_GET['plug'] = $key; + } + break; + } + } + } +} + + if (isset($_GET['plug']) && $plist->plugin_access_allowed($_GET['plug'])){ $plug= validate($_GET['plug']); $plugin_dir= $plist->get_path($plug); @@ -332,18 +354,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){ } } -/* check if we are using account expiration */ -$smarty->assign("hideMenus", FALSE); -if ($config->get_cfg_value("handleExpiredAccounts") == "true"){ - $expired= ldap_expired_account($config, $ui->dn, $ui->username); - if ($expired == 2){ - new log("security","gosa","",array(),"password for user \"$ui->username\" is about to expire") ; - msg_dialog::display(_("Password change"), _("Your password is about to expire, please change your password!"), INFO_DIALOG); - } elseif ($expired == 3){ - $smarty->assign("hideMenus", TRUE); - } -} - /* Load plugin */ if (is_file("$plugin_dir/main.inc")){ $display =""; -- 2.30.2