本文整理汇总了PHP中Framework::Redir方法的典型用法代码示例。如果您正苦于以下问题:PHP Framework::Redir方法的具体用法?PHP Framework::Redir怎么用?PHP Framework::Redir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework
的用法示例。
在下文中一共展示了Framework::Redir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
// check if logged in session is valid, if not redir to main page
if (!isset($_SESSION['loginHash'])) {
Framework::Redir("site/index");
die;
}
$activeSession = R::findOne('session', ' hash = ? AND ip = ? AND expires > ?', array($_SESSION['loginHash'], $_SERVER['REMOTE_ADDR'], time()));
if (!$activeSession) {
unset($_SESSION['loginHash']);
Framework::Redir("site/index/main/session_expired");
die;
}
$activeSession->expires = time() + SESSION_MAX_AGE * 2;
R::store($activeSession);
$this->session = $activeSession;
$this->user = R::load('user', $this->session->user->getId());
Framework::TPL()->assign('user_premium', $this->user->hasPremium());
// check needed rights if any
foreach ($this->_rights as $r) {
if (!$this->user->hasRight($r)) {
Framework::Redir("game/index");
die;
}
}
}
示例2: show_Activate
public function show_Activate()
{
$aHash = $this->get(1);
$user = R::findOne('user', ' activation_code = ?', array($aHash));
if (!$user) {
echo "Ungültiger Aktivierungscode";
exit;
}
$user->activation_code = '';
$user->is_active = true;
R::store($user);
Framework::Redir("site/index/main/login");
}
示例3: switchTable
private function switchTable()
{
if (isset($_POST['switchTable'])) {
$_SESSION['currentTable'] = $_POST['switchTable'];
Framework::Redir("game/db_admin");
}
if (!isset($_SESSION['currentTable']) || !in_array($_SESSION['currentTable'], array_keys($this->dbTables))) {
$_SESSION['currentTable'] = 'map_object';
}
$this->currentTable = $_SESSION['currentTable'];
Framework::TPL()->assign('currentTable', $this->currentTable);
Framework::TPL()->assign('dbTables', $this->dbTables);
}