protected function _beforeRender() { // URL // -------------------------------------------------- /* FIXME replace with single 'registered object' in smarty! */ $this->assign('this', $this); $this->assign('url', Url::$data); Globe::ForLayout('url', Url::$data); // SITE // -------------------------------------------------- Globe::ForLayout('sitename', SITE_NAME); Globe::ForLayout('footer', FOOTER); Globe::ForLayout('time', time()); // ADMIN // -------------------------------------------------- if (Url::GetData('is_admin')) { $this->assign('ADMIN_ROUTE', ADMIN_ROUTE); } // SUBDOMAIN // -------------------------------------------------- if (Url::GetData('is_subdomain') && $this->layout == DEFAULT_LAYOUT) { $this->layout = 'subdomain'; } // NAVIGATION // -------------------------------------------------- // pre/append $this->nav = array_merge($this->nav_prepend, $this->nav, $this->nav_append); // save Globe::ForLayout('nav', $this->nav); // active? Globe::ForLayout('nav_active', ''); foreach ($this->nav as $label => $link) { if (strpos(DS . Url::$data['_url'], $link) === 0) { Globe::ForLayout('nav_active', $label); // FIXME what the hell is this doing in endo?! Globe::ForLayout('title', $label != 'LiveIt! Lessons' ? trim(str_replace('LiveIt!', '', $label)) : 'Lesson ' . $this->View->_tpl_vars['lesson']); } } // AJAX // -------------------------------------------------- $this->assign('is_ajax', $this->is_ajax()); // ACL // -------------------------------------------------- Globe::ForLayout('LoggedIn', $this->assign('LoggedIn', AppUser::Clean($this->LoggedIn))); }
/** * Saves the logged-in User into Session and Cookie * @param boolean $soft do soft log-in (resets cookie if exists) */ static function SetCurrent($user, $soft = false) { // correct class & extend $user = AppUser::FindById($user->class, $user->id, true, true); // cookie if (Url::GetRequest(AppUser::REMEMBER_ME, false) || $soft && AppUser::GetCookie()) { AppUser::SetCookie($user); } // session AppUser::SetSession($user); // return return AppUser::Clean($user); }