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]; } echo $_SESSION['header']; echo "" . _("LDAP Account Manager Configuration") . "\n"; echo "\n"; echo "\n"; for ($i = 0; $i < sizeof($allTypes); $i++){ echo "\n"; } echo "\n"; 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"; // show available types if (sizeof($availableTypes) > 0) { echo "
" . _("Available account types") . "\n"; echo "\n"; for ($i = 0; $i < sizeof($availableTypes); $i++) { $icon = '' . $availableTypes[$i] . ' '; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
$icon" . getTypeAlias($availableTypes[$i]) . ": " . getTypeDescription($availableTypes[$i]) . "
\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 '
'; 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; } ?>