temporarily deactivated update_cache() calls

This commit is contained in:
Roland Gruber 2005-08-08 09:26:19 +00:00
parent d97c2e5afc
commit 1df507d3d4
2 changed files with 18 additions and 16 deletions

View File

@ -1533,14 +1533,14 @@ class accountContainer {
}
$success = ldap_add($_SESSION['ldap']->server(), $this->dn, $attr);
if ($success) {
$_SESSION['cache']->update_cache($this->dn, 'add', $attr);
//$_SESSION['cache']->update_cache($this->dn, 'add', $attr); TODO: reactivate
$success = ldap_delete($_SESSION['ldap']->server(), $this->dn_orig);
if (!$success) {
$errors[] = array('ERROR', sprintf(_('Was unable to delete DN: %s.'), $this->dn_orig), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
if ($success)
$_SESSION['cache']->update_cache($this->dn, 'delete_dn');
//if ($success) TODO: reactivate
//$_SESSION['cache']->update_cache($this->dn, 'delete_dn'); TODO: reactivate
}
if (!$success) {
$errors[] = array('ERROR', sprintf(_('Was unable to create DN: %s.'), $this->dn), ldap_error($_SESSION['ldap']->server()));
@ -1558,8 +1558,8 @@ class accountContainer {
$errors[] = array('ERROR', sprintf(_('Was unable to create DN: %s.'), $this->dn), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else
$_SESSION['cache']->update_cache($this->dn, 'add', $attr);
//else TODO: reactivate
//$_SESSION['cache']->update_cache($this->dn, 'add', $attr); TODO: reactivate
}
unset($attributes[$this->dn]);
}
@ -1574,8 +1574,8 @@ class accountContainer {
$errors[] = array('ERROR', sprintf(_('Was unable to modify attribtues from DN: %s.'), $DNs[$i]), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else
$_SESSION['cache']->update_cache($this->dn, 'modify', $attributes[$this->dn]['modify']);
//else TODO: reactivate
//$_SESSION['cache']->update_cache($this->dn, 'modify', $attributes[$this->dn]['modify']); TODO: reactivate
}
// add attributes
if (isset($attributes[$DNs[$i]]['add']) && !$stopprocessing) {
@ -1584,8 +1584,8 @@ class accountContainer {
$errors[] = array('ERROR', sprintf(_('Was unable to add attribtues to DN: %s.'), $DNs[$i]), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else
$_SESSION['cache']->update_cache($this->dn, 'add', $attributes[$this->dn]['add']);
//else TODO: reactivate
//$_SESSION['cache']->update_cache($this->dn, 'add', $attributes[$this->dn]['add']); TODO: reactivate
}
// removce attributes
if (isset($attributes[$DNs[$i]]['remove']) && !$stopprocessing) {
@ -1594,8 +1594,8 @@ class accountContainer {
$errors[] = array('ERROR', sprintf(_('Was unable to remove attribtues from DN: %s.'), $DNs[$i]), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else
$_SESSION['cache']->update_cache($this->dn, 'remove', $attributes[$this->dn]['remove']);
//else TODO: reactivate
//$_SESSION['cache']->update_cache($this->dn, 'remove', $attributes[$this->dn]['remove']); TODO: reactivate
}
}
}
@ -1616,6 +1616,7 @@ class accountContainer {
}
}
}
$_SESSION['cache']->refresh_cache(true); // TODO: remove when update_cache is fixed
if (count($errors)!=0) return $errors;
return 0;
}

View File

@ -172,7 +172,7 @@ if ($_POST['delete']) {
$errors[] = array ('ERROR', sprintf(_('Was unable to modify attribtues from DN: %s.'), $DNs[$i]), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else $_SESSION['cache']->update_cache($DNs[$i], 'modify', $attributes[$DNs[$i]]['modify']);
//else $_SESSION['cache']->update_cache($DNs[$i], 'modify', $attributes[$DNs[$i]]['modify']); TODO: reactivate
}
// add attributes
if (isset($attributes[$DNs[$i]]['add']) && !$stopprocessing) {
@ -181,7 +181,7 @@ if ($_POST['delete']) {
$errors[] = array ('ERROR', sprintf(_('Was unable to add attribtues to DN: %s.'), $DNs[$i]), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else $_SESSION['cache']->update_cache($DNs[$i], 'add', $attributes[$DNs[$i]]['add']);
//else $_SESSION['cache']->update_cache($DNs[$i], 'add', $attributes[$DNs[$i]]['add']); TODO: reactivate
}
// removce attributes
if (isset($attributes[$DNs[$i]]['remove']) && !$stopprocessing) {
@ -190,7 +190,7 @@ if ($_POST['delete']) {
$errors[] = array ('ERROR', sprintf(_('Was unable to remove attribtues from DN: %s.'), $DNs[$i]), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else $_SESSION['cache']->update_cache($DNs[$i], 'remove', $attributes[$DNs[$i]]['remove']);
//else $_SESSION['cache']->update_cache($DNs[$i], 'remove', $attributes[$DNs[$i]]['remove']); TODO: reactivate
}
}
}
@ -218,8 +218,8 @@ if ($_POST['delete']) {
$errors[] = array ('ERROR', sprintf(_('Was unable to delete DN: %s.'), $_SESSION['delete_dn'][$m]), ldap_error($_SESSION['ldap']->server()));
$stopprocessing = true;
}
else
$_SESSION['cache']->update_cache($_SESSION['delete_dn'][$m], 'delete_dn');
//else TODO: reactivate
//$_SESSION['cache']->update_cache($_SESSION['delete_dn'][$m], 'delete_dn'); TODO: reactivate
}
if (!$stopprocessing) {
echo sprintf(_('Deleted DN: %s'), $_SESSION['delete_dn'][$m]) . "<br>\n";
@ -232,6 +232,7 @@ if ($_POST['delete']) {
echo "<br>\n";
}
}
$_SESSION['cache']->refresh_cache(true); // TODO: remove when update_cache is fixed
echo "<br>\n";
echo "<br><input name=\"cancel\" type=\"submit\" value=\"" . _('Back to list') . "\">\n";
echo "</fieldset>\n";