return false;
}
+ /**
+ * add a user to ldap server
+ *
+ * @param array $user
+ * @return boolean
+ */
+ public function addUser (Array $user) {
+ /*
+ Eampel:
+ $user = array();
+ $user['dn'] = 'uid=testuser,ou=Users,dc=ldap,dc=test,dc=server,dc=com';
+ $user['objectClass'] = array('inetOrgPerson', 'organizationalPerson', 'posixAccount');
+ $user['cn'] = 'Test User';
+ $user['gidNumber'] = '5001';
+ $user['homeDirectory'] = '/home/testuser';
+ $user['sn'] = 'User';
+ $user['uid'] = 'testuser';
+ $user['uidNumber'] = '5001';
+ $user['loginShell'] = '/bin/bash';
+ $user['mail'] = 'test@user.com';
+ $user['userPassword'] = '';
+ */
+ if (is_array($user) && !empty($user)) {
+ if (ldap_add($this->ldap, $this->dn, $user) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * delete ldap user
+ *
+ * @param string $user
+ * @return boolean
+ */
+ public function delUser ($user) {
+ if (ldap_delete ($this->ldap, $user.",".$this->dn)) {
+ return true;
+ }
+
+ return false;
+ }
+
/**
* returns ldap user array
*