diff --git a/lam/templates/delete.php b/lam/templates/delete.php index 4078836b..4b299ebd 100644 --- a/lam/templates/delete.php +++ b/lam/templates/delete.php @@ -1,10 +1,11 @@ getConfiguredType($_POST['type']) == null)) { logNewMessage(LOG_ERR, 'Invalid type: ' . $_POST['type']); die(); } if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) { - if (!preg_match('/^[a-z0-9_]+$/i', $_GET['type'])) { - logNewMessage(LOG_ERR, 'Invalid type: ' . $_GET['type']); + $typeId = $_GET['type']; + $type = $typeManager->getConfiguredType($typeId); + if ($type == null) { + logNewMessage(LOG_ERR, 'Invalid type: ' . $type->getId()); die(); } - if (!checkIfDeleteEntriesIsAllowed($_GET['type']) || !checkIfWriteAccessIsAllowed($_GET['type'])) { - logNewMessage(LOG_ERR, 'User tried to delete entries of forbidden type '. $_GET['type']); + if (!checkIfDeleteEntriesIsAllowed($type->getId()) || !checkIfWriteAccessIsAllowed($type->getId())) { + logNewMessage(LOG_ERR, 'User tried to delete entries of forbidden type '. $type->getId()); die(); } // Create account list @@ -88,15 +93,14 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) { } //load account - $typeManager = new LAM\TYPES\TypeManager(); - $_SESSION['account'] = new accountContainer($typeManager->getConfiguredType($_GET['type']), 'account'); + $_SESSION['account'] = new \accountContainer($type, 'account'); // Show HTML Page include 'main_header.php'; - echo "
"; + echo "
getScope() . "-bright smallPaddingContent\">"; echo "
\n"; echo "
\n"; echo ''; - echo "\n"; + echo "getId() . "\">\n"; echo "" . _("Do you really want to remove the following accounts?") . ""; echo "

\n"; echo "\n"; @@ -117,12 +121,12 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) { echo "
\n"; // Print delete rows from modules echo "
\n
"; - $modules = $_SESSION['config']->get_AccountModules($_GET['type']); + $modules = $_SESSION['config']->get_AccountModules($type->getId()); $values = array(); $tabindex = 100; foreach ($modules as $module) { - $module = moduleCache::getModule($module, $_GET['type']); - parseHtml(get_class($module), $module->display_html_delete(), $values, true, $tabindex, $_GET['type']); + $module = \moduleCache::getModule($module, $type->getScope()); + parseHtml(get_class($module), $module->display_html_delete(), $values, true, $tabindex, $type->getScope()); } echo "
\n"; echo "
\n"; @@ -131,7 +135,7 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) { echo "
\n"; echo "
\n"; ?> -