fixed deleting

This commit is contained in:
Roland Gruber 2007-10-26 14:10:10 +00:00
parent c2200d865e
commit e983a1f7ba
2 changed files with 18 additions and 8 deletions

View File

@ -807,7 +807,16 @@ class accountContainer {
else { else {
return null; return null;
} }
} }
/**
* Returns the included account modules.
*
* @return array modules
*/
function getAccountModules() {
return $this->module;
}
/** /**
* Returns the accout type of this object (e.g. user, group, host). * Returns the accout type of this object (e.g. user, group, host).

View File

@ -140,13 +140,14 @@ if ($_POST['delete']) {
// First load DN. // First load DN.
$_SESSION['account']->load_account($_SESSION['delete_dn'][$m]); $_SESSION['account']->load_account($_SESSION['delete_dn'][$m]);
// get commands and changes of each attribute // get commands and changes of each attribute
$module = array_keys($_SESSION['account']->module); $moduleNames = array_keys($_SESSION['account']->getAccountModules());
$modules = $_SESSION['account']->getAccountModules();
$attributes = array(); $attributes = array();
$errors = array(); $errors = array();
// predelete actions // predelete actions
if (!$stopprocessing) { if (!$stopprocessing) {
foreach ($module as $singlemodule) { foreach ($moduleNames as $singlemodule) {
$success = $_SESSION['account']->module[$singlemodule]->preDeleteActions(); $success = $modules[$singlemodule]->preDeleteActions();
if (!$success) { if (!$success) {
$stopprocessing = true; $stopprocessing = true;
break; break;
@ -155,9 +156,9 @@ if ($_POST['delete']) {
} }
if (!$stopprocessing) { if (!$stopprocessing) {
// load attributes // load attributes
foreach ($module as $singlemodule) { foreach ($moduleNames as $singlemodule) {
// load changes // load changes
$temp = $_SESSION['account']->module[$singlemodule]->delete_attributes(); $temp = $modules[$singlemodule]->delete_attributes();
if (is_array($temp)) { if (is_array($temp)) {
// merge changes // merge changes
$DNs = array_keys($temp); $DNs = array_keys($temp);
@ -215,8 +216,8 @@ if ($_POST['delete']) {
} }
// post delete actions // post delete actions
if (!$stopprocessing) { if (!$stopprocessing) {
foreach ($module as $singlemodule) { foreach ($moduleNames as $singlemodule) {
$_SESSION['account']->module[$singlemodule]->postDeleteActions(); $modules[$singlemodule]->postDeleteActions();
} }
} }
if (!$stopprocessing) { if (!$stopprocessing) {