Example #1
0
 /**
  * Get user profile
  *
  * @access public
  * @param  resource  $ldap
  * @param  string    $baseDn
  * @param  string    $query
  * @return array
  */
 public function getProfile($ldap, $baseDn, $query)
 {
     $this->query->execute($ldap, $baseDn, $query, $this->getAttributes());
     $profile = array();
     if ($this->query->hasResult()) {
         $profile = $this->prepareProfile();
     }
     return $profile;
 }
Example #2
0
 public function testExecuteQueryFailed()
 {
     self::$functions->expects($this->once())->method('ldap_search')->with($this->equalTo('my_ldap_resource'), $this->equalTo('ou=People,dc=kanboard,dc=local'), $this->equalTo('uid=my_user'), $this->equalTo(array('displayname')))->will($this->returnValue(false));
     $query = new Query();
     $query->execute('my_ldap_resource', 'ou=People,dc=kanboard,dc=local', 'uid=my_user', array('displayname'));
     $this->assertFalse($query->hasResult());
 }