Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
RegistrationForm Class Reference
Inheritance diagram for RegistrationForm:
User

Public Member Functions

 rules ()
- Public Member Functions inherited from User
 tableName ()
 relations ()
 isExists ()
 attributeLabels ()
 scopes ()
 defaultScope ()
 search ()

Public Attributes

 $verifyPassword
 $verifyCode
- Public Attributes inherited from User
const STATUS_NOACTIVE = 0
const STATUS_ACTIVE = 1
const STATUS_BANED = -1
 $justSaved = false
 $firstname
 $lastname

Additional Inherited Members

- Static Public Member Functions inherited from User
static model ($className=__CLASS__)
static create ($account, $service)
static itemAlias ($type, $code=NULL)
- Protected Attributes inherited from User
 $isExists = null

Detailed Description

RegistrationForm class. RegistrationForm is the data structure for keeping user registration form data. It is used by the 'registration' action of 'UserController'.

Definition at line 7 of file RegistrationForm.php.

Member Function Documentation

RegistrationForm::rules ( )

set verivication rules

Returns
array

Reimplemented from User.

Definition at line 17 of file RegistrationForm.php.

References UserModule\doCaptcha(), and UserModule\t().

{
$rules = array(
array('username, email', 'common.components.NotContainsTagsValidator'),
array('password, verifyPassword, email', 'required'),
array('username', 'length', 'max' => 20, 'min' => Yii::app()->getModule('user')->usernameMin, 'message' => UserModule::t("Incorrect username (length between 3 and 20 characters).")),
array('password', 'length', 'max' => 128, 'min' => Yii::app()->getModule('user')->passwordMin, '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.")),
array('username', 'match', 'pattern' => '/^[A-Za-z0-9_]+$/u', 'message' => UserModule::t("Incorrect symbols (A-z0-9).")),
);
if (@$_POST['ajax'] !== 'registration-form') {
array_push($rules, array('verifyCode', 'captcha', 'allowEmpty' => !UserModule::doCaptcha('registration')));
}
if (Yii::app()->getModule('user')->usernameUnique && Yii::app()->getModule('user')->usernameRequired) {
array_unshift($rules, array('username', 'unique', 'message' => UserModule::t("This user's name already exists.")));
}
if (Yii::app()->getModule('user')->usernameRequired) {
array_unshift($rules, array('username', 'required'));
}
return $rules;
}

The documentation for this class was generated from the following file: