Index: branches/5.0.x/core/units/users/users_item.php =================================================================== diff -u -r12117 -r12159 --- branches/5.0.x/core/units/users/users_item.php (.../users_item.php) (revision 12117) +++ branches/5.0.x/core/units/users/users_item.php (.../users_item.php) (revision 12159) @@ -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->GetID()); + $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->GetID()); + $this->Application->EmailEventUser('USER.ADD.PENDING', $this->GetID()); break; } }