get_ActiveTypes(); echo $_SESSION['header']; echo "" . _("LDAP Account Manager Configuration") . "\n"; echo "\n"; echo "\n"; for ($i = 0; $i < sizeof($types); $i++){ echo "\n"; } echo "\n"; // include all JavaScript files $jsDirName = dirname(__FILE__) . '/../lib'; $jsDir = dir($jsDirName); while ($jsEntry = $jsDir->read()) { if (substr($jsEntry, strlen($jsEntry) - 3, 3) != '.js') continue; echo "\n"; } echo ("

". "\"LDAP


\n

 

\n"); // print error messages for ($i = 0; $i < sizeof($errorsToDisplay); $i++) call_user_func_array('StatusMessage', $errorsToDisplay[$i]); echo ("
\n"); echo "\n"; echo "\n"; echo "
"; // show tabs echo ""; echo "\n"; $buttonSpace = '         '; // general settings echo "'; // account types echo "'; // module selection echo "'; // module settings echo "'; echo ""; // spacer echo ""; // save button echo "'; // cancel button echo "'; echo "
\n"; echo "\n"; echo "
\n"; $buttonStyle = 'background-image: url(../../graphics/bigTools.png);'; echo "\n"; echo "
\n"; echo '
\n"; echo "\n"; echo "
\n"; $buttonStyle = 'background-image: url(../../graphics/gear.png);'; echo "\n"; echo "
\n"; echo '
\n"; echo "\n"; echo "
\n"; $buttonStyle = 'background-image: url(../../graphics/modules.png);'; echo "\n"; echo "
\n"; echo '
\n"; echo "\n"; echo "
\n"; $buttonStyle = 'background-image: url(../../graphics/moduleSettings.png);'; echo "\n"; echo "
\n"; echo '
  \n"; echo "\n"; echo "
\n"; $buttonStyle = 'background-image: url(../../graphics/pass.png);'; echo "\n"; echo "
\n"; echo '
\n"; echo "\n"; echo "
\n"; $buttonStyle = 'background-image: url(../../graphics/fail.png);'; echo "\n"; echo "
\n"; echo '
\n"; // end tabs echo "


\n"; $account_list = array(); for ($i = 0; $i < sizeof($types); $i++) { $account_list[] = array($types[$i], getTypeAlias($types[$i])); } for ($i = 0; $i < sizeof($account_list); $i++) { config_showAccountModules($account_list[$i][0], $account_list[$i][1]); } echo "

\n"; echo "(*) " . _("Base module"); // help link echo " "; printHelpLink(getHelp('', '237'), '237'); echo "




\n"; echo '
'; echo "\n"; echo "
\n"; echo "\n"; echo "\n"; /** * Displays the module selection boxes and checks if dependencies are fulfilled. * * @param string $scope account type * @param string $title title for module selection (e.g. "User modules") */ function config_showAccountModules($scope, $title) { $conf = &$_SESSION['conf_config']; $typeSettings = $conf->get_typeSettings(); // account modules $available = getAvailableModules($scope); $selected = $typeSettings['modules_' . $scope]; if (isset($selected) && ($selected != '')) { $selected = explode(',', $selected); } else { $selected = array(); } // show account modules $icon = '' . $scope . ' '; echo "
$icon" . $title . "
\n"; echo "\n"; // select boxes echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "" . _("Selected modules") . "
\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "

"; echo ""; echo "
"; echo ""; echo "

\n"; echo "
\n"; echo "
\n"; echo "" . _("Available modules") . "
\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; } /** * Checks user input and saves the entered settings. * * @return array list of errors */ function checkInput() { if (!isset($_POST['postAvailable'])) { return array(); } $errors = array(); $conf = &$_SESSION['conf_config']; $typeSettings = $conf->get_typeSettings(); $accountTypes = $conf->get_ActiveTypes(); for ($t = 0; $t < sizeof($accountTypes); $t++) { $scope = $accountTypes[$t]; $available = getAvailableModules($scope); $selected_temp = $typeSettings['modules_' . $scope]; if (isset($selected_temp)) $selected_temp = explode(',', $selected_temp); $selected = array(); // only use available modules as selected for ($i = 0; $i < sizeof($selected_temp); $i++) { if (in_array($selected_temp[$i], $available)) { $selected[] = $selected_temp[$i]; } } // remove modules from selection if (isset($_POST[$scope . '_selected']) && isset($_POST[$scope . '_remove'])) { $new_selected = array(); for ($i = 0; $i < sizeof($selected); $i++) { if (! in_array($selected[$i], $_POST[$scope . '_selected'])) $new_selected[] = $selected[$i]; } $selected = $new_selected; $typeSettings['modules_' . $scope] = implode(',', $selected); } // add modules to selection elseif (isset($_POST[$scope . '_available']) && isset($_POST[$scope . '_add'])) { $new_selected = $selected; for ($i = 0; $i < sizeof($_POST[$scope . '_available']); $i++) { if (! in_array($_POST[$scope . '_available'][$i], $selected)) $new_selected[] = $_POST[$scope . '_available'][$i]; } $selected = $new_selected; $typeSettings['modules_' . $scope] = implode(',', $selected); } // check dependencies $depends = check_module_depends($selected, getModulesDependencies($scope)); if ($depends != false) { for ($i = 0; $i < sizeof($depends); $i++) { $errors[] = array('ERROR', getTypeAlias($scope), _("Unsolved dependency:") . ' ' . $depends[$i][0] . " (" . $depends[$i][1] . ")"); } } // check conflicts $conflicts = check_module_conflicts($selected, getModulesDependencies($scope)); if ($conflicts != false) { for ($i = 0; $i < sizeof($conflicts); $i++) { $errors[] = array('ERROR', getTypeAlias($scope), _("Conflicting module:") . ' ' . $conflicts[$i][0] . " (" . $conflicts[$i][1] . ")"); } } // check for base module $baseCount = 0; for ($i = 0; $i < sizeof($selected); $i++) { if (is_base_module($selected[$i], $scope)) { $baseCount++; } } if ($baseCount != 1) { $errors[] = array('ERROR', getTypeAlias($scope), _("No or more than one base module selected!")); } } $conf->set_typeSettings($typeSettings); return $errors; } ?>