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
00060
00061 if(!$ilias->account->checkTimeLimit())
00062 {
00063 $ilias->auth->logout();
00064 session_destroy();
00065 ilUtil::redirect('login.php?time_limit=true');
00066 }
00067
00068 if ($ilias->getSetting("chat_active"))
00069 {
00070 include_once "./chat/classes/class.ilChatServerCommunicator.php";
00071 ilChatServerCommunicator::_login();
00072 }
00073
00074
00075 include_once './classes/class.ilObjForum.php';
00076
00077 ilObjForum::_updateOldAccess($ilUser->getId());
00078
00079 $return_to = "start.php";
00080
00081 if (!empty($_GET["return_to"]))
00082 {
00083 $return_to = urldecode($_GET["return_to"]);
00084 }
00085
00086 ilUtil::redirect($return_to);
00087 }
00088
00089
00090 $tpl->addBlockFile("CONTENT", "content", "tpl.login.html");
00091
00092
00093 if ($_GET["lang"] == "")
00094 {
00095 $_GET["lang"] = $ilias->ini->readVariable("language","default");
00096 }
00097
00098
00099 $lng = new ilLanguage($_GET["lang"]);
00100
00101
00102 if ($_GET["reload"])
00103 {
00104 if ($_GET["inactive"])
00105 {
00106 $tpl->setVariable("RELOAD","<script language=\"Javascript\">\ntop.location.href = \"./login.php?inactive=true\";\n</script>\n");
00107 }
00108 else
00109 {
00110 $tpl->setVariable("RELOAD","<script language=\"Javascript\">\ntop.location.href = \"./login.php?expired=true\";\n</script>\n");
00111 }
00112 }
00113
00114 $languages = $lng->getInstalledLanguages();
00115
00116 foreach ($languages as $lang_key)
00117 {
00118 $tpl->setCurrentBlock("languages");
00119 $tpl->setVariable("LANG_KEY", $lang_key);
00120 $tpl->setVariable("LANG_NAME", $lng->txt("lang_".$lang_key));
00121 $tpl->setVariable("BORDER", 0);
00122 $tpl->setVariable("VSPACE", 0);
00123 $tpl->parseCurrentBlock();
00124 }
00125
00126
00127 if ($ilias->getSetting("enable_registration") and AUTH_CURRENT == AUTH_LOCAL)
00128 {
00129 $tpl->setCurrentBlock("new_registration");
00130 $tpl->setVariable("REGISTER", $lng->txt("registration"));
00131 $tpl->setVariable("LANG_ID", $_GET["lang"]);
00132 $tpl->parseCurrentBlock();
00133 }
00134
00135 if ($ilias->getSetting("password_assistance") and AUTH_CURRENT == AUTH_LOCAL)
00136 {
00137 $tpl->setCurrentBlock("password_assistance");
00138 $tpl->setVariable("FORGOT_PASSWORD", $lng->txt("forgot_password"));
00139 $tpl->setVariable("LANG_ID", $_GET["lang"]);
00140 $tpl->parseCurrentBlock();
00141 }
00142
00143 $tpl->setVariable("ILIAS_RELEASE", $ilias->getSetting("ilias_version"));
00144 $tpl->setVariable("TXT_ILIAS_LOGIN", $lng->txt("login_to_ilias"));
00145 $tpl->setVariable("FORMACTION", "login.php");
00146 $tpl->setVariable("TXT_USERNAME", $lng->txt("username"));
00147 $tpl->setVariable("TXT_PASSWORD", $lng->txt("password"));
00148 $tpl->setVariable("TXT_SUBMIT", $lng->txt("submit"));
00149 $tpl->setVariable("TXT_CHOOSE_LANGUAGE", $lng->txt("choose_language"));
00150 $tpl->setVariable("LANG_ID", $_GET["lang"]);
00151
00152 if ($_GET["inactive"])
00153 {
00154 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_inactive"));
00155 }
00156 elseif ($_GET["expired"])
00157 {
00158 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_session_expired"));
00159 }
00160
00161
00162 $status = $ilias->auth->getStatus();
00163
00164 if (!empty($status))
00165 {
00166 switch ($status)
00167 {
00168 case AUTH_EXPIRED:
00169 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_session_expired"));
00170 break;
00171 case AUTH_IDLED:
00172
00173
00174 break;
00175 case AUTH_WRONG_LOGIN:
00176 default:
00177 $tpl->setVariable(TXT_MSG_LOGIN_FAILED, $lng->txt("err_wrong_login"));
00178 break;
00179 }
00180 }
00181 if($_GET['time_limit'])
00182 {
00183 $tpl->setVariable("TXT_MSG_LOGIN_FAILED",$lng->txt('time_limit_reached'));
00184 }
00185
00186 $tpl->setVariable("PHP_SELF", $_SERVER['PHP_SELF']);
00187 $tpl->setVariable("USERNAME", $_POST["username"]);
00188 $tpl->setVariable("USER_AGREEMENT", $lng->txt("usr_agreement"));
00189
00190 $tpl->show(false);
00191 ?>