get_Passwd()) { /** go back to login if password is invalid */ require('conflogin.php'); exit; } // update type settings if (isset($_POST['postAvailable'])) { $postKeys = array_keys($_POST); for ($i = 0; $i < sizeof($postKeys); $i++) { $key = $postKeys[$i]; if (substr($key, 0, 7) == "suffix_") { $_SESSION['conf_typeSettings'][$key] = $_POST[$key]; } elseif (substr($key, 0, 5) == "attr_") { $_SESSION['conf_typeSettings'][$key] = $_POST[$key]; } } } $errors = array(); // user pressed submit/abort button if ($_POST['submit']) { // check settings $allOK = true; $postKeys = array_keys($_POST); for ($i = 0; $i < sizeof($postKeys); $i++) { $key = $postKeys[$i]; if (substr($key, 0, 7) == "suffix_") { $type = substr($postKeys[$i], 7); if (strlen($_POST[$key]) < 1) { $errors[] = array("ERROR", _("LDAP Suffix is invalid!"), getTypeAlias($type)); $allOK = false; } } elseif (substr($key, 0, 5) == "attr_") { $type = substr($postKeys[$i], 5); if (!is_string($_POST[$key]) || !eregi("^((#[^:;]+)|([^:;]*:[^:;]+))(;((#[^:;]+)|([^:;]*:[^:;]+)))*$", $_POST[$key])) { $errors[] = array("ERROR", _("List attributes are invalid!"), getTypeAlias($type)); $allOK = false; } } } if ($allOK) { //selection ok, back to other settings metarefresh('confmain.php?typesback=true&typeschanged=true'); exit; } } elseif ($_POST['abort']) { // no changes metarefresh('confmain.php?typesback=true'); exit; } // check if remove button was pressed $postKeys = array_keys($_POST); for ($i = 0; $i < sizeof($postKeys); $i++) { $key = $postKeys[$i]; if (substr($key, 0, 4) == "rem_") { $type = substr($key, 4); $_SESSION['conf_accountTypes'] = array_flip($_SESSION['conf_accountTypes']); unset($_SESSION['conf_accountTypes'][$type]); $_SESSION['conf_accountTypes'] = array_flip($_SESSION['conf_accountTypes']); $_SESSION['conf_accountTypes'] = array_values($_SESSION['conf_accountTypes']); } } // check if add button was pressed $postKeys = array_keys($_POST); for ($i = 0; $i < sizeof($postKeys); $i++) { $key = $postKeys[$i]; if (substr($key, 0, 4) == "add_") { $type = substr($key, 4); $_SESSION['conf_accountTypes'][] = $type; } } // get active and available types $allTypes = getTypes(); $activeTypes = $_SESSION['conf_accountTypes']; $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"; for ($i = 0; $i < sizeof($allTypes); $i++){ echo "\n"; } echo "\n"; echo ("

". "\"LDAP



\n"); // print error messages for ($i = 0; $i < sizeof($errors); $i++) call_user_func_array('StatusMessage', $errors[$i]); echo ("
\n"); echo "

" . _("Account type selection") . "

"; // show available types echo "
" . _("Available account types") . "\n"; echo "\n"; for ($i = 0; $i < sizeof($availableTypes); $i++) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } echo "
" . getTypeAlias($availableTypes[$i]) . ": " . getTypeDescription($availableTypes[$i]) . "
\n"; echo "
\n"; echo "



"; // show active types echo "
" . _("Active account types") . "
\n"; for ($i = 0; $i < sizeof($activeTypes); $i++) { echo "
\n"; echo "" . "" . getTypeAlias($activeTypes[$i]) . ": " . getTypeDescription($activeTypes[$i]) . ""; echo "
\n"; echo "\n"; // LDAP suffix echo "\n"; echo "\n"; echo "\n"; echo "\n"; // list attributes if (isset($_SESSION['conf_typeSettings']['attr_' . $activeTypes[$i]])) { $attributes = $_SESSION['conf_typeSettings']['attr_' . $activeTypes[$i]]; } else { $attributes = getDefaultListAttributes($activeTypes[$i]); } echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; // remove button echo "\n"; echo "\n"; echo "\n"; echo "
" . _("LDAP suffix") . "
" . _("List attributes") . "
 
\n"; echo "

\n"; } echo "
\n"; echo "



\n"; // submit and abort button echo "

"; echo "\n"; echo "\n"; echo "\n"; echo "

"; echo "



\n"; echo "
\n"; echo "\n"; echo "\n"; ?>