Lines Matching +full:list +full:- +full:users -(+path:inc +path:lang) -(+path:lib +path:plugins +path:lang) -(+path:lib +path:tpl +path:dokuwiki +path:lang)

12  * Copyright (c) 2006-2012 Scott Barnett, Richard Hyland
31 * @copyright (c) 2006-2012 Scott Barnett, Richard Hyland
32 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html LGPLv2.1
54 $this->adldap = $adldap;
66 return $this->adldap->authenticate($username, $password, $preventRebind);
87 if (array_key_exists("password",$attributes) && (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS())){
96 $add = $this->adldap->adldap_schema($attributes);
112 $add["userAccountControl"][0] = $this->accountControl($control_options);
119 $result = @ldap_add($this->adldap->getLdapConnection(), "CN=" . $add["cn"][0] . ", " . $container . "," . $this->adldap->getBaseDn(), $add);
173 $userinfo = $this->info($username, array("*"), $isGUID);
175 $result = $this->adldap->folder()->delete($dn);
186 * @param bool $recursive Recursive list of groups
193 if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
194 if (!$this->adldap->getLdapBind()) { return false; }
197 $info = @$this->info($username, array("memberof", "primarygroupid"), $isGUID);
198 $groups = $this->adldap->utilities()->niceNames($info[0]["memberof"]); // Presuming the entry returned is our guy (unique usernames)
202 $extraGroups = $this->adldap->group()->recursiveGroups($groupName);
211 * Find information about the users. Returned in a raw array format from AD
221 if (!$this->adldap->getLdapBind()) { return false; }
224 $username = $this->adldap->utilities()->strGuidToHex($username);
240 $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
241 $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
247 if ($this->adldap->getRealPrimaryGroup() && isset($entries[0]["primarygroupid"][0]) && isset($entries[0]["objectsid"][0])){
248 //$entries[0]["memberof"][]=$this->group_cn($entries[0]["primarygroupid"][0]);
249 $entries[0]["memberof"][] = $this->adldap->group()->getPrimaryGroup($entries[0]["primarygroupid"][0], $entries[0]["objectsid"][0]);
251 $entries[0]["memberof"][] = "CN=Domain Users,CN=Users," . $this->adldap->getBaseDn();
266 * Find information about the users. Returned in a raw array format from AD
276 if (!$this->adldap->getLdapBind()) { return false; }
278 $info = $this->info($username, $fields, $isGUID);
281 $collection = new adLDAPUserCollection($info, $this->adldap);
300 if (!$this->adldap->getLdapBind()) { return false; }
301 if ($recursive === NULL) { $recursive = $this->adldap->getRecursiveGroups(); } // Use the default option if they haven't set it
303 // Get a list of the groups
304 $groups = $this->groups($username, $recursive, $isGUID);
306 // Return true if the specified group is in the group list
325 if (!$this->adldap->getLdapBind()) { return false; }
328 $userInfo = $this->info($username, array("pwdlastset", "useraccountcontrol"), $isGUID);
342 // - User's own pwdLastSet attribute: stores the last time the password was changed
343 // - Domain's maxPwdAge attribute: how long passwords last in the domain
347 $sr = ldap_read($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), 'objectclass=*', array('maxPwdAge'));
351 $info = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
355 // See MSDN: http://msdn.microsoft.com/en-us/library/ms974598.aspx
381 $status['expiryformat'] = date('Y-m-d H:i:s', bcsub(bcdiv($pwdExpire, '10000000'), '11644473600'));
397 if (array_key_exists("password", $attributes) && !$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
402 $userDn = $this->dn($username, $isGUID);
408 $mod = $this->adldap->adldap_schema($attributes);
423 $mod["userAccountControl"][0] = $this->accountControl($controlOptions);
427 $result = @ldap_modify($this->adldap->getLdapConnection(), $userDn, $mod);
446 $result = $this->modify($username, $attributes, $isGUID);
463 $result = $this->modify($username, $attributes, $isGUID);
470 * Set the password of a user - This must be performed over SSL
481 if (!$this->adldap->getLdapBind()) { return false; }
482 if (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
486 $userDn = $this->dn($username, $isGUID);
492 $add["unicodePwd"][0] = $this->encodePassword($password);
494 $result = @ldap_mod_replace($this->adldap->getLdapConnection(), $userDn, $add);
496 $err = ldap_errno($this->adldap->getLdapConnection());
536 $user = $this->info($username, array("cn"), $isGUID);
545 * Return a list of all users in AD
554 if (!$this->adldap->getLdapBind()) { return false; }
559 $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
560 $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
586 if (!$this->adldap->getLdapBind()){ return false; }
591 $sr = @ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
592 if (ldap_count_entries($this->adldap->getLdapConnection(), $sr) > 0) {
593 $entry = @ldap_first_entry($this->adldap->getLdapConnection(), $sr);
594 $guid = @ldap_get_values_len($this->adldap->getLdapConnection(), $entry, 'objectGUID');
595 $strGUID = $this->adldap->utilities()->binaryToText($guid[0]);
602 * Return a list of all users in AD that have a specific value in a field
611 if (!$this->adldap->getLdapBind()){ return false; }
620 $sr = ldap_search($this->adldap->getLdapConnection(), $this->adldap->getBaseDn(), $filter, $fields);
621 $entries = ldap_get_entries($this->adldap->getLdapConnection(), $sr);
651 if (!$this->adldap->getLdapBind()) { return false; }
656 $userInfo = $this->info($username, array("*"));
661 $newBaseDn = strtolower($newContainer) . "," . $this->adldap->getBaseDn();
662 $result = @ldap_rename($this->adldap->getLdapConnection(), $dn, $newRDn, $newBaseDn, true);
676 if (!$this->adldap->getLdapBind()) { return false; }
678 $userInfo = $this->info($username, array("lastLogonTimestamp"));