本文整理匯總了PHP中jAuth::isPersistant方法的典型用法代碼示例。如果您正苦於以下問題:PHP jAuth::isPersistant方法的具體用法?PHP jAuth::isPersistant怎麽用?PHP jAuth::isPersistant使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jAuth
的用法示例。
在下文中一共展示了jAuth::isPersistant方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _prepareTpl
protected function _prepareTpl()
{
$config = new \Jelix\JCommunity\Config();
$this->_tpl->assign('canRegister', $config->isRegistrationEnabled());
$this->_tpl->assign('canResetPassword', $config->isResetPasswordEnabled());
if (jAuth::isConnected()) {
$this->_tpl->assign('login', jAuth::getUserSession()->login);
} else {
$conf = jAuth::loadConfig();
$this->_tpl->assign('persistance_ok', jAuth::isPersistant());
$form = jForms::get("jcommunity~login");
if (!$form) {
$form = jForms::create("jcommunity~login");
}
$this->_tpl->assign('form', $form);
$this->_tpl->assign('url_return', '');
if ($conf['enable_after_login_override']) {
$req = jApp::coord()->request;
if ($req->getParam('auth_url_return')) {
$this->_tpl->assign('url_return', $req->getParam('auth_url_return'));
} else {
if ($this->param('as_main_content')) {
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] && $_SERVER['HTTP_REFERER'] != jUrl::getCurrentUrl(false, true)) {
$this->_tpl->assign('url_return', $_SERVER['HTTP_REFERER']);
}
} else {
if ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') {
$this->_tpl->assign('url_return', jUrl::getCurrentUrl(false, true));
}
}
}
}
}
}
示例2: form
/**
* Shows the login form
*/
function form()
{
$conf = $GLOBALS['gJCoord']->getPlugin('auth')->config;
if (jAuth::isConnected()) {
if ($conf['after_login'] != '') {
if (!($conf['enable_after_login_override'] && ($url_return = $this->param('auth_url_return')))) {
$url_return = jUrl::get($conf['after_login']);
}
$rep = $this->getResponse('redirectUrl');
$rep->url = $url_return;
return $rep;
}
}
$rep = $this->getResponse('htmlauth');
$rep->title = jLocale::get('auth.titlePage.login');
$rep->bodyTpl = 'jauth~index';
$zp = array('login' => $this->param('login'), 'failed' => $this->param('failed'), 'showRememberMe' => jAuth::isPersistant());
if ($conf['enable_after_login_override']) {
$zp['auth_url_return'] = $this->param('auth_url_return');
}
$rep->body->assignZone('MAIN', 'jauth~loginform', $zp);
return $rep;
}