From e983a1f7ba607770876835a3c0cdcae84770ea21 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Fri, 26 Oct 2007 14:10:10 +0000 Subject: [PATCH] fixed deleting --- lam/lib/modules.inc | 11 ++++++++++- lam/templates/delete.php | 15 ++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 08af61a9..8909fcc5 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -807,7 +807,16 @@ class accountContainer { else { 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). diff --git a/lam/templates/delete.php b/lam/templates/delete.php index fe2ed98c..6b5548bc 100644 --- a/lam/templates/delete.php +++ b/lam/templates/delete.php @@ -140,13 +140,14 @@ if ($_POST['delete']) { // First load DN. $_SESSION['account']->load_account($_SESSION['delete_dn'][$m]); // 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(); $errors = array(); // predelete actions if (!$stopprocessing) { - foreach ($module as $singlemodule) { - $success = $_SESSION['account']->module[$singlemodule]->preDeleteActions(); + foreach ($moduleNames as $singlemodule) { + $success = $modules[$singlemodule]->preDeleteActions(); if (!$success) { $stopprocessing = true; break; @@ -155,9 +156,9 @@ if ($_POST['delete']) { } if (!$stopprocessing) { // load attributes - foreach ($module as $singlemodule) { + foreach ($moduleNames as $singlemodule) { // load changes - $temp = $_SESSION['account']->module[$singlemodule]->delete_attributes(); + $temp = $modules[$singlemodule]->delete_attributes(); if (is_array($temp)) { // merge changes $DNs = array_keys($temp); @@ -215,8 +216,8 @@ if ($_POST['delete']) { } // post delete actions if (!$stopprocessing) { - foreach ($module as $singlemodule) { - $_SESSION['account']->module[$singlemodule]->postDeleteActions(); + foreach ($moduleNames as $singlemodule) { + $modules[$singlemodule]->postDeleteActions(); } } if (!$stopprocessing) {