當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Ldap_Node::fromArray方法代碼示例

本文整理匯總了PHP中Zend_Ldap_Node::fromArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Ldap_Node::fromArray方法的具體用法?PHP Zend_Ldap_Node::fromArray怎麽用?PHP Zend_Ldap_Node::fromArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Ldap_Node的用法示例。


在下文中一共展示了Zend_Ldap_Node::fromArray方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($source = null, $entry = null)
 {
     if ($entry && (is_object($entry) || is_array($entry))) {
         if (is_array($entry)) {
             $entry = Zend_Ldap_Node::fromArray($entry);
         }
         $this->node = $entry;
         $attrs = $entry->getAttributes(false);
         foreach ($attrs as $attr => $value) {
             $this->remoteProperties[$attr] = $value;
         }
         if (isset($this->uid)) {
             $this->Title = is_array($this->uid) ? implode($this->uid) : $this->uid;
         } else {
             if (isset($this->cn)) {
                 $this->Title = is_array($this->cn) ? implode($this->cn) : $this->cn;
             } else {
                 if (isset($this->ou)) {
                     $this->Title = is_array($this->ou) ? implode($this->ou) : $this->ou;
                 } else {
                     $this->Title = $entry->getCurrentDN();
                 }
             }
         }
         $this->DN = $entry->getCurrentDN();
         parent::__construct($source, $entry->getCurrentDn());
     } else {
         parent::__construct($source, $entry);
     }
 }
開發者ID:nyeholt,項目名稱:silverstripe-ldap-connector,代碼行數:30,代碼來源:LdapContentItem.php

示例2: _createEntry

 /**
  * Creates the data structure for the given entry data
  *
  * @param  array $data
  * @return Zend_Ldap_Node
  */
 protected function _createEntry(array $data)
 {
     /**
      * @see Zend_Ldap_Node
      */
     $node = Zend_Ldap_Node::fromArray($data, true);
     $node->attachLdap($this->_iterator->getLdap());
     return $node;
 }
開發者ID:kobmaki,項目名稱:icingaweb2,代碼行數:15,代碼來源:Collection.php

示例3: _createEntry

 /**
  * Creates the data structure for the given entry data
  *
  * @param  array $data
  * @return Zend_Ldap_Node
  */
 protected function _createEntry(array $data)
 {
     /**
      * @see Zend_Ldap_Node
      */
     require_once PHP_LIBRARY_PATH . 'Zend/Ldap/Node.php';
     $node = Zend_Ldap_Node::fromArray($data, true);
     $node->attachLdap($this->_iterator->getLdap());
     return $node;
 }
開發者ID:netixx,項目名稱:Stock,代碼行數:16,代碼來源:Collection.php

示例4: testExistsDn

 public function testExistsDn()
 {
     $data = array('dn' => $this->_createDn('ou=name,'), 'ou' => array('name'), 'l' => array('a', 'b', 'c'), 'objectClass' => array('organizationalUnit', 'top'));
     $node1 = Zend_Ldap_Node::fromArray($data);
     $node1->attachLdap($this->_getLdap());
     $this->assertFalse($node1->exists());
     $dn = $this->_createDn('ou=Test1,');
     $node2 = Zend_Ldap_Node::fromLdap($dn, $this->_getLdap());
     $this->assertTrue($node2->exists());
 }
開發者ID:travisj,項目名稱:zf,代碼行數:10,代碼來源:OnlineTest.php

示例5: _createTestNode

 /**
  * @return Zend_Ldap_Node
  */
 protected function _createTestNode()
 {
     return Zend_Ldap_Node::fromArray($this->_createTestArrayData(), true);
 }
開發者ID:crodriguezn,項目名稱:crossfit-milagro,代碼行數:7,代碼來源:TestCase.php

示例6: testDnObjectCloning

 public function testDnObjectCloning()
 {
     $node1 = $this->_createTestNode();
     $dn1 = Zend_Ldap_Dn::fromString('cn=name2,dc=example,dc=org');
     $node1->setDn($dn1);
     $dn1->prepend(array('cn' => 'name'));
     $this->assertNotEquals($dn1->toString(), $node1->getDn()->toString());
     $dn2 = Zend_Ldap_Dn::fromString('cn=name2,dc=example,dc=org');
     $node2 = Zend_Ldap_Node::create($dn2);
     $dn2->prepend(array('cn' => 'name'));
     $this->assertNotEquals($dn2->toString(), $node2->getDn()->toString());
     $dn3 = Zend_Ldap_Dn::fromString('cn=name2,dc=example,dc=org');
     $node3 = Zend_Ldap_Node::fromArray(array('dn' => $dn3, 'ou' => 'Test'), false);
     $dn3->prepend(array('cn' => 'name'));
     $this->assertNotEquals($dn3->toString(), $node3->getDn()->toString());
 }
開發者ID:netvlies,項目名稱:zf,代碼行數:16,代碼來源:OfflineTest.php

示例7: refreshUsers

 /**
  * Reads out all users from configured ldap backend and creates or update
  * existing users.
  * 
  * Also disabling deleted ldap users in humhub
  */
 public function refreshUsers()
 {
     $ldapUserIds = array();
     try {
         $items = $this->ldap->search(HSetting::Get('userFilter', 'authentication_ldap'), HSetting::Get('baseDn', 'authentication_ldap'), Zend_Ldap::SEARCH_SCOPE_SUB);
         foreach ($items as $item) {
             $node = Zend_Ldap_Node::fromArray($item);
             $user = $this->handleLdapUser($node);
             if ($user != null) {
                 $ldapUserIds[] = $user->id;
             }
         }
         foreach (User::model()->findAllByAttributes(array('auth_mode' => User::AUTH_MODE_LDAP), 'status!=' . User::STATUS_DISABLED) as $user) {
             if (!in_array($user->id, $ldapUserIds)) {
                 // User not longer available in ldap
                 $user->status = User::STATUS_DISABLED;
                 $user->save();
                 Yii::log('Disabled user ' . $user->username . ' (' . $user->id . ') - Not found in LDAP!', CLogger::LEVEL_ERROR, 'authentication_ldap');
             }
         }
     } catch (Exception $ex) {
         Yii::log($ex->getMessage(), CLogger::LEVEL_ERROR, 'authentication_ldap');
     }
 }
開發者ID:luizreginaldo,項目名稱:humhub,代碼行數:30,代碼來源:HLdap.php

示例8: testRdnAttributesHandleMultiValuedAttribute3

 /**
  * ZF-11611
  */
 public function testRdnAttributesHandleMultiValuedAttribute3()
 {
     $data = array('dn' => 'cn=funkygroup,ou=Groupes,dc=domain,dc=local', 'objectClass' => array('groupOfNames', 'top'), 'cn' => array(0 => 'The Funkygroup'), 'member' => 'uid=john-doe,ou=Users,dc=domain,dc=local');
     $node = Zend_Ldap_Node::fromArray($data, true);
     $cn = $node->getAttribute('cn');
     $this->assertEquals(array(0 => 'The Funkygroup', 1 => 'funkygroup'), $cn);
 }
開發者ID:omusico,項目名稱:logica,代碼行數:10,代碼來源:OfflineTest.php


注:本文中的Zend_Ldap_Node::fromArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。