コード例 #1
0
 /**
  * Find a group from a search query
  *
  * @access public
  * @param  string $input
  * @return LdapGroupProvider[]
  */
 public function find($input)
 {
     try {
         $ldap = LdapClient::connect();
         return LdapGroup::getGroups($ldap, $this->getLdapGroupPattern($input));
     } catch (LdapException $e) {
         $this->logger->error($e->getMessage());
         return array();
     }
 }
コード例 #2
0
ファイル: User.php プロジェクト: rammstein4o/kanboard
 /**
  * Get user groupIds (DN)
  *
  * 1) If configured, use memberUid and posixGroup
  * 2) Otherwise, use memberOf
  *
  * @access protected
  * @param  Entry   $entry
  * @param  string  $username
  * @return string[]
  */
 protected function getGroups(Entry $entry, $username)
 {
     $groupIds = array();
     if (!empty($username) && $this->group !== null && $this->hasGroupUserFilter()) {
         $groups = $this->group->find(sprintf($this->getGroupUserFilter(), $username));
         foreach ($groups as $group) {
             $groupIds[] = $group->getExternalId();
         }
     } else {
         $groupIds = $entry->getAll($this->getAttributeGroup());
     }
     return $groupIds;
 }
コード例 #3
0
ファイル: LdapGroupTest.php プロジェクト: Trapulo/kanboard
 public function testGetBaseDnNotConfigured()
 {
     $this->setExpectedException('\\LogicException');
     $group = new Group($this->query);
     $group->getBasDn();
 }