예제 #1
0
 /**
  * Delete a user account
  * 
  * @param string $username The username to delete (please be careful here!)
  * @param bool $isGUID Is the username a GUID or a samAccountName
  * @return array
  */
 public function delete($username, $isGUID = false)
 {
     $userinfo = $this->info($username, array("*"), $isGUID);
     $dn = $userinfo[0]['distinguishedname'][0];
     $result = $this->adldap->folder()->delete($dn);
     if ($result != true) {
         return false;
     }
     return true;
 }
예제 #2
0
 /**
  * Delete a group account 
  * 
  * @param string $group The group to delete (please be careful here!) 
  * 
  * @return array 
  */
 public function delete($group)
 {
     if (!$this->adldap->getLdapBind()) {
         return false;
     }
     if ($group === null) {
         return "Missing compulsory field [group]";
     }
     $groupInfo = $this->info($group, array("*"));
     $dn = $groupInfo[0]['distinguishedname'][0];
     $result = $this->adldap->folder()->delete($dn);
     if ($result !== true) {
         return false;
     }
     return true;
 }