Ejemplo n.º 1
0
 /**
  * beforeFilter
  *
  * @return void
  **/
 public function beforeFilter()
 {
     // Load available authenticators
     $authenticators = $this->getAuthenticators();
     $this->set('authenticators', $authenticators);
     $this->__setDefaultAuthenticator();
     parent::beforeFilter();
     $this->Auth->allow('login', 'logout');
 }
Ejemplo n.º 2
0
 /**
  * beforeFilter
  *
  * @return void
  **/
 public function beforeFilter()
 {
     // Load available authenticators
     $authenticators = $this->_getAuthenticators();
     $this->set('authenticators', $authenticators);
     $this->__setDefaultAuthenticator();
     parent::beforeFilter();
     $this->Auth->allow('login', 'logout');
     $this->Session->delete('AutoUserRegist');
     $this->Session->delete('ForgotPass');
 }
Ejemplo n.º 3
0
 /**
  * beforeFilter
  *
  * @return void
  **/
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow('request', 'confirm', 'update');
     //ページタイトル
     $this->set('pageTitle', __d('auth', 'Forgot your Password?'));
     SiteSettingUtil::setup('ForgotPass');
     if (!SiteSettingUtil::read('ForgotPass.use_password_reissue', '0')) {
         return $this->setAction('throwBadRequest');
     }
     //メール通知の場合、NetCommonsMailUtilityをメンバー変数にセットする。Mockであれば、newをしない。
     //テストでMockに差し替えが必要なための処理であるので、カバレッジレポートから除外する。
     //@codeCoverageIgnoreStart
     if (substr(get_class($this->mail), 0, 4) !== 'Mock') {
         $this->mail = new NetCommonsMail();
     }
     //@codeCoverageIgnoreEnd
 }
Ejemplo n.º 4
0
 /**
  * beforeFilter
  *
  * @return void
  **/
 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow('entry_key', 'request', 'confirm', 'completion', 'approval', 'acceptance');
     //ページタイトル
     $this->set('pageTitle', __d('auth', 'Sign up'));
     SiteSettingUtil::setup('AutoRegist');
     //SiteSettingUtil::setup(array(
     //	// * 入会設定
     //	// ** 自動会員登録を許可する
     //	'AutoRegist.use_automatic_register',
     //	// ** アカウント登録の最終決定
     //	'AutoRegist.confirmation',
     //	// ** 入力キーの使用
     //	'AutoRegist.use_secret_key',
     //	// ** 入力キー
     //	'AutoRegist.secret_key',
     //	// ** 自動登録時の権限
     //	'AutoRegist.role_key',
     //	// ** 自動登録時にデフォルトルームに参加する
     //	'AutoRegist.prarticipate_default_room',
     //
     //	// ** 利用許諾文
     //	'AutoRegist.disclaimer',
     //	// ** 会員登録承認メールの件名
     //	'AutoRegist.approval_mail_subject',
     //	// ** 会員登録承認メールの本文
     //	'AutoRegist.approval_mail_body',
     //	// ** 会員登録受付メールの件名
     //	'AutoRegist.acceptance_mail_subject',
     //	// ** 会員登録受付メールの本文
     //	'AutoRegist.acceptance_mail_body',
     //));
     if (!SiteSettingUtil::read('AutoRegist.use_automatic_register', false)) {
         return $this->setAction('throwBadRequest');
     }
     if (in_array($this->params['action'], ['approval', 'acceptance'], true) && Hash::get($this->request->query, 'activate_key')) {
         $this->helpers['NetCommons.Wizard']['navibar'] = Hash::remove($this->helpers['NetCommons.Wizard']['navibar'], self::WIZARD_ENTRY_KEY);
     } else {
         //管理者の承認が必要の場合、ウィザードの文言変更
         $value = SiteSettingUtil::read('AutoRegist.confirmation');
         if ($value === AutoUserRegist::CONFIRMATION_ADMIN_APPROVAL) {
             $this->helpers['NetCommons.Wizard']['navibar'] = Hash::insert($this->helpers['NetCommons.Wizard']['navibar'], self::WIZARD_COMPLETION . '.label', array('auth', 'Complete request registration.'));
         }
         //入力キーのチェック
         $value = SiteSettingUtil::read('AutoRegist.use_secret_key');
         if ($value) {
             if (!in_array($this->params['action'], ['approval', 'acceptance'], true) && !$this->Session->read('AutoUserRegistKey')) {
                 if ($this->params['action'] === 'entry_key') {
                     $this->Session->delete('AutoUserRegistKey');
                     $this->Session->write('AutoUserRegistRedirect', 'request');
                 } else {
                     $this->Session->write('AutoUserRegistRedirect', $this->params['action']);
                 }
                 $this->setAction('entry_key');
             }
         } else {
             $this->helpers['NetCommons.Wizard']['navibar'] = Hash::remove($this->helpers['NetCommons.Wizard']['navibar'], self::WIZARD_ENTRY_KEY);
         }
     }
 }