Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00035
00036 include("include/inc.get_pear.php");
00037
00038
00039
00040 if (isset($_GET["client_id"]))
00041 {
00042 setcookie("ilClientId",$_GET["client_id"]);
00043 $_COOKIE["ilClientId"] = $_GET["client_id"];
00044 }
00045
00046 require_once "include/inc.check_pear.php";
00047 require_once "include/inc.header.php";
00048
00049
00050 if (!$ilias->getSetting("setup_ok"))
00051 {
00052 echo "setup is not completed. Please run setup routine again. (login.php)";
00053 exit();
00054 }
00055
00056
00057 if ($ilias->auth->getAuth())
00058 {
00059 if(!$ilias->account->checkTimeLimit())
00060 {
00061 $ilias->auth->logout();
00062 session_destroy();
00063 ilUtil::redirect('login.php?time_limit=true');
00064 }
00065
00066 if ($ilias->getSetting("chat_active"))
00067 {
00068 include_once "./chat/classes/class.ilChatServerCommunicator.php";
00069 ilChatServerCommunicator::_login();
00070 }
00071
00072
00073 include_once './classes/class.ilObjForum.php';
00074
00075 ilObjForum::_updateOldAccess($ilUser->getId());
00076
00077 $return_to = "start.php";
00078
00079 if (!empty($_GET["return_to"]))
00080 {
00081 $return_to = urldecode($_GET["return_to"]);
00082 }
00083
00084 ilUtil::redirect($return_to);
00085 }
00086
00087
00088 $tpl->addBlockFile("CONTENT", "content", "tpl.login.html");
00089
00090
00091 if ($_GET["lang"] == "")
00092 {
00093 $_GET["lang"] = $ilias->ini->readVariable("language","default");
00094 }
00095
00096
00097 $lng = new ilLanguage($_GET["lang"]);
00098
00099
00100 if ($_GET["reload"])
00101 {
00102 if ($_GET["inactive"])
00103 {
00104 $tpl->setVariable("RELOAD","<script language=\"Javascript\">\ntop.location.href = \"./login.php?inactive=true\";\n</script>\n");
00105 }
00106 else
00107 {
00108 $tpl->setVariable("RELOAD","<script language=\"Javascript\">\ntop.location.href = \"./login.php?expired=true\";\n</script>\n");
00109 }
00110 }
00111
00112 $languages = $lng->getInstalledLanguages();
00113
00114 foreach ($languages as $lang_key)
00115 {
00116 $tpl->setCurrentBlock("languages");
00117 $tpl->setVariable("LANG_KEY", $lang_key);
00118 $tpl->setVariable("LANG_NAME", $lng->txt("lang_".$lang_key));
00119 $tpl->setVariable("BORDER", 0);
00120 $tpl->setVariable("VSPACE", 0);
00121 $tpl->parseCurrentBlock();
00122 }
00123
00124
00125 if ($ilias->getSetting("enable_registration") and AUTH_CURRENT == AUTH_LOCAL)
00126 {
00127 $tpl->setCurrentBlock("new_registration");
00128 $tpl->setVariable("REGISTER", $lng->txt("registration"));
00129 $tpl->setVariable("LANG_ID", $_GET["lang"]);
00130 $tpl->parseCurrentBlock();
00131 }
00132
00133 if ($ilias->getSetting("password_assistance") and AUTH_CURRENT == AUTH_LOCAL)
00134 {
00135 $tpl->setCurrentBlock("password_assistance");
00136 $tpl->setVariable("FORGOT_PASSWORD", $lng->txt("forgot_password"));
00137 $tpl->setVariable("LANG_ID", $_GET["lang"]);
00138 $tpl->parseCurrentBlock();
00139 }
00140
00141 $tpl->setVariable("ILIAS_RELEASE", $ilias->getSetting("ilias_version"));
00142 $tpl->setVariable("TXT_ILIAS_LOGIN", $lng->txt("login_to_ilias"));
00143 $tpl->setVariable("FORMACTION", "login.php?lang=".$_GET["lang"]);
00144 $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
00145 $tpl->setVariable("TXT_PASSWORD", $lng->txt("password"));
00146 $tpl->setVariable("TXT_SUBMIT", $lng->txt("submit"));
00147 $tpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
00148 $tpl->setVariable("LANG_ID", $_GET["lang"]);
00149
00150 if ($_GET["inactive"])
00151 {
00152 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_inactive"));
00153 }
00154 elseif ($_GET["expired"])
00155 {
00156 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_session_expired"));
00157 }
00158
00159
00160 $status = $ilias->auth->getStatus();
00161
00162 if (!empty($status))
00163 {
00164 switch ($status)
00165 {
00166 case AUTH_EXPIRED:
00167 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_session_expired"));
00168 break;
00169 case AUTH_IDLED:
00170
00171
00172 break;
00173 case AUTH_WRONG_LOGIN:
00174 default:
00175 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_wrong_login"));
00176 break;
00177 }
00178 }
00179 if($_GET['time_limit'])
00180 {
00181 $tpl->setVariable("TXT_MSG_LOGIN_FAILED",$lng->txt('time_limit_reached'));
00182 }
00183
00184 $tpl->setVariable("PHP_SELF", $_SERVER['PHP_SELF']);
00185 $tpl->setVariable("USERNAME", $_POST["username"]);
00186 $tpl->setVariable("USER_AGREEMENT", $lng->txt("usr_agreement"));
00187
00188 $tpl->show(false);
00189 ?>