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

Remove trailing slash(es) from wwwroot

parent 08b781e4
......@@ -47,7 +47,7 @@ class AuthXmlrpc extends Auth {
*/
public function __construct($id = null) {
$this->has_instance_config = true;
$this->has_config = true;
$this->type = 'xmlrpc';
$this->config['wwwroot'] = '';
......@@ -359,18 +359,10 @@ class PluginAuthXmlrpc extends PluginAuth {
);
public static function has_config() {
return false;
}
public static function get_config_options() {
return array();
}
public static function has_instance_config() {
return true;
}
public static function get_instance_config_options($institution, $instance = 0) {
public static function get_config_options($institution, $instance = 0) {
$peer = new Peer();
......@@ -515,22 +507,13 @@ class PluginAuthXmlrpc extends PluginAuth {
'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(
'type' => 'select',
'title' => get_string('application','auth'),
'collapseifoneoption' => true,
'multiple' => false,
'options' => $apparray,
'defaultvalue' => empty($tmpappname)? key($apparray) : $tmpappname,
'defaultvalue' => empty($peer->appname)? key($apparray) : $peer->appname,
'help' => true
);
......@@ -629,7 +612,7 @@ class PluginAuthXmlrpc extends PluginAuth {
}
}
$peer->wwwroot = $values['wwwroot'];
$peer->wwwroot = preg_replace("|\/+$|", "", $values['wwwroot']);
$peer->name = $values['name'];
$peer->deleted = $values['deleted'];
$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