Commit 4e7d3fae authored by Francois Marier's avatar Francois Marier

site options: Move proxy settings from networking to site options

LP: #547856
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent c36b94c4
......@@ -104,34 +104,6 @@ $networkingform = pieform(
'defaultvalue' => get_config('promiscuousmode'),
'options' => $yesno,
),
'proxyfieldset' => array(
'type' => 'fieldset',
'legend' => get_string('proxysettings', 'admin'),
'elements' => array(
'proxyaddress' => array(
'type' => 'text',
'title' => get_string('proxyaddress', 'admin'),
'description' => get_string('proxyaddressdescription', 'admin'),
'defaultvalue' => get_config('proxyaddress'),
),
'proxyauthmodel' => array(
'type' => 'select',
'title' => get_string('proxyauthmodel', 'admin'),
'description' => get_string('proxyauthmodeldescription', 'admin'),
'defaultvalue' => get_config('proxyauthmodel'),
'options' => array(
'' => 'None',
'basic' => 'Basic (NCSA)',
),
),
'proxyauthcredentials' => array(
'type' => 'text',
'title' => get_string('proxyauthcredentials', 'admin'),
'description' => get_string('proxyauthcredentialsdescription', 'admin'),
'defaultvalue' => get_config('proxyauthcredentials'),
),
),
),
'submit' => array(
'type' => 'submit',
'value' => get_string('savechanges','admin')
......@@ -178,33 +150,6 @@ function networkingform_submit(Pieform $form, $values) {
}
}
if(get_config('proxyaddress') != $values['proxyaddress']) {
if(!set_config('proxyaddress', $values['proxyaddress'])) {
networkingform_fail($form);
}
else {
$reply .= get_string('proxyaddressset', 'admin');
}
}
if(get_config('proxyauthmodel') != $values['proxyauthmodel']) {
if(!set_config('proxyauthmodel', $values['proxyauthmodel'])) {
networkingform_fail($form);
}
else {
$reply .= get_string('proxyauthmodelset', 'admin');
}
}
if(get_config('proxyauthcredentials') != $values['proxyauthcredentials']) {
if(!set_config('proxyauthcredentials', $values['proxyauthcredentials'])) {
networkingform_fail($form);
}
else {
$reply .= get_string('proxyauthcredntialsset', 'admin');
}
}
$form->reply(PIEFORM_OK, array(
'message' => ($reply == '') ? get_string('networkingunchanged','admin') : $reply,
'goto' => '/admin/site/networking.php',
......
......@@ -338,6 +338,37 @@ $siteoptionform = array(
),
),
),
# TODO: this should become "Network Settings" at some point
'proxysettings' => array(
'type' => 'fieldset',
'collapsible' => true,
'collapsed' => true,
'legend' => get_string('proxysettings', 'admin'),
'elements' => array(
'proxyaddress' => array(
'type' => 'text',
'title' => get_string('proxyaddress', 'admin'),
'description' => get_string('proxyaddressdescription', 'admin'),
'defaultvalue' => get_config('proxyaddress'),
),
'proxyauthmodel' => array(
'type' => 'select',
'title' => get_string('proxyauthmodel', 'admin'),
'description' => get_string('proxyauthmodeldescription', 'admin'),
'defaultvalue' => get_config('proxyauthmodel'),
'options' => array(
'' => 'None',
'basic' => 'Basic (NCSA)',
),
),
'proxyauthcredentials' => array(
'type' => 'text',
'title' => get_string('proxyauthcredentials', 'admin'),
'description' => get_string('proxyauthcredentialsdescription', 'admin'),
'defaultvalue' => get_config('proxyauthcredentials'),
),
),
),
'generalsettings' => array(
'type' => 'fieldset',
'collapsible' => true,
......@@ -434,6 +465,7 @@ function siteoptions_submit(Pieform $form, $values) {
'showselfsearchsideblock', 'searchusernames', 'showtagssideblock',
'tagssideblockmaxtags', 'country', 'viewmicroheaders', 'userscanchooseviewthemes',
'remoteavatars', 'userscanhiderealnames', 'antispam', 'spamhaus', 'surbl', 'anonymouscomments',
'proxyaddress', 'proxyauthmodel', 'proxyauthcredentials',
'homepageinfo', 'showonlineuserssideblock', 'registerterms',
'creategroups', 'createpublicgroups', 'allowgroupcategories',
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment