Lines Matching defs:attributes
74 * @param array $attributes The attributes to set to the user account
77 public function create($attributes)
80 if (!array_key_exists("username", $attributes)){ return "Missing compulsory field [username]"; }
81 if (!array_key_exists("firstname", $attributes)){ return "Missing compulsory field [firstname]"; }
82 if (!array_key_exists("surname", $attributes)){ return "Missing compulsory field [surname]"; }
83 if (!array_key_exists("email", $attributes)){ return "Missing compulsory field [email]"; }
84 if (!array_key_exists("container", $attributes)){ return "Missing compulsory field [container]"; }
85 if (!is_array($attributes["container"])){ return "Container attribute must be an array."; }
87 if (array_key_exists("password",$attributes) && (!$this->adldap->getUseSSL() && !$this->adldap->getUseTLS())){
91 if (!array_key_exists("display_name", $attributes)) {
92 $attributes["display_name"] = $attributes["firstname"] . " " . $attributes["surname"];
96 $add = $this->adldap->adldap_schema($attributes);
99 $add["cn"][0] = $attributes["display_name"];
100 $add["samaccountname"][0] = $attributes["username"];
105 //$add["name"][0]=$attributes["firstname"]." ".$attributes["surname"];
109 if (!$attributes["enabled"]) {
115 $attributes["container"] = array_reverse($attributes["container"]);
116 $container = "OU=" . implode(", OU=",$attributes["container"]);
390 * @param array $attributes The attributes to modify. Note if you set the enabled attribute you must not specify any other attributes
394 public function modify($username, $attributes, $isGUID = false)
397 if (array_key_exists("password", $attributes) && !$this->adldap->getUseSSL() && !$this->adldap->getUseTLS()) {
408 $mod = $this->adldap->adldap_schema($attributes);
411 if (!$mod && !array_key_exists("enabled", $attributes)){
416 if (array_key_exists("enabled", $attributes)){
417 if ($attributes["enabled"]){
445 $attributes = array("enabled" => 0);
446 $result = $this->modify($username, $attributes, $isGUID);
462 $attributes = array("enabled" => 1);
463 $result = $this->modify($username, $attributes, $isGUID);