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"); exit; } // go to modules page elseif (isset($_POST['editmodules'])) { metaRefresh("confmodules.php"); exit; } // go to general page elseif (isset($_POST['generalSettingsButton'])) { metaRefresh("confmain.php"); exit; } // go to module settings page elseif (isset($_POST['moduleSettings'])) { metaRefresh("moduleSettings.php"); exit; } } } $typeSettings = $conf->get_typeSettings(); $allTypes = getTypes(); $activeTypes = $conf->get_ActiveTypes(); $availableTypes = array(); for ($i = 0; $i < sizeof($allTypes); $i++) { if (!in_array($allTypes[$i], $activeTypes)) { $availableTypes[$allTypes[$i]] = getTypeAlias($allTypes[$i]); } } natcasesort($availableTypes); echo $_SESSION['header']; echo "" . _("LDAP Account Manager Configuration") . "\n"; // include all CSS files $cssDirName = dirname(__FILE__) . '/../../style'; $cssDir = dir($cssDirName); while ($cssEntry = $cssDir->read()) { if (substr($cssEntry, strlen($cssEntry) - 4, 4) != '.css') continue; echo "\n"; } echo "\n"; for ($i = 0; $i < sizeof($allTypes); $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"; } ?>
 LDAP Account Manager  LDAP Account Manager

\n"); echo '
'; echo ""; echo " "; echo ""; echo "

\n"; echo '
'; // hidden submit buttons which are clicked by tabs echo "
\n"; echo ""; echo ""; echo ""; echo ""; echo "
\n"; // tabs echo '
'; echo ''; ?>
0) { echo "
" . _("Available account types") . "\n"; echo "\n"; foreach ($availableTypes as $key => $value) { $icon = '' . $value . ' '; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
$icon" . $value . ": " . getTypeDescription($key) . "
\n"; echo "
\n"; echo "



"; } // show active types if (sizeof($activeTypes) > 0) { echo "
" . _("Active account types") . "
\n"; for ($i = 0; $i < sizeof($activeTypes); $i++) { echo "
\n"; $icon = '' . $activeTypes[$i] . ' '; echo "" . $icon . "" . getTypeAlias($activeTypes[$i]) . ": " . getTypeDescription($activeTypes[$i]) . " " . "" . ""; echo "
\n"; echo "\n"; // LDAP suffix echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // list attributes if (isset($typeSettings['attr_' . $activeTypes[$i]])) { $attributes = $typeSettings['attr_' . $activeTypes[$i]]; } else { $attributes = getDefaultListAttributes($activeTypes[$i]); } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
" . _("LDAP suffix") . ""; printHelpLink(getHelp('', '202'), '202'); echo "
" . _("List attributes") . ""; printHelpLink(getHelp('', '206'), '206'); echo "
\n"; echo "

\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(); $postKeys = array_keys($_POST); for ($i = 0; $i < sizeof($postKeys); $i++) { $key = $postKeys[$i]; // check if remove button was pressed if (substr($key, 0, 4) == "rem_") { $type = substr($key, 4); $accountTypes = array_flip($accountTypes); unset($accountTypes[$type]); $accountTypes = array_flip($accountTypes); $accountTypes = array_values($accountTypes); } // check if add button was pressed else if (substr($key, 0, 4) == "add_") { $type = substr($key, 4); $accountTypes[] = $type; } // set suffixes elseif (substr($key, 0, 7) == "suffix_") { $typeSettings[$key] = $_POST[$key]; $type = substr($postKeys[$i], 7); if (strlen($_POST[$key]) < 1) { $errors[] = array("ERROR", _("LDAP Suffix is invalid!"), getTypeAlias($type)); } } elseif (substr($key, 0, 5) == "attr_") { $typeSettings[$key] = $_POST[$key]; $type = substr($postKeys[$i], 5); if (!is_string($_POST[$key]) || !preg_match("/^((#[^:;]+)|([^:;]*:[^:;]+))(;((#[^:;]+)|([^:;]*:[^:;]+)))*$/", $_POST[$key])) { $errors[] = array("ERROR", _("List attributes are invalid!"), getTypeAlias($type)); } } } // save input $conf->set_typeSettings($typeSettings); $conf->set_ActiveTypes($accountTypes); return $errors; } ?>