public function __construct() { parent::__construct(); // Try to set better auth than AUTH_PUBLIC depending on the origin of the IP if (S::i('auth') < AUTH_INTERNAL && IPAddress::getInstance()->is_x_internal()) { S::set('auth', AUTH_INTERNAL); } }
public function tpl() { return IPAddress::getInstance()->has_x_student() ? 'minimodules/jtx/internal.tpl' : 'minimodules/jtx/external.tpl'; }
public static function getSilentWithValues($login, $values) { global $globals; if ($login == 0) { // If the anonymous_user is already in session if (S::has('anonymous_user')) { return S::v('anonymous_user'); } $uid = IPAddress::getInstance()->is_x_internal() ? $globals->anonymous->internal : $globals->anonymous->external; S::set('newuid', $uid); try { $u = new User($uid); $u->select(UserSelect::login()); } catch (Exception $e) { S::kill('newuid'); throw $e; } S::kill('newuid'); S::set('anonymous_user', $u); return $u; } throw new Exception('DEPRECATED call to getSilentWithValues()'); }
public function run() { $skin = $this->load_skin(); $this->assign('skin', S::v('skin')); $user = S::user(); $this->assign('user', $user); $this->assign('logged', !is_null($user) && S::logged()); // Remote IP $this->assign('remip', IPAddress::getInstance()); $this->assign('MiniModules_COL_FLOAT', FrankizMiniModule::get(S::user()->minimodules(FrankizMiniModule::COL_FLOAT))); $this->addCssLink(FrankizMiniModule::batchCss()); // Enable JSON loading of the module only if (Env::has('solo')) { $this->jsonAssign('content', $this->raw()); $this->jsonAssign('title', $this->get_template_vars('title')); $this->jsonAssign('pl_css', $this->get_template_vars('pl_css')); $this->jsonAssign('pl_js', $this->get_template_vars('pl_js')); $this->runJSon(); } else { $this->assign('quick_validate', array()); if (S::user()->castes(Rights::admin())->count() > 0) { $validate_filter = new ValidateFilter(new VFC_User(S::user())); $validates = $validate_filter->get()->select(ValidateSelect::quick()); $quick_validate = $validates->split('group'); $this->assign('quick_validate', $quick_validate); } $request_filter = new ValidateFilter(new VFC_Writer(S::user())); $requests = $request_filter->get()->select(ValidateSelect::quick()); $this->assign('self_url', pl_self()); $this->assign('quick_requests', $requests); $this->_run(self::getTplPath('frankiz.tpl')); } }
function handler_universe($page) { $page->assign('remip', IPAddress::getInstance()); echo $page->fetch('universe.tpl'); exit; }