$value) { unset($conf); $conf->name = $name; $conf->value = $value; if ($current = get_record("config", "name", $name)) { $conf->id = $current->id; if (! update_record("config", $conf)) { notify("Could not update $name to $value"); } } else { if (! insert_record("config", $conf)) { notify("Error: could not add new variable $name !"); } } } redirect("auth.php", get_string("changessaved"), 1); exit; } else { foreach ($err as $key => $value) { $focus = "form.$key"; } } } /// Otherwise fill and print the form. if (!isset($config)) { $config = $CFG; } $modules = get_list_of_plugins("auth"); foreach ($modules as $module) { $options[$module] = get_string("auth_$module"."title", "auth"); } asort($options); if (isset($_GET['auth'])) { $auth = $_GET['auth']; } else { $auth = $config->auth; } if (! isset($config->guestloginbutton)) { $config->guestloginbutton = 1; } $guestoptions[0] = get_string("hide"); $guestoptions[1] = get_string("show"); $stradministration = get_string("administration"); $strauthentication = get_string("authentication"); $strauthenticationoptions = get_string("authenticationoptions","auth"); $strsettings = get_string("settings"); print_header("$site->shortname: $strauthenticationoptions", "$site->fullname", "$stradministration -> $strauthenticationoptions", "$focus"); echo "

"; echo "

"; print_string("chooseauthmethod","auth"); choose_from_menu ($options, "auth", $auth, "","top.location='auth.php?auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", ""); echo "

"; print_simple_box_start("center", "100%", "$THEME->cellheading"); print_heading($options[$auth]); echo "

"; print_string("auth_$auth"."description", "auth"); echo "

"; echo "
"; print_heading($strsettings); echo ""; require("$CFG->dirroot/auth/$auth/config.html"); echo ""; echo ""; echo ""; echo "

guestloginbutton:

"; choose_from_menu($guestoptions, "guestloginbutton", $config->guestloginbutton, ""); echo ""; print_string("showguestlogin","auth"); echo "
"; echo "

"; print_simple_box_end(); print_footer(); exit; /// Functions ///////////////////////////////////////////////////////////////// function validate_form(&$form, &$err) { // if (empty($form->fullname)) // $err["fullname"] = get_string("missingsitename"); return; } ?>