Make login html adaptable, first application specific, then login, and finally defailt.
1 <?php // (c) 2008 Olof Tjerngren, GPLv3
2 $GLOBAL['TWOSPOT_GLOBAL_CHARSET']='UTF8';
3 $hackSettingSkipLoginDie=1; // Remove this hack after old spot is
4 // truly decommissioned.
5 $hackSettingSkipHTTPLogin=1; // Need to tidy this up a bit. This hack
6 // setting makes sure you don't get a
7 // popup - instead you get the html below.
10 require_once("../2lib/sessionclass.php");
12 if (array_key_exists("_currentAppLoc",$_REQUEST)) {
13 $_SESSION["configLocation"]=$_REQUEST["_currentAppLoc"];
16 require_once("../2lib/loginToDb.php");
17 header('Content-type: text/html; charset=UTF-8');
20 if (array_key_exists("configLocation",$_REQUEST)) {
21 $_SESSION["configLocation"]=$_REQUEST["configLocation"];
24 if ($conn && $int_user_no) {
25 echo '<script type="text/javascript">getMenu("../r/menu.php?level=main")</script>';
27 if (array_key_exists("login",$_REQUEST) &&
28 array_key_exists("password",$_REQUEST)) {
29 if (doLogin($_REQUEST["login"],$_REQUEST["password"])) {
30 echo '<script type="text/javascript">getMenu("../r/menu.php?level=main")</script>';
33 echo "<blockquote>Login failed, your username or password is not correct.</blockquote><br>";
36 // Find the most specific login page and include it to be shown to the user.
37 if (file_exists($_SESSION["configLocation"]."login.html")) {
38 include_once($_SESSION["configLocation"]."login.html");
39 } else if (file_exists("../local/login.html")) {
40 include_once("../local/login.html");
42 include_once("../share/login.html");