Commit b7192af4 authored by Donal McMullan's avatar Donal McMullan

Allow roaming to non-canonical (promiscuous) remote hosts.

parent de4c4500
......@@ -284,8 +284,10 @@ function get_service_providers($instance) {
'.$dbprefix.'host h,
'.$dbprefix.'application a
WHERE
aic.value = ? AND
aic.field = \'parent\' AND
((aic.value = 1 AND
aic.field = \'theyautocreateusers\' ) OR
(aic.value = ? AND
aic.field = \'parent\')) AND
aic.instance = aic2.instance AND
aic2.field = \'wwwroot\' AND
......@@ -447,6 +449,9 @@ function get_peer($wwwroot) {
return $peers[$wwwroot];
}
/**
* Check that the signature has been signed by the remote host.
*/
function xmldsig_envelope_strip(&$xml) {
$signature = base64_decode($xml->Signature->SignatureValue);
......@@ -668,7 +673,7 @@ class OpenSslRepo {
}
/**
* Singelton function keeps us from generating multiple instances of this
* Singleton function keeps us from generating multiple instances of this
* class
*
* @return object The class instance
......
<h3>Auto-create users</h3>
<p>If a user jumps over to the remote site, will that site automatically create a new user record for our user?</p>
\ No newline at end of file
......@@ -58,7 +58,8 @@ class AuthXmlrpc extends Auth {
$this->config['xmlrpcserverurl'] = '';
$this->config['changepasswordurl'] = '';
$this->config['updateuserinfoonlogin'] = 1;
$this->config['autocreateusers'] = 0;
$this->config['weautocreateusers'] = 0;
$this->config['theyautocreateusers'] = 0;
$this->config['wessoout'] = 1;
$this->config['theyssoin'] = 0;
$this->config['parent'] = null;
......@@ -134,7 +135,7 @@ class AuthXmlrpc extends Auth {
$update = true;
}
} catch (Exception $e) {
if (!empty($this->config['autocreateusers'])) {
if (!empty($this->config['weautocreateusers'])) {
$user = new User;
$create = true;
} else {
......@@ -350,7 +351,8 @@ class PluginAuthXmlrpc extends PluginAuth {
'appname' => '',
'portno' => 80,
'updateuserinfoonlogin' => 0,
'autocreateusers' => 0,
'weautocreateusers' => 0,
'theyautocreateusers' => 0,
'wessoout' => 0,
'theyssoin' => 0,
'parent' => null
......@@ -547,13 +549,20 @@ class PluginAuthXmlrpc extends PluginAuth {
'help' => true
);
$elements['autocreateusers'] = array(
$elements['weautocreateusers'] = array(
'type' => 'checkbox',
'title' => get_string('autocreateusers', 'auth'),
'defaultvalue' => self::$default_config['autocreateusers'],
'title' => get_string('weautocreateusers', 'auth'),
'defaultvalue' => self::$default_config['weautocreateusers'],
'help' => true
);
$elements['theyautocreateusers'] = array(
'type' => 'checkbox',
'title' => get_string('theyautocreateusers', 'auth'),
'defaultvalue' => self::$default_config['theyautocreateusers'],
'help' => true
);
return array(
'elements' => $elements,
'renderer' => 'table'
......@@ -635,7 +644,8 @@ class PluginAuthXmlrpc extends PluginAuth {
self::$default_config = array( 'wwwroot' => $values['wwwroot'],
'updateuserinfoonlogin' => $values['updateuserinfoonlogin'],
'autocreateusers' => $values['autocreateusers'],
'weautocreateusers' => $values['weautocreateusers'],
'theyautocreateusers' => $values['theyautocreateusers'],
'parent' => $values['parent'],
'wessoout' => $values['wessoout'],
'theyssoin' => $values['theyssoin']
......
......@@ -47,7 +47,8 @@ $string['shortname'] = 'Short name for your site';
$string['name'] = 'Site name';
$string['nodataforinstance'] = 'Could not find data for auth instance ';
$string['authname'] = 'Authority name';
$string['autocreateusers'] = 'Auto-create users';
$string['weautocreateusers'] = 'We auto-create users';
$string['theyautocreateusers'] = 'They auto-create users';
$string['parent'] = 'Parent authority';
$string['wessoout'] = 'We SSO out';
$string['theyssoin'] = 'They SSO in';
......
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