* Required setup */ $Settings = new KSettings(); # Initiate the settings class $Settings->getConfig(); # Load the configuration include_once KNIFE_PATH . '/config.php'; # Include config file (FIXME) if ($Settings->co[storage][backend] == "mysql") { define("KNIFESQL", "yes"); # Flat or mysql } # # Load the user class and run verify $User = new KUsers(); $null = $User->verify(); # $User will be false if no login could be found # User data is accessible via $Userclass->username, etc, or $User[username], etc. # # Now, load the language file chosen or load default one if ($User->language) { include_once KNIFE_PATH . '/lang/' . $User->language; } else { include_once KNIFE_PATH . '/lang/' . $Settings->co[general][defaultlanguage]; } # # We need to display the login form if no good login data is found if (!$User->username) { $moduletitle = SCRIPT_TITLE . " - " . i18n("login_modtitle"); $menus[0] = ""; # FIXME: Insert menu filter?
function Allegory_Deletecookie(name, path, domain) { if (getCookie(name)) { document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } </script>'; # FIXME: Not working if ($_GET[logout] == "y") { $UserDB->logout("SentHeaders"); } $UserDB->verify("headers"); if (!$UserDB->username) { require KNIFE_PATH . '/lang/' . $Settings->co[general][defaultlanguage]; echo i18n("visible_logon_noauth"); $LoginForm = ' <h1>' . i18n("login_Login") . '</h1><form id="allegory_loginform" method="post" action=""><input type="hidden" name="panel" value="dashboard" /> <p> <input class="inshort" type="text" name="username" id="login_username" /> <label for="login_username">' . i18n("login_Username") . '</label> </p> <p> <input class="inshort" type="password" name="password" id="login_password" /> <label for="login_password">' . i18n("login_Password") . '</label> </p> <p> <input type="submit" name="sendlogin" value="' . i18n("login_Login") . '" />