<?php require_once 'includes.php'; $session = new Session(); $tpl = new Template(); $tpl->assign('system_name', $systemName); $tpl->assign('system_version', $systemVersion); if ($session->isRegistered('client')) { $pdo = PDOConnection::getInstance(); $client_session = $session->get('client'); $client = array('client_id' => $client_session['client_id'], 'status' => 3); $pdo->prepare('UPDATE client SET status = :status WHERE client_id = :client_id LIMIT 1')->execute($client); /* Histórico */ $pdo->prepare('UPDATE client_history SET status = :status WHERE client_id = :client_id LIMIT 1')->execute($client); $session->destroy('client'); } $tpl->show();
/** * Return the current site navigation object * @return SiteNavigation - the site navigation object * @access public * @static */ public static function current() { if (Session::isRegistered('site_navigation')) { $ret = Session::getRegistered('site_navigation'); } else { $ret = ''; } return $ret; }
<?php require_once 'includes.php'; $session = new Session(); if (!$session->isRegistered('user')) { header('Location: index.php'); exit; } $tpl = new Template(); $tpl->assign('system_name', $systemName); $tpl->assign('system_version', $systemVersion); $user = $session->get('user'); $tpl->assign('user_id', $user['user_id']); $tpl->assign('user_name', $user['name']); $tpl->assign('user_email', $user['email']); $tpl->assign('user_status', $user['status']); $tpl->assign('user_photo', $user['photo']); if ($user['level'] == 1) { $tpl->block('administrator'); } $tpl->show();
/** * This method initialises the system user. Called from within {@link Application::appInit()} * * A system user needs to implement the interface {@link SystemUser}. The default behaviour * of this function is to return an object of the class {@link DefaultUser} which implements * the {@link SystemUser} interface. If you need to change the class of user that is used * by the application, then you should override the {@link Application::defaultUser()} method. * @access protected * @see DefaultUser,SystemUser,Application::defaultUser(),Application::resetUser() */ private function initUser() { if (!$this->user) { if (!Session::isRegistered('application_user')) { $this->resetUser(); } else { $this->user = Session::getRegistered('application_user'); } } }
public function isImpersonated() { return Session::isRegistered('not_impersonated_user'); }