From 171d8f266c9f39c30a4989df2308bc16e15edc35 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 2 Aug 2009 12:54:25 +0000 Subject: [PATCH] check if all types have active modules --- lam/templates/config/conftypes.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lam/templates/config/conftypes.php b/lam/templates/config/conftypes.php index ec2b1eef..f2016ce0 100644 --- a/lam/templates/config/conftypes.php +++ b/lam/templates/config/conftypes.php @@ -64,6 +64,16 @@ $errorsToDisplay = checkInput(); // check if button was pressed and if we have to save the settings or go to another tab if (isset($_POST['saveSettings']) || isset($_POST['editmodules']) || isset($_POST['edittypes']) || isset($_POST['generalSettingsButton'])) { if (sizeof($errorsToDisplay) == 0) { + // check if all types have modules + $activeTypes = $conf->get_ActiveTypes(); + for ($i = 0; $i < sizeof($activeTypes); $i++) { + $selectedModules = $conf->get_AccountModules($activeTypes[$i]); + if (sizeof($selectedModules) == 0) { + // go to module selection + metaRefresh("confmodules.php"); + exit; + } + } // go to final page if (isset($_POST['saveSettings'])) { metaRefresh("confsave.php"); @@ -83,7 +93,6 @@ if (isset($_POST['saveSettings']) || isset($_POST['editmodules']) || isset($_POS } $typeSettings = $conf->get_typeSettings(); -// get active and available types $allTypes = getTypes(); $activeTypes = $conf->get_ActiveTypes(); $availableTypes = array();