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


PHP adLDAP::adldap_schema方法代碼示例

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


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

示例1: modify

 /**
  * Modify a user
  * 
  * @param string $username The username to query
  * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
  * @param bool $isGUID Is the username passed a GUID or a samAccountName
  * @return bool
  */
 public function modify($username, $attributes, $isGUID = false)
 {
     if ($username === NULL) {
         return "Missing compulsory field [username]";
     }
     if (array_key_exists("password", $attributes) && !$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
         throw new adLDAPException('SSL/TLS must be configured on your webserver and enabled in the class to set passwords.');
     }
     // Find the dn of the user
     $userDn = $this->dn($username, $isGUID);
     if ($userDn === false) {
         return false;
     }
     // Translate the update to the LDAP schema
     $mod = $this->adldap->adldap_schema($attributes);
     // Check to see if this is an enabled status update
     if (!$mod && !array_key_exists("enabled", $attributes)) {
         return false;
     }
     // Set the account control attribute (only if specified)
     if (array_key_exists("enabled", $attributes)) {
         if ($attributes["enabled"]) {
             $controlOptions = array("NORMAL_ACCOUNT");
         } else {
             $controlOptions = array("NORMAL_ACCOUNT", "ACCOUNTDISABLE");
         }
         $mod["userAccountControl"][0] = $this->accountControl($controlOptions);
     }
     // Do the update
     $result = @ldap_modify($this->adldap->getLdapConnection(), $userDn, $mod);
     if ($result == false) {
         return false;
     }
     return true;
 }
開發者ID:wernerflamme,項目名稱:dokuwiki,代碼行數:43,代碼來源:adLDAPUsers.php

示例2: contactMailEnable

 /**
  * Mail enable a contact
  * Allows email to be sent to them through Exchange
  * 
  * @param string $distinguishedName The contact to mail enable
  * @param string $emailAddress The email address to allow emails to be sent through
  * @param string $mailNickname The mailnickname for the contact in Exchange.  If NULL this will be set to the display name
  * @return bool
  */
 public function contactMailEnable($distinguishedName, $emailAddress, $mailNickname = NULL)
 {
     if ($distinguishedName === NULL) {
         return "Missing compulsory field [distinguishedName]";
     }
     if ($emailAddress === NULL) {
         return "Missing compulsory field [emailAddress]";
     }
     if ($mailNickname !== NULL) {
         // Find the dn of the user
         $user = $this->adldap->contact()->info($distinguishedName, array("cn", "displayname"));
         if ($user[0]["displayname"] === NULL) {
             return false;
         }
         $mailNickname = $user[0]['displayname'][0];
     }
     $attributes = array("email" => $emailAddress, "contact_email" => "SMTP:" . $emailAddress, "exchange_proxyaddress" => "SMTP:" . $emailAddress, "exchange_mailnickname" => $mailNickname);
     // Translate the update to the LDAP schema
     $mod = $this->adldap->adldap_schema($attributes);
     // Check to see if this is an enabled status update
     if (!$mod) {
         return false;
     }
     // Do the update
     $result = ldap_modify($this->adldap->getLdapConnection(), $distinguishedName, $mod);
     if ($result == false) {
         return false;
     }
     return true;
 }
開發者ID:kidaa,項目名稱:time-slot,代碼行數:39,代碼來源:adLDAPExchange.php

示例3: modify

 /**
  * Modify a contact
  * 
  * @param string $distinguishedName The contact to query
  * @param array $attributes The attributes to modify.  Note if you set the enabled attribute you must not specify any other attributes
  * @return bool
  */
 public function modify($distinguishedName, $attributes)
 {
     if ($distinguishedName === NULL) {
         return "Missing compulsory field [distinguishedname]";
     }
     // Translate the update to the LDAP schema
     $mod = $this->adldap->adldap_schema($attributes);
     // Check to see if this is an enabled status update
     if (!$mod) {
         return false;
     }
     // Do the update
     $result = ldap_modify($this->adldap->getLdapConnection(), $distinguishedName, $mod);
     if ($result == false) {
         return false;
     }
     return true;
 }
開發者ID:kinhvan017,項目名稱:phpipam,代碼行數:25,代碼來源:adLDAPContacts.php


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