isBound() 공개 메소드

Determine whether the connection is currently bound to LDAP with a username/password.
public isBound ( ) : boolean
리턴 boolean
예제 #1
0
 /**
  * Get the RootDSE LdapObject while accounting for the state of the connection.
  *
  * @return \LdapTools\Object\LdapObject
  * @throws LdapConnectionException
  */
 public function get()
 {
     $anonymous = !$this->connection->isBound();
     try {
         $rootDse = self::doLdapQuery($anonymous);
     } catch (\Exception $e) {
         throw new LdapConnectionException(sprintf('Unable to query the RootDSE. %s', $e->getMessage()));
     } finally {
         // Make sure to set things back to how they were...
         if ($anonymous && $this->connection->isBound()) {
             $this->connection->close();
         }
     }
     return $rootDse;
 }
예제 #2
0
 function let(LdapConnectionInterface $connection, EventDispatcherInterface $dispatcher)
 {
     $connection->execute(Argument::that(function ($operation) {
         return $operation->getFilter() == "(&(objectClass=*))" && $operation->getBaseDn() == "";
     }))->willReturn($this->entry);
     $connection->getConfig()->willReturn(new DomainConfiguration('example.local'));
     $connection->isBound()->willReturn(false);
     $connection->connect('', '', true)->willReturn(null);
     $this->beConstructedWith($connection, $dispatcher);
 }
 function let(LdapConnectionInterface $connection, EventDispatcherInterface $dispatcher, LdapLoggerInterface $logger)
 {
     $connection->getConfig()->willReturn(new DomainConfiguration('example.local'));
     $connection->getConnection()->willReturn(null);
     $connection->isBound()->willReturn(true);
     $connection->getServer()->willReturn('foo');
     $connection->getIdleTime()->willReturn(1);
     $this->setConnection($connection);
     $this->setEventDispatcher($dispatcher);
     $this->setLogger($logger);
 }