本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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')));
}
示例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);
示例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).")));
}
示例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')));
}
示例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
}
?>