本文整理汇总了PHP中IPAddress::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP IPAddress::getInstance方法的具体用法?PHP IPAddress::getInstance怎么用?PHP IPAddress::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPAddress
的用法示例。
在下文中一共展示了IPAddress::getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
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);
}
}
示例2: tpl
public function tpl()
{
return IPAddress::getInstance()->has_x_student() ? 'minimodules/jtx/internal.tpl' : 'minimodules/jtx/external.tpl';
}
示例3: getSilentWithValues
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()');
}
示例4: run
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'));
}
}
示例5: handler_universe
function handler_universe($page)
{
$page->assign('remip', IPAddress::getInstance());
echo $page->fetch('universe.tpl');
exit;
}