当前位置: 首页>>代码示例>>PHP>>正文


PHP UserModule::doCaptcha方法代码示例

本文整理汇总了PHP中UserModule::doCaptcha方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModule::doCaptcha方法的具体用法?PHP UserModule::doCaptcha怎么用?PHP UserModule::doCaptcha使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserModule的用法示例。


在下文中一共展示了UserModule::doCaptcha方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rules

 public function rules()
 {
     $rules = array(array('username, password, verifyPassword, email', 'required'), array('username', 'length', 'max' => 20, 'min' => 3, 'message' => t("Incorrect username (length between 3 and 20 characters).")), array('password', 'length', 'max' => 128, 'min' => 4, 'message' => t("Incorrect password (minimal length 4 symbols).")), array('email', 'email'), array('username', 'unique', 'message' => t("This user's name already exists.")), array('create_at', 'default', 'value' => date('Y-m-d H:i:s'), 'setOnEmpty' => true, 'on' => 'insert'), array('lastvisit_at', 'default', 'value' => '0000-00-00 00:00:00', 'setOnEmpty' => true, 'on' => 'insert'), array('email', 'unique', 'message' => t("This user's email address already exists.")), array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u', 'message' => t("Incorrect symbols (A-z0-9).")));
     if (!(isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form')) {
         array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
     }
     array_push($rules, array('verifyPassword', 'compare', 'compareAttribute' => 'password', 'message' => t("Retype Password is incorrect.")));
     return $rules;
 }
开发者ID:kosenka,项目名称:yboard,代码行数:9,代码来源:RegistrationForm.php

示例2: rules

 public function rules()
 {
     $rules = array(array('username, password, verifyPassword, email', 'required'), array('username', 'length', 'max' => 20, 'min' => 4, 'message' => UserModule::t("Incorrect username (length between 4 and 20 characters).")), array('password', 'length', 'max' => 128, 'min' => 8, 'message' => UserModule::t("Incorrect password (minimal length 8 symbols).")), array('password', 'match', 'pattern' => '/^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$/', 'message' => UserModule::t("Password must contain at least one digit, one uppercase letter and one lowercase letter.")), array('email', 'email'), array('username', 'unique', 'message' => UserModule::t("Username already registered.")), array('email', 'unique', 'message' => UserModule::t("Email address already registered.")), array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u', 'message' => UserModule::t("Incorrect symbols (use letters, numbers and '_').")));
     if (!(isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form')) {
         array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
     }
     array_push($rules, array('verifyPassword', 'compare', 'compareAttribute' => 'password', 'message' => UserModule::t("Retyped password doesn't match.")));
     return $rules;
 }
开发者ID:alsvader,项目名称:hackbanero,代码行数:9,代码来源:RegistrationForm.php

示例3: rules

 public function rules()
 {
     $rules = array(array('username, password, verifyPassword, email', 'required'), array('username', 'length', 'max' => 20, 'min' => 3, 'message' => UserModule::t("Incorrect username (length between 3 and 20 characters).")), array('password', 'length', 'max' => 128, 'min' => 4, 'message' => UserModule::t("Incorrect password (minimal length 4 symbols).")), array('email', 'email'), array('username', 'unique', 'message' => UserModule::t("Username is already taken.")), array('email', 'unique', 'message' => UserModule::t("This user's email address already exists.")), array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u', 'message' => UserModule::t("Incorrect symbols (A-z0-9).")));
     if (!(isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form')) {
         array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
     }
     array_push($rules, array('verifyPassword', 'compare', 'compareAttribute' => 'password', 'message' => UserModule::t("Passwords do not match!")));
     return $rules;
 }
开发者ID:awecode,项目名称:awecms,代码行数:9,代码来源:RegistrationForm.php

示例4: rules

 public function rules()
 {
     $rules = array(array('username', 'required'), array('email', 'required', 'message' => 'Укажите ваш E-mail'), array('password', 'required', 'message' => 'Укажите пароль'), array('verifyPassword', 'required', 'message' => 'Повторите пароль'), array('password', 'length', 'max' => 128, 'min' => 4, 'message' => UserModule::t("Неверный пароль (минимальная лина 4 символа).")), array('email', 'email', 'message' => 'Неверный формат'), array('username', 'unique', 'message' => UserModule::t("This user's name already exists.")), array('email', 'unique', 'message' => UserModule::t("Данный email уже имеется в базе.")));
     if (!(isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form')) {
         array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
     }
     array_push($rules, array('verifyPassword', 'compare', 'compareAttribute' => 'password', 'message' => UserModule::t("Повторите в точности ваш пароль.")));
     return $rules;
 }
开发者ID:aldegtyarev,项目名称:zru,代码行数:9,代码来源:RegistrationForm.php

示例5: rules

 public function rules()
 {
     $rules = array(array('username, password, verifyPassword, email, timezone, service', 'required'), array('username', 'length', 'max' => 255, 'min' => 3, 'message' => UserModule::t("Minimum 3 Characters).")), array('password', 'length', 'max' => 512, 'min' => 6, 'message' => UserModule::t("Minimum 6 Characters")), array('email', 'email'), array('username', 'unique', 'message' => UserModule::t("This user's name already exists.")), array('email', 'unique', 'message' => UserModule::t("This user's email address already exists.")), array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u', 'message' => UserModule::t("Incorrect symbols (A-z0-9).")), array('timezone', 'length', 'max' => 100), array('firstname, lastname', 'length', 'max' => 200), array('service, visible_to_public, organisation_id, organisation_administrator', 'numerical', 'integerOnly' => true), array('verifyCode', 'safe'));
     if (!(isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form')) {
         array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
     }
     array_push($rules, array('verifyPassword', 'compare', 'compareAttribute' => 'password', 'message' => UserModule::t("Retype Password is incorrect.")));
     return $rules;
 }
开发者ID:sjnlabs2013,项目名称:sampleyii,代码行数:9,代码来源:RegistrationForm.php

示例6: rules

 public function rules()
 {
     $rules = array(array('username, password, verifyPassword, email', 'required'), array('password', 'length', 'max' => 128, 'min' => 4, 'message' => UserModule::t("Incorrect password (minimal length 4 symbols).")), array('email', 'email'), array('email', 'unique', 'message' => UserModule::t("This user's email address already exists.")), array('verifyPassword', 'compare', 'compareAttribute' => 'password', 'message' => UserModule::t("Retype Password is incorrect.")));
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form') {
         return $rules;
     } else {
         array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
     }
     return $rules;
 }
开发者ID:andreyantonov78,项目名称:atmosphera,代码行数:10,代码来源:RegistrationForm.php

示例7: rules

 public function rules()
 {
     $u1 = Yii::app()->getModule('user')->disableUsername ? '' : 'username, ';
     $u2 = Yii::app()->getModule('user')->disableUsername ? array('', 'safe') : array('username', 'length', 'max' => 20, 'min' => 3, 'message' => UserModule::t("Incorrect username (length between 3 and 20 characters)."));
     $u3 = Yii::app()->getModule('user')->disableUsername ? array('', 'safe') : array('username', 'unique', 'message' => UserModule::t("This user's name already exists."));
     $rules = array(array($u1 . 'password, verifyPassword, email', 'required'), $u2, $u3, array('password', 'length', 'max' => 128, 'min' => 4, 'message' => UserModule::t("Incorrect password (minimal length 4 symbols).")), array('email', 'email'), array('email', 'unique', 'message' => UserModule::t("This user's email address already exists.")), array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u', 'message' => UserModule::t("Incorrect symbols (A-z0-9).")));
     if (!(isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form')) {
         array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
     }
     array_push($rules, array('verifyPassword', 'compare', 'compareAttribute' => 'password', 'message' => UserModule::t("Retype Password is incorrect.")));
     return $rules;
 }
开发者ID:rizkyramadhan,项目名称:yii-user,代码行数:12,代码来源:RegistrationForm.php

示例8: rules

 public function rules()
 {
     /*$rules = parent::rules();
     		if (isset($_POST['ajax']) && $_POST['ajax'] === 'registration-form') 
     			return $rules;
     		else
     			array_push($rules,
     				array('verification_code', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')),
     				array('password_repeat', 'compare', 'compareAttribute' => 'passowrd'),
     				array('password_repeat', 'required')
     			);
     		return $rules;*/
     return array(array('email, password, password_repeat', 'required'), array('username', 'length', 'max' => 50, 'min' => 6, 'message' => UserModule::t('Username must be between 6 and 50 characters in length.')), array('email', 'length', 'max' => 50, 'message' => UserModule::t('Email address cannot have more than 50 characters.')), array('email', 'email', 'message' => UserModule::t('Provided email address is not valid.')), array('password', 'length', 'max' => 255, 'min' => 8), array('username', 'lzUnique', 'message' => UserModule::t('This username is already registered.'), 'modelClass' => 'User'), array('email', 'lzUnique', 'message' => UserModule::t('This email address is already registered.'), 'modelClass' => 'User'), array('username', 'match', 'pattern' => "/^[A-Za-z0-9_]+\$/u", 'message' => 'Only Latin alphabetical characters and numerics are allowed.'), array('password_repeat', 'compare', 'compareAttribute' => 'password'), array('verification_code', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
 }
开发者ID:redlaw,项目名称:lintinzone,代码行数:14,代码来源:Registration.php

示例9: array

	<div class="row form-group">
	<div class="col-sm-4 col-xs-10 col-xs-offset-1 col-sm-offset-0">
	<?php 
    echo $form->labelEx($model, 'verifyPassword');
    ?>
	<?php 
    echo $form->passwordField($model, 'verifyPassword', array('class' => 'form-control input-sm'));
    ?>
	<?php 
    echo $form->error($model, 'verifyPassword', array(), false, true);
    ?>
	</div>
	</div>
	
	<!--<?php 
    if (UserModule::doCaptcha('registration')) {
        ?>
	<div class="row form-group">
	<div class="col-sm-4 col-xs-10 col-xs-offset-1 col-sm-offset-0">
		<?php 
        echo $form->labelEx($model, 'verifyCode');
        ?>
		<br>
		<?php 
        $this->widget('CCaptcha');
        ?>
		<?php 
        echo $form->textField($model, 'verifyCode', array('class' => 'form-control input-sm'));
        ?>
		<?php 
        echo $form->error($model, 'verifyCode', array(), false, true);
开发者ID:ankitbishtkec,项目名称:generic-ecommerce-website,代码行数:31,代码来源:registration.php

示例10: rules

 public function rules()
 {
     return array(array('username, password, verifyPassword, email', 'required'), array('username', 'length', 'max' => 20, 'min' => 3, 'message' => UserModule::t("Incorrect username (length between 3 and 20 characters).")), array('password', 'length', 'max' => 128, 'min' => 4, 'message' => UserModule::t("Incorrect password (minimal length 4 symbols).")), array('email', 'email'), array('username', 'unique', 'message' => UserModule::t("This user's name already exists.")), array('email', 'unique', 'message' => UserModule::t("This user's email adress already exists.")), array('password', 'compare', 'compareAttribute' => 'verifyPassword', 'message' => UserModule::t("Retype Password is incorrect.")), array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')), array('username', 'match', 'pattern' => '/^[A-Za-z0-9\\s,\']+$/u', 'message' => UserModule::t("Incorrect symbols (A-z0-9).")));
 }
开发者ID:Cynabal,项目名称:postimer,代码行数:4,代码来源:RegistrationForm.php

示例11: rules

 /**
  * Declares the validation rules.
  * The rules state that username and password are required,
  * and password needs to be authenticated.
  */
 public function rules()
 {
     return array(array('login_or_email', 'required'), array('login_or_email', 'match', 'pattern' => '/^[0-9a-zA-Z]+@(([0-9a-zA-Z]+)[.])+[a-z]{2,4}$|^[0-9a-zA-Z_\\-]+$/i', 'message' => UserModule::t("用户名或邮箱格式不正确")), array('login_or_email', 'checkexists'), array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('login')));
 }
开发者ID:zwq,项目名称:unpei,代码行数:9,代码来源:UserRecoveryForm.php

示例12: array

echo CHtml::activeLabelEx($model, '用户名:', array('class' => 'label'));
?>
			<?php 
echo CHtml::activeTextField($model, 'username', array('class' => 'width214 input'));
?>
			</div>
		<div class='form-row'>
			<?php 
echo CHtml::activeLabelEx($model, '密 码:', array('class' => 'label'));
?>
			<?php 
echo CHtml::activePasswordField($model, 'password', array('class' => 'width214 input'));
?>
		</div>
		<?php 
if (UserModule::doCaptcha('login')) {
    ?>
		<div class='form-row'>
			<?php 
    echo CHtml::activeLabelEx($model, '验证码:', array('class' => 'label'));
    ?>
			<?php 
    echo CHtml::activeTextField($model, 'verifyCode', array('class' => 'width98 input'));
    ?>
			<?php 
    $this->widget('CCaptcha', array('captchaAction' => '/user/login/captcha', 'showRefreshButton' => true, 'clickableImage' => false, 'buttonLabel' => '换一张', 'imageOptions' => array('align' => 'absmiddle')));
    ?>
		</div>
		<?php 
}
?>
开发者ID:zwq,项目名称:unpei,代码行数:31,代码来源:login.php


注:本文中的UserModule::doCaptcha方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。