Commit 6f90084e authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Removed recursive_remove (unused and did the same thing as rmdir_recursive)

Showing with 4 additions and 27 deletions
+4 -27
...@@ -665,7 +665,7 @@ class LDAP ...@@ -665,7 +665,7 @@ class LDAP
/*! /*!
* \brief Function rmdir_recursive * \brief Function rmdir_recursive
* *
* Based in recursive_remove, adding two thing: full subtree remove, and delete own node. * Based on recursive_remove, adding two thing: full subtree remove, and delete own node.
* *
* \param $srp srp * \param $srp srp
* *
...@@ -681,7 +681,7 @@ class LDAP ...@@ -681,7 +681,7 @@ class LDAP
/* Get sorted list of dn's to delete */ /* Get sorted list of dn's to delete */
$this->cd($deletedn); $this->cd($deletedn);
$this->search($srp, "(objectClass=*)", array('dn')); $this->search($srp, '(objectClass=*)', array('dn'));
while ($attrs = $this->fetch($srp)) { while ($attrs = $this->fetch($srp)) {
$delarray[$attrs['dn']] = strlen($attrs['dn']); $delarray[$attrs['dn']] = strlen($attrs['dn']);
} }
...@@ -690,7 +690,7 @@ class LDAP ...@@ -690,7 +690,7 @@ class LDAP
/* Really Delete ALL dn's in subtree */ /* Really Delete ALL dn's in subtree */
foreach (array_keys($delarray) as $key) { foreach (array_keys($delarray) as $key) {
$r = @ldap_delete($this->cid, LDAP::fix($key)); $r = @ldap_delete($this->cid, $key);
if ($r === FALSE) { if ($r === FALSE) {
break; break;
} }
...@@ -901,29 +901,6 @@ class LDAP ...@@ -901,29 +901,6 @@ class LDAP
return TRUE; return TRUE;
} }
/*!
* \brief Recursive remove
*
* \param integer $srp
*/
function recursive_remove($srp)
{
$delarray = array();
/* Get sorted list of dn's to delete */
$this->search($srp, '(objectClass=*)');
while ($attrs = $this->fetch($srp)) {
$delarray[$attrs['dn']] = strlen($attrs['dn']);
}
arsort($delarray);
reset($delarray);
/* Delete all dn's in subtree */
foreach (array_keys($delarray) as $key) {
$this->rmdir($key);
}
}
/*! /*!
* \brief Read a entry from a directory * \brief Read a entry from a directory
* *
......
...@@ -60,7 +60,7 @@ class ldapMultiplexer { ...@@ -60,7 +60,7 @@ class ldapMultiplexer {
public function __call($methodName, $parameters) public function __call($methodName, $parameters)
{ {
/* Add resource pointer if the mentioned methods are used */ /* Add resource pointer if the mentioned methods are used */
if (in_array($methodName, array('search','ls','cat','fetch','clearResult','resetResult','count','getDN','recursive_remove','rmdir_recursive','create_missing_trees','import_single_entry','import_complete_ldif'))) { if (in_array($methodName, array('search','ls','cat','fetch','clearResult','resetResult','count','getDN','rmdir_recursive','create_missing_trees','import_single_entry','import_complete_ldif'))) {
array_unshift($parameters, $this->sr); array_unshift($parameters, $this->sr);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment