15 array(
'username, password, verifyPassword, email',
'required'),
16 array(
'username',
'length',
'max' => 20,
'min' => 3,
'message' =>
UserModule::t(
"Incorrect username (length between 3 and 20 characters).")),
17 array(
'password',
'length',
'max' => 128,
'min' => 4,
'message' =>
UserModule::t(
"Incorrect password (minimal length 4 symbols).")),
18 array(
'email',
'email'),
19 array(
'username',
'unique',
'message' =>
UserModule::t(
"This user's name already exists.")),
20 array(
'email',
'unique',
'message' =>
UserModule::t(
"This user's email address already exists.")),
22 array(
'username',
'match',
'pattern' =>
'/^[A-Za-z0-9_]+$/u',
'message' =>
UserModule::t(
"Incorrect symbols (A-z0-9).")),
24 if (!(isset($_POST[
'ajax']) && $_POST[
'ajax'] ===
'registration-form')) {
25 array_push($rules, array(
'verifyCode',
'captcha',
'allowEmpty' => !
UserModule::doCaptcha(
'registration')));
28 array_push($rules, array(
'verifyPassword',
'compare',
'compareAttribute' =>
'password',
'message' =>
UserModule::t(
"Retype Password is incorrect.")));