本文整理汇总了PHP中GWF_Session::getLastURL方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_Session::getLastURL方法的具体用法?PHP GWF_Session::getLastURL怎么用?PHP GWF_Session::getLastURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_Session
的用法示例。
在下文中一共展示了GWF_Session::getLastURL方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onVote
private function onVote(GWF_VoteMulti $poll, $user)
{
$opts = Common::getPostArray('opt', array());
$taken = array();
$max = $poll->getNumChoices();
foreach ($opts as $i => $stub) {
$i = (int) $i;
if ($i < 1 || $i > $max) {
continue;
}
if (!in_array($i, $taken, true)) {
$taken[] = $i;
}
}
$count = count($taken);
// if ($count === 0) {
// return $this->module->error('err_no_options');
// }
if (!$poll->isMultipleChoice() && $count !== 1) {
return $this->module->error('err_no_multi');
}
if (false === $poll->onVote($user, $taken)) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
return $this->module->message('msg_voted', array(htmlspecialchars(GWF_Session::getLastURL())));
}
示例2: execute
public function execute()
{
if (false === ($user = GWF_Session::getUser()) && !$this->module->cfgGuestShouts()) {
return GWF_HTML::err('ERR_LOGIN_REQUIRED');
}
if ($user !== false && $user->isWebspider()) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
if (false !== ($error = $this->isFlooding())) {
return $error;
}
$message = Common::getPost('message', '');
if (false !== ($error = $this->validate_message($message))) {
return GWF_HTML::error('Shoutbox', $error);
}
$entry = new GWF_Shoutbox(array('shout_id' => '0', 'shout_uid' => GWF_Session::getUserID(), 'shout_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'shout_uname' => GWF_Shoutbox::generateUsername(), 'shout_message' => $message));
if (false === $entry->insert()) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if ($this->module->cfgEMailModeration()) {
$this->onEMailModeration($user, $entry);
}
$url = htmlspecialchars(GWF_Session::getLastURL());
return $this->module->message('msg_shouted', array($url, $url));
}
示例3: redirectBack
public static function redirectBack()
{
$url = GWF_WEB_ROOT;
if (false !== ($url2 = GWF_Session::getLastURL())) {
$url = GWF_WEB_ROOT . ltrim($url2, '/');
}
self::redirect($url);
}
示例4: execute
public function execute(GWF_Module $module)
{
if (GWF_Session::haveCookies()) {
GWF_Session::set(GWF_Browser::SESS_DETECTION, 1);
GWF_Session::set(GWF_Browser::SESS_RESOLUTION, array(intval(Common::getGet('w', -1)), intval(Common::getGet('h', -1))));
GWF_Website::redirectBack();
} else {
$url = Common::getGet('url', GWF_Session::getLastURL());
if ($module->cfgFallbackSessions()) {
GWF_Session::createFallback($url);
GWF_Website::redirect(GWF_WEB_ROOT . 'index.php?mo=GWF&me=CookieCheck&level=2&url=' . urlencode($url));
} else {
GWF_Website::redirectBack();
}
}
}
示例5: execute
public function execute(GWF_Module $module)
{
$url = Common::getGet('url', GWF_Session::getLastURL());
switch (Common::getGet('level')) {
case '1':
if (GWF_Session::haveCookies() === true) {
GWF_Website::redirectBack();
} elseif ($module->cfgFallbackSessions()) {
GWF_Session::createFallback($url);
GWF_Website::redirect(GWF_WEB_ROOT . 'index.php?mo=GWF&me=CookieCheck&level=2&url=' . urlencode($url));
} else {
GWF_Website::redirect($url);
}
break;
case '2':
// var_dump($_SERVER);
GWF_Website::redirect($url);
break;
default:
return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'level'));
}
}
示例6: onLoggedIn
private function onLoggedIn(GWF_User $user, $isAjax)
{
$last_url = GWF_Session::getLastURL();
if (false === GWF_Session::onLogin($user, isset($_POST['bind_ip']))) {
return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
}
require_once GWF_CORE_PATH . 'module/Login/GWF_LoginHistory.php';
GWF_LoginHistory::insertEvent($user->getID());
# save last login time
$user->saveVar('user_lastlogin', time());
if ($this->module->cfgCleanupAlways()) {
GWF_LoginFailure::cleanupUser($user->getID());
}
if ($isAjax) {
return sprintf('1:%s', GWF_Session::getSessID());
} else {
GWF_Session::set('GWF_LOGIN_BACK', $last_url);
if (false !== ($lang = $user->getLanguage())) {
GWF_Language::setCurrentLanguage($lang);
}
if (0 < ($fails = GWF_LoginFailure::getFailCount($user, $this->module->cfgTryExceed()))) {
GWF_Session::set('GWF_LOGIN_FAILS', $fails);
}
GWF_Website::redirect(GWF_WEB_ROOT . 'welcome');
}
}
示例7: onVoted
private function onVoted($user)
{
GWF_Hook::call(GWF_Hook::VOTED_SCORE, $user, array($this->votescore->getID(), $this->score));
return isset($_GET['ajax']) ? $this->module->message('msg_voted_ajax') : $this->module->message('msg_voted', array(GWF_Session::getLastURL()));
}