예제 #1
0
function core_getFlavor()
{
    // flavor might be 'nordita', 'albanova', 'fysikum', 'okc'
    core_getGET('flavor');
    if (!($flavor = strToLower($_GET["flavor"]))) {
        foreach ($GLOBALS["flavors"] as $f => $a) {
            if (preg_match("/" . $a["s"] . "/i", @$_SERVER["SERVER_NAME"])) {
                $flavor = $f;
            }
        }
    }
    if (!$flavor) {
        $flavor = 'nordita';
    }
    core_setConfig('flavor', $flavor);
    return $flavor;
}
예제 #2
0
 function logout()
 {
     unset($_GET["quit"]);
     $flavor = core_getFlavor();
     $_SESSION = array();
     core_getGET("flavor", $flavor);
     $this->whoAmI();
     if (is_array($this->callOnLogout)) {
         foreach ($this->callOnLogout as $f) {
             if (function_exists($f)) {
                 call_user_func($f, $_SESSION["auth"]);
             }
         }
     }
     if (!headers_sent()) {
         if ($goto = $this->redirectAfterLogout) {
             header("Location: " . $goto);
         }
     }
 }