check if all types have active modules

This commit is contained in:
Roland Gruber 2009-08-02 12:54:25 +00:00
parent 036ed0baa8
commit 171d8f266c
1 changed files with 10 additions and 1 deletions

View File

@ -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();