server()) { metaRefresh("../login.php"); exit; } // empty list of attribute types $_SESSION['profile_types'] = array(); // print header echo $_SESSION['header']; echo "\n\n"; echo "
\n"; // check if account type is valid $type = $_GET['type']; if (!(($type == 'user') || ($type == 'group') || ($type == 'host'))) meta_refresh('profilemain.php'); // get module options $options = getProfileOptions($type); // load old profile if needed $old_options = array(); if ($_GET['edit']) { if ($type == "user") $old_options = loadUserProfile($_GET['edit']); else if ($type == "group") $old_options = loadGroupProfile($_GET['edit']); else if ($type == "host") $old_options = loadHostProfile($_GET['edit']); } // display formular echo ("
\n"); // display module options $modules = array_keys($options); for ($m = 0; $m < sizeof($modules); $m++) { // ignore modules without options if (sizeof($options[$modules[$m]]) < 1) continue; echo "
\n"; echo "" . getModuleAlias($modules[$m], $type) . "\n"; echo "\n"; for ($l = 0; $l < sizeof($options[$modules[$m]]); $l++) { // option lines echo "\n"; for ($o = 0; $o < sizeof($options[$modules[$m]][$l]); $o++) { // line parts echo "\n"; } echo "\n"; } echo "
"; print_option($options[$modules[$m]][$l][$o], $modules[$m], $old_options); echo "
\n"; echo "
\n"; } // profile name and submit/abort buttons echo "

 

"; echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo (""); echo ("\n"); echo ("\n"); echo ("\n"); echo ("\n"); echo (""); echo ("\n"); echo ("
" . _("Profile name") . ":" . _("Help") . "
 
\n"); echo (" 
\n"); echo "\n"; echo ("
\n"); // prints out the row of a table including the option name, values and help // $values: An array formated as module option // $module_name: The name of the module the options belong to // $old_options: A hash array with the values from the loaded profile function print_option($values, $modulename, $old_options) { switch ($values['kind']) { // text value case 'text': echo $values['text'] . "\n"; break; // help link case 'help': echo "" . _('Help') . "\n"; break; // input field case 'input': if (($values['type'] == 'text') || ($values['type'] == 'checkbox')) { if ($values['type'] == 'text') { $output = "\n"; $_SESSION['profile_types'][$values['name']] = "multiselect"; } else { echo "\n"; break; // print error message for invalid types default: echo _("Unrecognized type") . ": " . $values['kind'] . "\n"; break; } } ?>