Example #1
0
 /**
  * Build groups list
  *
  * @access protected
  * @return array
  */
 protected function build()
 {
     $groups = array();
     foreach ($this->query->getEntries()->getAll() as $entry) {
         $groups[] = new LdapGroupProvider($entry->getDn(), $entry->getFirstValue($this->getAttributeName()));
     }
     return $groups;
 }
Example #2
0
 /**
  * Build user profile
  *
  * @access protected
  * @return LdapUserProvider
  */
 protected function build()
 {
     $entry = $this->query->getEntries()->getFirstEntry();
     $role = Role::APP_USER;
     if ($entry->hasValue($this->getAttributeGroup(), $this->getGroupAdminDn())) {
         $role = Role::APP_ADMIN;
     } elseif ($entry->hasValue($this->getAttributeGroup(), $this->getGroupManagerDn())) {
         $role = Role::APP_MANAGER;
     }
     return new LdapUserProvider($entry->getDn(), $entry->getFirstValue($this->getAttributeUsername()), $entry->getFirstValue($this->getAttributeName()), $entry->getFirstValue($this->getAttributeEmail()), $role, $entry->getAll($this->getAttributeGroup()));
 }
Example #3
0
 /**
  * Build user profile
  *
  * @access protected
  * @return LdapUserProvider
  */
 protected function build()
 {
     $entry = $this->query->getEntries()->getFirstEntry();
     $username = $entry->getFirstValue($this->getAttributeUsername());
     $groupIds = $this->getGroups($entry, $username);
     return new LdapUserProvider($entry->getDn(), $username, $entry->getFirstValue($this->getAttributeName()), $entry->getFirstValue($this->getAttributeEmail()), $this->getRole($groupIds), $groupIds, $entry->getFirstValue($this->getAttributePhoto()), $entry->getFirstValue($this->getAttributeLanguage()));
 }