function checkUsersExistence($sessionKey, $users) { if (session_continue($sessionKey)) { try { $existingUsers = array(); $um = UserManager::instance(); $currentUser = $um->getCurrentUser(); foreach ($users as $userIdentifier) { $userObj = $um->getUserByIdentifier($userIdentifier); $userInfo = user_to_soap($userIdentifier, $userObj, $currentUser); if ($userInfo) { $existingUsers[] = $userInfo; } } return $existingUsers; } catch (Exception $e) { return new SoapFault('0', $e->getMessage(), 'checkUsersExistence'); } } else { return new SoapFault(invalid_session_fault, 'Invalid Session ', 'checkUsersExistence'); } }
/** * Get a generic user * * @param String $sessionKey The project admin session hash * @param Integer $groupId The Project id where the User Group is defined * * @return UserInfo */ public function getProjectGenericUser($sessionKey, $groupId) { if (!$this->isRequesterAdmin($sessionKey, $groupId)) { throw new SoapFault('3201', 'Permission denied: need to be project admin.'); } $user = $this->generic_user_factory->fetch($groupId); if (!$user) { throw new SoapFault('3106', "Generic User does not exist"); } return user_to_soap($user->getId(), $user, $this->userManager->getCurrentUser()); }