Commit d784c10b authored by Donal McMullan's avatar Donal McMullan
Browse files

Revert "Remove trailing slash(es) from wwwroot"

This reverts commit b73b6621.
parent b73b6621
...@@ -47,7 +47,7 @@ class AuthXmlrpc extends Auth { ...@@ -47,7 +47,7 @@ class AuthXmlrpc extends Auth {
*/ */
public function __construct($id = null) { public function __construct($id = null) {
$this->has_config = true; $this->has_instance_config = true;
$this->type = 'xmlrpc'; $this->type = 'xmlrpc';
$this->config['wwwroot'] = ''; $this->config['wwwroot'] = '';
...@@ -359,10 +359,18 @@ class PluginAuthXmlrpc extends PluginAuth { ...@@ -359,10 +359,18 @@ class PluginAuthXmlrpc extends PluginAuth {
); );
public static function has_config() { public static function has_config() {
return false;
}
public static function get_config_options() {
return array();
}
public static function has_instance_config() {
return true; return true;
} }
public static function get_config_options($institution, $instance = 0) { public static function get_instance_config_options($institution, $instance = 0) {
$peer = new Peer(); $peer = new Peer();
...@@ -507,13 +515,22 @@ class PluginAuthXmlrpc extends PluginAuth { ...@@ -507,13 +515,22 @@ class PluginAuthXmlrpc extends PluginAuth {
'help' => true 'help' => true
); );
/**
* empty($peer->appname) would ALWAYS return true, because the property doesn't really
* exist. When we try to get $peer->appname, we're actually calling the peer class's
* __get overloader. Unfortunately, the 'empty' function seems to just check for the
* existence of the property - it doesn't call the overloader. Bug or feature?
*/
$tmpappname = $peer->appname;
$elements['appname'] = array( $elements['appname'] = array(
'type' => 'select', 'type' => 'select',
'title' => get_string('application','auth'), 'title' => get_string('application','auth'),
'collapseifoneoption' => true, 'collapseifoneoption' => true,
'multiple' => false, 'multiple' => false,
'options' => $apparray, 'options' => $apparray,
'defaultvalue' => empty($peer->appname)? key($apparray) : $peer->appname, 'defaultvalue' => empty($tmpappname)? key($apparray) : $tmpappname,
'help' => true 'help' => true
); );
...@@ -612,7 +629,7 @@ class PluginAuthXmlrpc extends PluginAuth { ...@@ -612,7 +629,7 @@ class PluginAuthXmlrpc extends PluginAuth {
} }
} }
$peer->wwwroot = preg_replace("|\/+$|", "", $values['wwwroot']); $peer->wwwroot = $values['wwwroot'];
$peer->name = $values['name']; $peer->name = $values['name'];
$peer->deleted = $values['deleted']; $peer->deleted = $values['deleted'];
$peer->portno = $values['portno']; $peer->portno = $values['portno'];
......
Supports Markdown
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