本文整理汇总了PHP中cmsUser::isSessionSet方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::isSessionSet方法的具体用法?PHP cmsUser::isSessionSet怎么用?PHP cmsUser::isSessionSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cmsUser
的用法示例。
在下文中一共展示了cmsUser::isSessionSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
if (!$this->getPackageContentsDir()) {
$this->redirectToAction('install/finish');
}
$form = $this->getForm('ftp');
$is_submitted = $this->request->has('submit');
$account = cmsUser::isSessionSet('ftp_account') ? cmsUser::sessionGet('ftp_account') : array();
if ($is_submitted) {
$account = array_merge($account, $form->parse($this->request, $is_submitted, $account));
cmsUser::sessionSet('ftp_account', $account);
$errors = $form->validate($this, $account);
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
if (!$errors) {
$account['host'] = trim(str_replace('ftp://', '', $account['host']), '/');
if ($account['path'] != '/') {
$account['path'] = '/' . trim($account['path'], '/') . '/';
}
$this->uploadPackageToFTP($account);
}
}
return cmsTemplate::getInstance()->render('install_ftp', array('account' => $account, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
示例2: run
public function run()
{
if (!$this->getPackageContentsDir()) {
$this->redirectToAction('install/finish');
}
$form = $this->getForm('ftp');
$account = cmsUser::isSessionSet('ftp_account') ? cmsUser::sessionGet('ftp_account') : array();
if ($this->request->has('submit')) {
$account = array_merge($account, $form->parse($this->request, true, $account));
if ($account['save_to_session']) {
cmsUser::sessionSet('ftp_account', $account);
} else {
cmsUser::sessionSet('ftp_account', array('host' => $account['host'], 'path' => $account['path'], 'is_pasv' => $account['is_pasv']));
}
$errors = $form->validate($this, $account);
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
if (!$errors) {
$account['host'] = trim(str_replace('ftp://', '', $account['host']), '/');
if ($account['path'] != '/') {
$account['path'] = '/' . trim($account['path'], '/') . '/';
}
$this->uploadPackageToFTP($account);
}
}
return $this->cms_template->render('install_ftp', array('manifest' => $this->parsePackageManifest(), 'account' => $account, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
示例3: getCSRFToken
public static function getCSRFToken()
{
if (cmsUser::isSessionSet('csrf_token')) {
return cmsUser::sessionGet('csrf_token');
}
return self::generateCSRFToken();
}