當前位置: 首頁>>代碼示例>>PHP>>正文


PHP cmsUser::isSessionSet方法代碼示例

本文整理匯總了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));
 }
開發者ID:asphix,項目名稱:icms2,代碼行數:25,代碼來源:install_ftp.php

示例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));
 }
開發者ID:Val-Git,項目名稱:icms2,代碼行數:28,代碼來源:install_ftp.php

示例3: getCSRFToken

 public static function getCSRFToken()
 {
     if (cmsUser::isSessionSet('csrf_token')) {
         return cmsUser::sessionGet('csrf_token');
     }
     return self::generateCSRFToken();
 }
開發者ID:asphix,項目名稱:icms2,代碼行數:7,代碼來源:form.php


注:本文中的cmsUser::isSessionSet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。