X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fhtml%2Findex.php;h=5c9207166009385b446d1fd04f92aed948fdc8af;hb=b82c2df0022dbb07126f30febb4b566fedad937e;hp=d55a13ff9afb37fb536047bcc20b10681e0f1526;hpb=7865b09acca10316cd15c4a964236cb06c01ed9e;p=gosa.git diff --git a/gosa-core/html/index.php b/gosa-core/html/index.php index d55a13ff9..5c9207166 100644 --- a/gosa-core/html/index.php +++ b/gosa-core/html/index.php @@ -37,7 +37,7 @@ function displayLogin() error_reporting(E_ALL | E_STRICT); /* Check theme compatibility */ - $theme= $config->get_cfg_value("core",'theme', 'default'); + $theme= $config->get_cfg_value("core",'theme'); if (file_exists("$BASE_DIR/ihtml/themes/$theme/blacklist")) { $blocks= file("$BASE_DIR/ihtml/themes/$theme/blacklist"); foreach ($blocks as $block) { @@ -69,7 +69,7 @@ function displayLogin() /* Displasy SSL mode warning? */ if ($ssl != "" && $config->get_cfg_value("core",'warnSSL') == 'true') { - $smarty->assign("ssl", sprintf(_("This session is not ecrypted. Click %s to enter an encrypted session."), "".bold(_("here"))."")); + $smarty->assign("ssl", sprintf(_("This session is not encrypted. Click %s to enter an encrypted session."), "".bold(_("here"))."")); } else { $smarty->assign("ssl", ""); } @@ -83,7 +83,7 @@ function displayLogin() /* Generate server list */ $servers= array(); if (isset($_POST['server'])) { - $selected= validate($_POST['server']); + $selected= get_post('server'); } else { $selected= $config->data['MAIN']['DEFAULT']; } @@ -171,7 +171,7 @@ if ($config->get_cfg_value("core","sendCompressedOutput") != "") { } /* Set template compile directory */ -$smarty->compile_dir= $config->get_cfg_value("core","templateCompileDirectory", '/var/spool/gosa'); +$smarty->compile_dir= $config->get_cfg_value("core","templateCompileDirectory"); $smarty->error_unassigned= true; /* Check for compile directory */ @@ -198,6 +198,9 @@ bindtextdomain($domain, LOCALE_DIR); textdomain($domain); $smarty->assign ('nextfield', 'username'); +/* Translation of cookie-warning. Whether to display it, is determined by JavaScript */ +$smarty->assign ("cookies", _("Your browser has cookies disabled: please enable cookies and reload this page before logging in!")); + if ($_SERVER["REQUEST_METHOD"] != "POST") { @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to"); } @@ -258,7 +261,7 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces } if (!$htaccess_authenticated) { - $server= validate($_POST["server"]); + $server= get_post("server"); } $config->set_current($server); @@ -270,33 +273,6 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces exit(); } - /* Check for schema file presence */ - if ($config->get_cfg_value("core","schemaCheck") == "true") { - $recursive = ($config->get_cfg_value("core","ldapFollowReferrals") == "true"); - $tls = ($config->get_cfg_value("core","ldapTLS") == "true"); - - if(!count($ldap->get_objectclasses())) { - msg_dialog::display(_("LDAP error"), _("Cannot obtain information about the available LDAP schema!"), ERROR_DIALOG); - displayLogin(); - exit() ; - }else{ - $cfg = array(); - $cfg['admin'] = $config->current['ADMINDN']; - $cfg['password'] = $config->current['ADMINPASSWORD']; - $cfg['connection']= $config->current['SERVER']; - $cfg['tls'] = $tls; - $str = check_schema($cfg, $config->get_cfg_value("core","rfc2307bis") == "true"); - $checkarr = array(); - foreach($str as $tr) { - if(isset($tr['IS_MUST_HAVE']) && !$tr['STATUS']) { - msg_dialog::display(_("LDAP error"), _("Your LDAP setup contains old schema definitions:")."

".$tr['MSG'], ERROR_DIALOG); - displayLogin(); - exit(); - } - } - } - } - /* Check for locking area */ $ldap->cat($config->get_cfg_value("core","config"), array("dn")); $attrs= $ldap->fetch(); @@ -310,7 +286,7 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces if (!$htaccess_authenticated) { $username= $_POST["username"]; if (!preg_match("/^[@A-Za-z0-9_.-]+$/", $username)) { - $message= _("Please specify a valid username!"); + $message= _("Please specify a valid user name!"); $ok= false; } elseif (mb_strlen($_POST["password"], 'UTF-8') == 0) { $message= _("Please specify your password!"); @@ -376,29 +352,24 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces } /* are we using accountexpiration */ - if ($config->get_cfg_value("core","handleExpiredAccounts") == "true") { + if ($config->boolValueIsTrue("core","handleExpiredAccounts")) { $expired= ldap_expired_account($config, $ui->dn, $ui->username); - if ($expired == 1) { + if ($expired == POSIX_ACCOUNT_EXPIRED) { $message= _("Account locked. Please contact your system administrator!"); $smarty->assign ('nextfield', 'password'); new log("security","login","",array(),"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; - new log("security","login","",array(),"User \"$username\" password forced to change") ; - header ("Location: main.php?plug=$plug&reset=1"); - exit; - } - } + displayLogin(); + exit(); } } /* Not account expired or password forced change go to main page */ new log("security","login","",array(),"User \"$username\" logged in successfully") ; $plist= new pluglist($config, $ui); + + stats::log('global', 'global', array(), $action = 'login', $amount = 1, 0); + if(isset($plug) && isset($plist->dirlist[$plug])) { header ("Location: main.php?plug=".$plug."&global_check=1"); }else{ @@ -423,13 +394,10 @@ if (!isset($message)) { $smarty->assign ("message", $message); -/* Translation of cookie-warning. Whether to display it, is determined by JavaScript */ -$smarty->assign ("cookies", _("Your browser has cookies disabled: please enable cookies and reload this page before logging in!")); - /* Generate server list */ $servers= array(); -if (isset($_POST['server'])) { - $selected= validate($_POST['server']); +if (isset($_POST['server'])){ + $selected= get_post('server'); } else { $selected= $config->data['MAIN']['DEFAULT']; }