public function __construct() { global $USER, $ADMIN, $FORETAG, $urlHandler, $security, $urlChecker, $sajtDelarObj; if (isset($ADMIN) && $ADMIN->getTyp() == "kommun") { global $kommun; Security::demand(KOMMUN, $kommun); } else { Security::demand(EDITOR); } $this->template_dir = ROOT . '/admin/templates'; $this->compile_dir = ROOT . '/admin/templates_c/'; $this->config_dir = ROOT . '/php/libs/smarty/configs'; $this->cache_dir = ROOT . '/php/libs/smarty/cache'; $this->assign("pagename", "Motiomera.se"); $this->assign("_GET", $_GET); $this->assign("_POST", $_POST); $this->assign("urlHandler", $urlHandler); $this->assign("sajtDelarObj", $sajtDelarObj); $this->assign("security", $security); $this->assign("inAdmin", true); $this->assign("GOOGLEMAPS_APIKEY", GOOGLEMAPS_APIKEY); $this->assign("BROWSER", Medlem::getCurrentBrowserVersion(true)); $this->assign("urlChecker", $urlChecker); if ($ADMIN) { $this->assign("ADMIN", $ADMIN); } if ($USER) { $this->assign("USER", $USER); } if ($FORETAG) { $this->assign("FORETAG", $FORETAG); } }
public function __construct($cache = false, $cacheLiftime = 3600) { global $USER, $ADMIN, $FORETAG, $urlHandler, $security, $adressbok, $urlChecker, $db, $sajtDelarObj; $this->template_dir = ROOT . '/templates'; $this->compile_dir = ROOT . '/templates_c'; $this->config_dir = ROOT . '/php/libs/smarty/configs'; $this->cache_dir = ROOT . '/php/libs/smarty/cache'; // Visar t.ex. trunkomera.se ist�llet f�r MotioMera, om s� �r fallet. if ($_SERVER['HTTP_HOST'] != 'motiomera.se') { $this->assign("pagename", ucfirst($_SERVER['HTTP_HOST'])); } else { $this->assign("pagename", "MotioMera"); } if (defined('DEBUG_SMARTY') && DEBUG_SMARTY) { $this->assign('debugSmarty', true); } //$this->assign("pagename", "MotioMera"); $this->assign("microtime", Misc::get_milliseconds(true)); $this->assign("_GET", $_GET); $this->assign("_POST", $_POST); $this->assign("_SERVER", $_SERVER); $this->assign("urlHandler", $urlHandler); $this->assign("sajtDelarObj", $sajtDelarObj); $this->assign("urlChecker", $urlChecker); $this->assign("security", $security); $this->assign("GOOGLEMAPS_APIKEY", GOOGLEMAPS_APIKEY); $this->assign("DEBUG", DEBUG); $this->contentCacheLifetime = $cacheLiftime; $this->compile_check = true; //the rss flow from mabra.com $file = ROOT . "/files/rsscache/motiofeed.txt"; $fh = fopen($file, "r") or die("cant open file"); $smotiofeed = file_get_contents($file); fclose($fh); $rss = unserialize($smotiofeed); $this->assign("rss", $rss); if ($cache) { $this->caching = 2; } else { $this->caching = false; } $this->assign("BROWSER", Medlem::getCurrentBrowserVersion(true)); $helpers = Help::listByPage($_SERVER['PHP_SELF']); $this->assign("helpers", $helpers); $this->assign('currentPage', Misc::getCurrentPage()); if ($USER) { $this->assign("USER", $USER); $this->assign("adressbok", $adressbok); } if ($ADMIN) { $this->assign("ADMIN", $ADMIN); $this->assign("inAdmin", true); } if ($FORETAG) { $this->assign("FORETAG", $FORETAG); } $this->register_function('stegToKm', array('Steg', 'stegToKm')); }
function exception_handler($e) { //echo $e; if (defined('DEBUG_MAIL') && DEBUG_MAIL or defined('DEBUG_IM') && DEBUG_IM && !DEBUG && !(!get_class($e) == "GruppException" && !get_class($e) == "MedlemException" && !get_class($e) == "SecurityException")) { $smarty = new MMSmarty(); $smarty->assign('error', $e); $mess_err = $smarty->fetch('errormsg.tpl'); // echo $mess_err; $host = $_SERVER['HTTP_HOST']; $browserPlain = Medlem::getCurrentBrowserVersion(); $ipNr = Medlem::getCurrentIpNr(); $mess = $host . " \n Browser used: " . $browserPlain; if (isset($USER)) { $mess .= "\n id: " . $USER->getId(); $mess .= "\n Username: "******"\n Email: " . $USER->getEpost(); } $mess .= "\n Referal page: " . $_SERVER['HTTP_REFERER']; $mess .= "\n Error page: " . $_SERVER['REQUEST_URI']; $mess .= "\n Get Aguments: " . print_r($_GET, true); $mess .= "\n Post Arguments: " . print_r($_POST, true); $mess .= "\n DateTime: " . date('Y-m-d H-i-s'); $mess .= " \n Ip: " . $ipNr . " \n\n " . $mess_err; unset($smarty); } if (defined('DEBUG_IM') && DEBUG_IM && !DEBUG && !(!get_class($e) == "GruppException" && !get_class($e) == "MedlemException" && !get_class($e) == "SecurityException")) { global $IM, $SETTINGS; $IM->login(DEBUG_IM_MAIL, DEBUG_IM_PASS); foreach ($SETTINGS['im_recip'] as $mail) { $IM->createSession($mail); $IM->sendMessage($mess); } } if (defined('DEBUG_MAIL') && DEBUG_MAIL && !DEBUG && !(!get_class($e) == "GruppException" && !get_class($e) == "MedlemException" && !get_class($e) == "SecurityException")) { foreach ($SETTINGS["debug_mail"] as $mail) { @Misc::sendEmail($mail, $SETTINGS["email"], "Debug meddelande från motiomera", $mess); } } if (get_class($e) == "UserException") { return false; } $smarty = new MMSmarty(); if (DEBUG) { $smarty->assign("error", $e); } $smarty->display('error.tpl'); exit; }