public function updateMyProperty($prop, $value) { $ldapObj = new Lucid_LDAP($this->configFile); $ldapObj->bind($this->username, $this->password); $myDn = $this->getMyDN($ldapObj); if ($prop === "SSH") { $attr = $ldapObj->SSH; } if ($prop === "VPN") { $attr = $ldapObj->VPN; } if (!isset($attr)) { throw new Exception("Unknown Property {$prop}"); } $update_status = $ldapObj->updateAttribute($myDn, $attr, $value); $ldapObj->destroy(); return $update_status; }
public function updateAttr($dn, $attrib, $value) { $ldapObj = new Lucid_LDAP($this->configFile); $ldapObj->bind($this->username, $this->password); $status = $ldapObj->updateAttribute($dn, $attrib, $value); $ldapObj->destroy(); if ($status === true) { $this->loggerObj->log("ADMIN::info::{$this->username} has updated {$attrib} for {$dn} successfully"); } else { $this->loggerObj->log("ADMIN::error::{$this->username}'s Attempt to update {$attrib} for {$dn} has failed. Reason: {$status}"); } return $status; }