From: opensides Date: Sun, 28 May 2006 15:37:19 +0000 (+0000) Subject: last part of the account expiration code X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=993fe92bd8c419a7b14899f29ec2a3c5f06b62eb;p=gosa.git last part of the account expiration code git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3527 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/html/index.php b/html/index.php index ece9138c5..e799f3559 100644 --- a/html/index.php +++ b/html/index.php @@ -215,10 +215,38 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])){ $config->make_idepartments(); $_SESSION['config']= $config; - /* Go to main page */ - gosa_log ("User \"$username\" logged in successfully"); - header ("Location: main.php?global_check=1"); - exit; + /* are we using accountexpiration */ + if((isset($config->data['MAIN']['ACCOUNTEXPIRED'])) && $config->data['MAIN']['ACCOUNTEXPIRED'] == "1"){ + + $expired= ldap_expired_account($config, $ui->dn, $ui->username); + + if ($expired == 1){ + $message= _("Account Locked"); + $smarty->assign ('nextfield', 'password'); + gosa_log ("Account for user \"$username\" has expired"); + } elseif ($expired == 3){ + $plist= new pluglist($config, $ui); + foreach ($plist->dirlist as $key => $value){ + if (preg_match("/\bpassword\b/i",$value)){ + $plug=$key; + gosa_log ("User \"$username\" password forced to change"); + header ("Location: main.php?plug=$plug&reset=1"); + exit; + } + } + } + + /* Not account expired or password forced change go to main page */ + gosa_log ("User \"$username\" logged in successfully"); + header ("Location: main.php?global_check=1"); + exit; + + } else { + /* Go to main page */ + gosa_log ("User \"$username\" logged in successfully"); + header ("Location: main.php?global_check=1"); + exit; + } } } }