web service MDL-12886 administration: implement settings for servers (add amf debug option)
This commit is contained in:
@@ -8,6 +8,7 @@ $CFG->pagepath = 'admin/managewsprotocols';
|
||||
|
||||
$hide = optional_param('hide', '', PARAM_ALPHANUM);
|
||||
$username = optional_param('username', '', PARAM_ALPHANUM);
|
||||
$settings = optional_param('settings', '', PARAM_ALPHANUM);
|
||||
|
||||
$pagename = 'managews';
|
||||
|
||||
@@ -44,6 +45,40 @@ if (!empty($hide)) {
|
||||
$mform->display();
|
||||
print_simple_box_end();
|
||||
|
||||
} else if (!empty($settings)) {
|
||||
/// Server settings page
|
||||
admin_externalpage_print_header();
|
||||
|
||||
$mform = new wssettings_form('', array('settings' => $settings)); // load the server settings form
|
||||
|
||||
if ($mform->is_cancelled()){
|
||||
/// user pressed cancel button and return to the security web service page
|
||||
redirect($baseurl);
|
||||
exit;
|
||||
}
|
||||
|
||||
$fromform = $mform->get_data();
|
||||
|
||||
if (!empty($fromform)) {
|
||||
/// save the new setting
|
||||
require_once($CFG->dirroot . '/webservice/'. $settings . '/lib.php');
|
||||
$settingnames = call_user_func(array($settings.'_server', 'get_setting_names'));
|
||||
foreach($settingnames as $settingname) {
|
||||
if (empty($fromform->$settingname)) {
|
||||
set_config($settingname, null, $settings);
|
||||
} else {
|
||||
set_config($settingname, $fromform->$settingname, $settings);
|
||||
}
|
||||
}
|
||||
|
||||
redirect($baseurl,get_string("changessaved")); // return to the security web service page
|
||||
}
|
||||
/// display the server settings form
|
||||
print_simple_box_start();
|
||||
$mform->display();
|
||||
print_simple_box_end();
|
||||
} else {
|
||||
$return = true;
|
||||
}
|
||||
|
||||
if (!empty($return)) {
|
||||
|
||||
Reference in New Issue
Block a user