Index: branches/5.2.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r14973 -r14989 --- branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 14973) +++ branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 14989) @@ -1,6 +1,6 @@ Array('self' => 'view'), // because setting to logged in user only @@ -57,7 +61,7 @@ * @param kEvent $event * @access protected */ - function OnItemBuild(&$event) + protected function OnItemBuild(kEvent &$event) { parent::OnItemBuild($event); @@ -77,38 +81,40 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(&$event) + protected function SetCustomQuery(kEvent &$event) { + parent::SetCustomQuery($event); + $object =& $event->getObject(); /* @var $object kDBList */ - if ($event->Special == 'regular') { + if ( $event->Special == 'regular' ) { $object->addFilter('primary_filter', '%1$s.UserType = ' . UserType::USER); } - if ($event->Special == 'admins') { + if ( $event->Special == 'admins' ) { $object->addFilter('primary_filter', '%1$s.UserType = ' . UserType::ADMIN); } - if (!$this->Application->isAdminUser) { - $object->addFilter('status_filter', '%1$s.Status = '.STATUS_ACTIVE); + if ( !$this->Application->isAdminUser ) { + $object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE); } - if ($event->Special == 'online') { + if ( $event->Special == 'online' ) { $object->addFilter('online_users_filter', 's.PortalUserId IS NOT NULL'); } - if ($event->Special == 'group') { + if ( $event->Special == 'group' ) { $group_id = $this->Application->GetVar('g_id'); - if ($group_id !== false) { + if ( $group_id !== false ) { // show only users, that user doesn't belong to current group $sql = 'SELECT PortalUserId - FROM ' . $this->Application->GetTempName(TABLE_PREFIX.'UserGroup', 'prefix:g') . ' + FROM ' . $this->Application->GetTempName(TABLE_PREFIX . 'UserGroup', 'prefix:g') . ' WHERE GroupId = ' . (int)$group_id; $user_ids = $this->Conn->GetCol($sql); - if ($user_ids) { + if ( $user_ids ) { $object->addFilter('already_member_filter', '%1$s.PortalUserId NOT IN (' . implode(',', $user_ids) . ')'); } } @@ -122,7 +128,7 @@ * @return bool * @access public */ - public function CheckPermission(&$event) + public function CheckPermission(kEvent &$event) { if ( $event->Name == 'OnLogin' || $event->Name == 'OnLoginAjax' || $event->Name == 'OnLogout' ) { // permission is checked in OnLogin event directly @@ -1090,8 +1096,9 @@ * * @param kEvent $event * @return int + * @access public */ - function getPassedID(&$event) + public function getPassedID(kEvent &$event) { switch ($event->Special) { case 'ord': @@ -1104,7 +1111,7 @@ case 'profile': $id = $this->Application->GetVar('user_id'); - if (!$id) { + if ( !$id ) { // if none user_id given use current user id $id = $this->Application->RecallVar('user_id'); } @@ -1116,7 +1123,7 @@ $user_helper =& $this->Application->recallObject('UserHelper'); /* @var $user_helper UserHelper */ - $id = $user_helper->validateUserCode( $this->Application->GetVar('user_key'), 'forgot_password' ); + $id = $user_helper->validateUserCode($this->Application->GetVar('user_key'), 'forgot_password'); if ( is_numeric($id) ) { return $id; @@ -1261,8 +1268,9 @@ * * @param kEvent $event * @return bool + * @access protected */ - function checkItemStatus(&$event) + protected function checkItemStatus(kEvent &$event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1786,7 +1794,7 @@ * @return void * @access protected */ - protected function LoadItem(&$event) + protected function LoadItem(kEvent &$event) { $id = $this->getPassedID($event); @@ -1797,7 +1805,7 @@ /* @var $object kDBItem */ $object->Clear($id); - return ; + return; } parent::LoadItem($event);