Commit b148ffe4 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use drop-down rather than checkboxes to choose 'They sso in' or 'We sso out'...


Use drop-down rather than checkboxes to choose 'They sso in' or 'We sso out' in xmlrpc auth config form
Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent d3d819de
......@@ -174,10 +174,31 @@ function nextSiblingTR(node) {
}
return node.nextSibling;
}
var ssoAllOptions = {
'updateuserinfoonlogin': 'theyssoin',
'weautocreateusers': 'theyssoin',
'theyautocreateusers': 'wessoout',
'weimportcontent': 'theyssoin'
};
function updateSsoOptions() {
var current = $('auth_config_ssodirection').value;
for (var opt in ssoAllOptions) {
if (ssoAllOptions[opt] == current) {
removeElementClass('auth_config_' + opt + '_container', 'hidden');
}
else {
addElementClass('auth_config_' + opt + '_container', 'hidden');
}
}
}
addLoadEvent(
function() {
connect('auth_config_parent', 'onchange', authloginmsgVisibility);
authloginmsgVisibility();
if ($('auth_config_ssodirection')) {
connect('auth_config_ssodirection', 'onchange', updateSsoOptions);
}
updateSsoOptions();
}
);
EOF;
......
<h3>They SSO in</h3>
<p>Enable this option to allow users from the remote site to roam to your Mahara site, without having to enter their username and password.</p>
\ No newline at end of file
<p>Enable this option to allow users from the remote site to roam to your Mahara site, without having to enter their username and password.</p>
<h3>We SSO out</h3>
<p>Enable this option to allow your users to roam from Mahara to the remote site, without having to re-sign on there.</p>
<h3>We SSO out</h3>
<p>Enable this option to allow your users to roam from Mahara to the remote site, without having to re-sign on there.</p>
\ No newline at end of file
......@@ -787,18 +787,12 @@ class PluginAuthXmlrpc extends PluginAuth {
'help' => true,
);
$elements['wessoout'] = array(
'type' => 'checkbox',
'title' => get_string('wessoout', 'auth'),
'defaultvalue' => self::$default_config['wessoout'],
'help' => true
);
$elements['theyssoin'] = array(
'type' => 'checkbox',
'title' => get_string('theyssoin', 'auth'),
'defaultvalue' => self::$default_config['theyssoin'],
'help' => true
$elements['ssodirection'] = array(
'type' => 'select',
'title' => get_string('ssodirection', 'auth'),
'options' => array(0 => '--', 'theyssoin' => get_string('theyssoin', 'auth'), 'wessoout' => get_string('wessoout', 'auth')),
'defaultvalue' => self::$default_config['wessoout'] ? 'wessoout' : 'theyssoin',
'help' => true,
);
$elements['updateuserinfoonlogin'] = array(
......@@ -825,7 +819,6 @@ class PluginAuthXmlrpc extends PluginAuth {
$elements['weimportcontent'] = array(
'type' => 'checkbox',
'title' => get_string('weimportcontent', 'auth'),
'description' => get_string('weimportcontentdescription', 'auth'),
'defaultvalue' => self::$default_config['weimportcontent'],
'help' => true,
);
......@@ -944,16 +937,27 @@ class PluginAuthXmlrpc extends PluginAuth {
}
self::$default_config = array( 'wwwroot' => $values['wwwroot'],
'updateuserinfoonlogin' => $values['updateuserinfoonlogin'],
'weautocreateusers' => $values['weautocreateusers'],
'theyautocreateusers' => $values['theyautocreateusers'],
'parent' => $values['parent'],
'authloginmsg' => $values['authloginmsg'],
'wessoout' => $values['wessoout'],
'theyssoin' => $values['theyssoin'],
'weimportcontent' => $values['weimportcontent'],
'wessoout' => 0,
'theyssoin' => 0,
'theyautocreateusers' => 0,
'weautocreateusers' => 0,
'updateuserinfoonlogin' => 0,
'weimportcontent' => 0,
);
if ($values['ssodirection'] == 'wessoout') {
self::$default_config['wessoout'] = 1;
self::$default_config['theyautocreateusers'] = $values['theyautocreateusers'];
}
else if ($values['ssodirection'] == 'theyssoin') {
self::$default_config['theyssoin'] = 1;
self::$default_config['updateuserinfoonlogin'] = $values['updateuserinfoonlogin'];
self::$default_config['weautocreateusers'] = $values['weautocreateusers'];
self::$default_config['weimportcontent'] = $values['weimportcontent'];
}
foreach(self::$default_config as $field => $value) {
$record = new stdClass();
$record->instance = $values['instance'];
......
......@@ -59,6 +59,7 @@ $string['theyssoin'] = 'They SSO in';
$string['authloginmsg'] = "Enter a message to display when a user tries to log in via Mahara's login form";
$string['application'] = 'Application';
$string['cantretrievekey'] = 'An error occurred while retrieving the public key from the remote server.<br>Please ensure that the Application and WWW Root fields are correct, and that networking is enabled on the remote host.';
$string['ssodirection'] = 'SSO direction';
$string['errorcertificateinvalidwwwroot'] = 'This certificate claims to be for %s, but you are trying to use it for %s.';
$string['errorcouldnotgeneratenewsslkey'] = 'Could not generate a new SSL key. Are you sure that both openssl and the PHP module for openssl are installed on this machine?';
......
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