Exemplo n.º 1
0
 function show($linksP)
 {
     $nstr = 0;
     $links = array();
     foreach ($linksP as $tag => $href) {
         if (!$linksP["default"] && !$this->defaultTag) {
             $this->defaultTag = $href;
         }
         if ($tag == "default") {
             $this->defaultTag = $href;
         } else {
             $nstr += strlen($tag);
             $links[$tag] = $href;
             if (eregi(preg_replace("/[\\W]/", ".", $href), preg_replace("/%20/", ".", $_SERVER["REQUEST_URI"]))) {
                 $this->activeKnown = True;
             }
         }
     }
     $this->nlines = (int) ($nstr / $this->symbolsPerLine) + 1;
     // estimation
     if (!$this->tabsFlavor) {
         if (core_getFlavor() == "fysikum") {
             $this->tabsFlavor = "a";
         } else {
             $this->tabsFlavor = "div";
         }
     }
     call_user_func(array($this, "show_" . $this->tabsFlavor), $links);
 }
Exemplo n.º 2
0
    // set flag "run by the delevopper". If set postportem&exit in core_internalError
    core_setOption('YBhere', preg_match('/^(' . join('|', array('127.0.0.1', '83.251.69.232', '130.237.208.36', '130.242.129.43', '92.42.16.1')) . ')$/i', $_SERVER["REMOTE_ADDR"]));
}
core_setOption('playground', preg_match('#/trunk/#i', @$_SERVER["SCRIPT_URL"]) || preg_match('#/trunk/#i', @$_SERVER["SCRIPT_FILENAME"]));
if (!$version) {
    $version = '0.0.0';
}
core_setConfig('version', "Version " . $version);
core_setConfig("robotUID", 99999999);
$core_commonPW = array('/afs/physto.se/common/uadmin/passwd/su.se/passwd.common', '/afs/kth.se/admin/passwd/passwd.full');
$core_logfile = '/log/www/log';
$core_picturesDir = '/afs/.physto.se/common/www/pictures';
if (!@$core_syslogID) {
    $core_syslogID = basename(__FILE__);
}
core_getFlavor();
if ($core_debug = core_getOption('debug')) {
    error_reporting(E_ALL ^ E_NOTICE);
} else {
    error_reporting(0);
}
// Turn off all error reporting
// -- Always load the tables and authentication classes
foreach (array('table', 'tableZebra', 'db', 'auth', 'js', 'moo', 'form') as $c) {
    if ($file = core_locateClas($c)) {
        require_once $file;
    }
}
// -- Instantiate db class
if ($dbName && $dbServer && $dbUser && $dbP && class_exists('db', False)) {
    new db($dbName, $dbServer, $dbUser, $dbP);
Exemplo n.º 3
0
 function getHeader()
 {
     if (!$GLOBALS["getHeaderAlreadyPrinted"]++) {
         print "<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>\n<html lang='en'>\n  <head>\n    <meta http-equiv='content-type' content='text/html; charset=utf-8'>\n  </head>\n  <h1>MAIN HEADER (flavor=" . core_getFlavor() . ")</h1>\n  <body>\n";
     }
 }
Exemplo n.º 4
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);
         }
     }
 }