function __construct() { parent::__construct(); includeeasyhelper('logger'); adddependency($this->gethandlername(), $this->getversion(), COMPONENT_HANDLER, 'logger', '1.0.0.2', COMPONENT_HELPER); adddependency($this->gethandlername(), $this->getversion(), COMPONENT_HANDLER, 'easysecurity', '1.0.0.0', COMPONENT_LIBRARY); $this->easysecurity = geteasylibrary('easysecurity'); }
function getinireqvalue($folder, $inifile, $section, $label) { $retval = false; if (file_exists($folder)) { $ini = geteasylibrary('easyinireaderwriter'); if ($ini->loadinifile($folder . '/' . $inifile)) { $retval = $ini->getvalue($section, $label); } } return $retval; }
/** * @brief Return easysession object. */ function geteasysecurity() { return geteasylibrary('easysecurity'); }
function handleerror($err) { $message = ''; if ($err == SESSION_INVALID_SESSIONID) { $message = 'Invalid session id!'; } else { if ($err == SESSION_IPADDRESS_MISMATCH) { $message = 'IP address mismatch!'; } else { if ($err == SESSION_USERAGENT_MISMATCH) { $message = 'User agent mismatch!'; } else { if ($err == SESSION_IPADDRESS_MISSING) { $message = 'Missing IP address!'; } else { if ($err == SESSION_LASTACTIVITY_MISSING) { $message = 'Missing last activity!'; } else { if ($err == SESSION_EXPIRED) { $message = 'Session expired!'; } else { if ($err == SESSION_SESSIONID_MISMATCH) { $message = 'Session id mismatch!'; } } } } } } } if ($err != SESSION_OK) { $baseurl = geteasylibrary('easyurl')->getbaseurl(); showerror('Warning', $message, $baseurl, 'defaulterror', 'warning'); $this->write(); exit; } }
/** * @brief Run a controller */ function run() { log_message(LOGGER_DEBUG, 'called function: ' . easy::$instance->getlibraryname() . '.' . __FUNCTION__ . ' begin'); setloglevel(getinivalue('config', 'config.ini', 'system', 'loglevel', LOGGER_DEBUG)); easy::$instance->html_linebreak = getinivalue('config', 'config.ini', 'system', 'html_linebreak', 'yes'); session_start(); $easyurl = geteasylibrary('easyurl'); $controller = geteasycontroller($easyurl->getcontrollername()); $this->cssname = $controller->getcssname(); $easysession = geteasylibrary('easysession'); $easysecurity = geteasylibrary('easysecurity'); log_message(LOGGER_SYSTEM, $controller->getcontrollername() . ' controller object is created. version:' . $controller->getcontrollerversion()); log_message(LOGGER_DEBUG, 'called function: ' . $controller->getcontrollername() . '.' . $easyurl->getfunctionname() . ' begin'); if (method_exists($controller, $easyurl->getfunctionname())) { $controller->{$easyurl->getfunctionname()}(); } else { showerror('Hiba', 'A route bejegyzésben hibás metódus hivatkozás van (' . $easyurl->getfunctionname() . ').'); } log_message(LOGGER_DEBUG, 'called function: ' . $controller->getcontrollername() . '.' . $easyurl->getfunctionname() . ' end'); $easysession->write(); log_message(LOGGER_DEBUG, 'called function: ' . easy::$instance->getlibraryname() . '.' . __FUNCTION__ . ' end'); }