Index: branches/5.1.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r13559 -r13581 --- branches/5.1.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 13559) +++ branches/5.1.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 13581) @@ -1,6 +1,6 @@ Application->RecallVar('user_id'); $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); - if ($event->Name == 'OnCreate' && $user_id == -2) { + if ($event->Name == 'OnCreate' && $user_id == USER_GUEST) { // "Guest" can create new users return true; } @@ -226,7 +226,7 @@ $object->SetError('ValidateLogin', 'no_permission', 'lu_no_permissions'); } else { - $object->SetID(-2); + $object->SetID(USER_GUEST); $object->SetError('ValidateLogin', 'invalid_password', 'la_invalid_password'); } @@ -1122,7 +1122,7 @@ if (!$items_info) return ; list ($id, $field_values) = each($items_info); $user_id = $this->Application->RecallVar('user_id'); - if ($id == $user_id && ($user_id > 0 || $user_id == -1)) { + if ($id == $user_id && ($user_id > 0 || $user_id == USER_ROOT)) { $user_dummy =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); /* @var $user_dummy kDBItem */ @@ -1135,7 +1135,7 @@ } } - if ($user_id == -1) { + if ($user_id == USER_ROOT) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object UsersItem */ @@ -1251,7 +1251,7 @@ return true; } - $virtual_users = Array (-1, -2); // root, Guest + $virtual_users = Array (USER_ROOT, USER_GUEST); return ($object->GetDBField('Status') == STATUS_ACTIVE) || in_array($object->GetID(), $virtual_users); }