thyseus / yii-user-management

a user management module collection for the yii framework
186 stars 122 forks source link

YumUser.php #127

Open disvroian opened 11 years ago

disvroian commented 11 years ago

In the fonction public function rules() {

just after the statment if of $usernameRequirements there is $rules[] = array('username', 'unique', 'message' => Yum::t("This user's name already exists.")); $rules[] = array( 'username', 'match', 'pattern' => $usernameRequirements['match'], 'message' => Yum::t($usernameRequirements['dontMatchMessage'] ) ) ; This should be inside the statment and there is 2 times the condition of username match.

Also you should ask emailRequirements in case people use email to login add in UserModule.php public $emailRequirements= false ; //should be false by default

add in YumUser.php the following statment $emailRequirements = Yum::module()->emailRequirements; if($emailRequirements){ $rules[] = array( 'email', 'match', 'pattern' => $emailRequirements['match'], 'message' => Yum::t($emailRequirements['dontMatchMessage'] ) ) ; }

And change the taf <? by <?php