Index: branches/5.1.x/core/units/users/users_item.php =================================================================== diff -u -r12127 -r12657 --- branches/5.1.x/core/units/users/users_item.php (.../users_item.php) (revision 12127) +++ branches/5.1.x/core/units/users/users_item.php (.../users_item.php) (revision 12657) @@ -1,6 +1,6 @@ GetDBField('Status') ) - { - case 1: - if ($this->Application->ConfigValue('User_Password_Auto')) { - $this->Application->EmailEventAdmin('USER.VALIDATE', $this->GetID() ); - $this->Application->EmailEventUser('USER.VALIDATE', $this->GetID() ); - } - else { - $this->Application->EmailEventAdmin('USER.ADD', $this->GetID() ); - $this->Application->EmailEventUser('USER.ADD', $this->GetID() ); - } + switch ($this->GetDBField('Status')) { + case STATUS_ACTIVE: + $event_name = $this->Application->ConfigValue('User_Password_Auto') ? 'USER.VALIDATE' : 'USER.ADD'; + $this->Application->EmailEventAdmin($event_name); + $this->Application->EmailEventUser($event_name, $this->GetID()); break; - case 2: - $this->Application->EmailEventAdmin('USER.ADD.PENDING', $this->GetID() ); - $this->Application->EmailEventUser('USER.ADD.PENDING', $this->GetID() ); + case STATUS_PENDING: + $this->Application->EmailEventAdmin('USER.ADD.PENDING'); + $this->Application->EmailEventUser('USER.ADD.PENDING', $this->GetID()); break; } } @@ -136,6 +133,4 @@ $this->SetDBField('LastName', $last_name); } - - } -?> \ No newline at end of file + } \ No newline at end of file