" . _("LDAP Account Manager Configuration") . "\n"; 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"; } 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"; // module settings $types = $conf->get_ActiveTypes(); // get list of scopes of modules $scopes = array(); for ($m = 0; $m < sizeof($types); $m++) { $mods = $conf->get_AccountModules($types[$m]); for ($i = 0; $i < sizeof($mods); $i++) $scopes[$mods[$i]][] = $types[$m]; } // get module options $options = getConfigOptions($scopes); // get current setting $old_options = $conf->get_moduleSettings(); // display module boxes $tabindex = 0; $modules = array_keys($options); $_SESSION['conf_types'] = array(); for ($i = 0; $i < sizeof($modules); $i++) { if (sizeof($options[$modules[$i]]) < 1) continue; echo "
\n"; $icon = ''; $module = new $modules[$i]('none'); $iconImage = $module->getIcon(); if ($iconImage != null) { $icon = '' . $iconImage . ' '; } echo "$icon" . getModuleAlias($modules[$i], "none") . "
\n"; $configTypes = parseHtml($modules[$i], $options[$modules[$i]], $old_options, true, $tabindex, 'config'); $_SESSION['conf_types'] = array_merge($configTypes, $_SESSION['conf_types']); echo "
\n"; echo "
"; } 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(); } $conf = &$_SESSION['conf_config']; $types = $conf->get_ActiveTypes(); // check module options // create option array to check and save $options = array(); $opt_keys = array_keys($_SESSION['conf_types']); for ($i = 0; $i < sizeof($opt_keys); $i++) { $element = $opt_keys[$i]; // text fields if ($_SESSION['conf_types'][$element] == "text") { $options[$element] = array($_POST[$element]); } // checkboxes elseif ($_SESSION['conf_types'][$element] == "checkbox") { if (isset($_POST[$element]) && ($_POST[$element] == "on")) $options[$element] = array('true'); else $options[$element] = array('false'); } // dropdownbox elseif ($_SESSION['conf_types'][$element] == "select") { $options[$element] = array($_POST[$element]); } // multiselect elseif ($_SESSION['conf_types'][$element] == "multiselect") { $options[$element] = $_POST[$element]; // value is already an array } // textarea elseif ($_SESSION['conf_types'][$element] == "textarea") { $options[$element] = explode("\r\n", $_POST[$element]); } } // get list of scopes of modules $scopes = array(); for ($m = 0; $m < sizeof($types); $m++) { $mods = $conf->get_AccountModules($types[$m]); for ($i = 0; $i < sizeof($mods); $i++) $scopes[$mods[$i]][] = $types[$m]; } // check options $errors = checkConfigOptions($scopes, $options); $conf->set_moduleSettings($options); return $errors; } ?>