本文整理汇总了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;
}