/**
  * @inheritdoc
  * 
  * Creates the default cache component if it is not provided.
  */
 public function init()
 {
     parent::init();
     $this->controllerNamespace = 'jlorente\\captcha';
     $this->setAliases(['@captchaRoute' => '/' . $this->getUniqueId() . '/captcha/index']);
     if (empty($this->cache)) {
         $this->setCache(['class' => ApcCache::className(), 'keyPrefix' => 'captcha_']);
     }
     if (empty($this->captchaAction)) {
         $this->captchaAction = ['class' => CaptchaAction::className(), 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null];
     }
 }
Beispiel #2
0
 /**
  * Initializes the class map.
  */
 protected function initClassMap()
 {
     $this->classMap = ArrayHelper::merge([self::CLASS_ACCOUNT => Account::className(), self::CLASS_TOKEN => AccountToken::className(), self::CLASS_PROVIDER => AccountProvider::className(), self::CLASS_LOGIN_HISTORY => AccountLoginHistory::className(), self::CLASS_PASSWORD_HISTORY => AccountPasswordHistory::className(), self::CLASS_LOGIN_FORM => LoginForm::className(), self::CLASS_PASSWORD_FORM => PasswordForm::className(), self::CLASS_SIGNUP_FORM => SignupForm::className(), self::CLASS_CONNECT_FORM => ConnectForm::className(), self::CLASS_FORGOT_PASSWORD_FORM => ForgotPasswordForm::className(), self::CLASS_WEB_USER => User::className(), self::CLASS_CAPTCHA => Captcha::className(), self::CLASS_CAPTCHA_ACTION => CaptchaAction::className(), self::CLASS_PASSWORD_BEHAVIOR => PasswordAttributeBehavior::className(), self::CLASS_PASSWORD_VALIDATOR => PasswordStrengthValidator::className()], $this->classMap);
 }
 public function actions()
 {
     return ['captcha' => ['class' => CaptchaAction::className()]];
 }
Beispiel #4
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ['error' => ['class' => ErrorAction::className()], 'about' => ['class' => ViewAction::className(), 'defaultView' => 'about'], 'captcha' => ['class' => CaptchaAction::className(), 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, 'backColor' => 0xf5f5f5, 'height' => 34]];
 }
 public function actions()
 {
     return ['captcha' => ['class' => CaptchaAction::className(), 'minLength' => 7, 'maxLength' => 7]];
 }
Beispiel #6
0
 public function actions()
 {
     return ['error' => ['class' => ErrorAction::className()], 'captcha' => ['class' => CaptchaAction::className(), 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null]];
 }