Пример #1
0
 /**
  * Get the amount of currently connected users.
  * This not quite the same as the other KPI's since it seems
  * to be impossible to get deprovisioned users.
  *
  * @return Integer
  */
 public function getUsers()
 {
     $config = Zend_Registry::get('config');
     $ldapConfig = $config->engineblock->ldap;
     $userDirectory = new EngineBlock_UserDirectory($ldapConfig);
     return $userDirectory->countUsersByIdentifier('*');
 }
 protected function _getUserUuid($collabPersonId)
 {
     $userDirectory = new EngineBlock_UserDirectory(EngineBlock_ApplicationSingleton::getInstance()->getConfiguration()->ldap);
     $users = $userDirectory->findUsersByIdentifier($collabPersonId);
     if (count($users) > 1) {
         throw new EngineBlock_Exception('Multiple users found for collabPersonId: ' . $collabPersonId);
     }
     if (count($users) < 1) {
         throw new EngineBlock_Exception('No users found for collabPersonId: ' . $collabPersonId);
     }
     return $users[0]['collabpersonuuid'];
 }
 /**
  * Delete the user from the SURFconext LDAP.
  *
  * @return void
  */
 protected function _deleteLdapUser()
 {
     $ldapConfig = EngineBlock_ApplicationSingleton::getInstance()->getConfiguration()->ldap;
     $userDirectory = new EngineBlock_UserDirectory($ldapConfig);
     $userDirectory->deleteUser($this->getUid());
 }