From 92e46c030529ebb5426d6b6cced9b8ee857f4c43 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 17 Jan 2007 22:23:56 +0000 Subject: [PATCH] mnet: better descriptions and warnings in admin pages --- admin/mnet/access_control.php | 24 +++++++++++++++++++++++- admin/mnet/peers.html | 4 ++++ auth/mnet/config.html | 4 ++++ enrol/mnet/config.html | 7 +++++++ lang/en_utf8/mnet.php | 23 ++++++++++++++++++----- 5 files changed, 56 insertions(+), 6 deletions(-) diff --git a/admin/mnet/access_control.php b/admin/mnet/access_control.php index 0d08c2a3a74..b2acb10b864 100644 --- a/admin/mnet/access_control.php +++ b/admin/mnet/access_control.php @@ -120,7 +120,29 @@ if ($form = data_submitted() and confirm_sesskey()) { exit; } - +// Explain +print_box(get_string('ssoacldescr','mnet')); +// Are the needed bits enabled? +$warn = ''; +if (empty($CFG->mnet_mode) || $CFG->mnet_mode !== 'strict') { + $warn = '

' . get_string('mnetdisabled','mnet') .'

'; +} +if (empty($CFG->auth_plugins_enabled)) { + $warn .= '

' . get_string('authmnetdisabled','mnet').'

'; +} else { + $auths = explode(',', $CFG->auth_plugins_enabled); + if (!in_array('mnet', $auths)) { + $warn .= '

' . get_string('authmnetdisabled','mnet').'

'; + } + unset($auths); +} +if (get_config('auth/mnet', 'auto_add_remote_users') != true) { + $warn .= '

' . get_string('authmnetautoadddisabled','mnet').'

'; +} +if (!empty($warn)) { + $warn = '

' . get_string('ssoaclneeds','mnet').'

' . $warn; + print_box($warn); +} // output the ACL table $columns = array("username", "mnet_host_id", "access", "delete"); $headings = array(); diff --git a/admin/mnet/peers.html b/admin/mnet/peers.html index 5578f8b4160..67326625f7b 100644 --- a/admin/mnet/peers.html +++ b/admin/mnet/peers.html @@ -1,5 +1,9 @@ mnet_mode) || $CFG->mnet_mode !== 'strict') { + print_box(get_string('mnetdisabled','mnet')); +} ?>
diff --git a/auth/mnet/config.html b/auth/mnet/config.html index f8728cac1d8..8e6930d7656 100644 --- a/auth/mnet/config.html +++ b/auth/mnet/config.html @@ -10,6 +10,10 @@ if (!isset ($config->auto_add_remote_users)) { $yesno = array(get_string('no'), get_string('yes')); +if (empty($CFG->mnet_mode) || $CFG->mnet_mode !== 'strict') { + print_box(get_string('mnetdisabled','mnet')); +} + ?> diff --git a/enrol/mnet/config.html b/enrol/mnet/config.html index c07ac73820c..90d53c6c77e 100644 --- a/enrol/mnet/config.html +++ b/enrol/mnet/config.html @@ -1,3 +1,10 @@ +mnet_mode) || $CFG->mnet_mode !== 'strict') { + print_box(get_string('mnetdisabled','mnet')); +} + +?>
diff --git a/lang/en_utf8/mnet.php b/lang/en_utf8/mnet.php index 1ddf54ec486..5d1f34d03e3 100644 --- a/lang/en_utf8/mnet.php +++ b/lang/en_utf8/mnet.php @@ -9,8 +9,15 @@ $string['settings'] = 'Settings'; $string['hostsettings'] = 'Host Settings'; $string['mnetpeers'] = 'Moodle network peers'; $string['mnetservices'] = 'Moodle network services'; -$string['trustedhosts'] = 'Trusted Hosts'; -$string['trustedhostsexplain'] = 'Please enter a list of IP addresses or networks, one on each line. Some examples:
'. +$string['trustedhosts'] = 'Trusted Hosts for XML-RPC'; +$string['trustedhostsexplain'] = '

The trusted hosts mechanism allows specific machines to + execute calls via XML-RPC to any part of the Moodle API. This + available for scripts to control Moodle behaviour and can be + a very dangerous option to enable. If in doubt, keep it off.

+

This is not needed for Moodle Networking.

+

To enable it, enter a list of IP addresses or networks, + one on each line. + Some examples:

'. 'Your local host:
'. '127.0.0.1
'. 'Your local host (with a network block):
'. @@ -21,7 +28,7 @@ $string['trustedhostsexplain'] = 'Please enter a list of IP addresses o '192.168.0.0/24
'. 'Any host whatsoever:
'. '192.168.0.0/0
'. - 'Obviously the last example is not a recommended configuration.'; + 'Obviously the last example is not a recommended configuration.'; $string['otherenrolledusers'] = 'Other enrolled users'; $string['hideremote'] = 'Hide remote users'; $string['showremote'] = 'Show remote users'; @@ -78,8 +85,9 @@ $string['testtrustedhostsexplain'] = 'Enter an IP address to see if it is a $string['forbidden-function'] = 'That function has not been enabled for RPC.'; $string['forbidden-transport'] = 'The transport method you are trying to use is not permitted.'; -$string['registerallhosts'] = 'Register all hosts'; -$string['registerallhostsexplain'] = 'You can choose to register all hosts that try to connect to you. This means that a record will appear in your hosts list for any '. +$string['registerallhosts'] = 'Register all hosts (Hub mode)'; +$string['registerallhostsexplain'] = 'You can choose to register all hosts that try to connect to you automatically. + This means that a record will appear in your hosts list for any '. 'Moodle site that connects to you and requests your public key.
'. 'You have the option below to configure services for \'All Hosts\' and by enabling some services there, you are able to provide '. 'services to any Moodle server indiscriminately.'; @@ -197,4 +205,9 @@ $string['authmnetdisabled'] = 'Moodle Networking authentication is disabled.'; $string['unknownerror'] = 'Unknown error occurred during negotiation.'; $string['nolocaluser'] = 'No local record exists for remote user.'; $string['databaseerror'] = 'Could not write details to the database.'; +$string['ssoacldescr'] = 'Use this page to grant/deny access to specific users from remote Moodle Network hosts. This is functional when you are offering SSO services to remote users. To control your local users\' ability to roam to other Moodle Network hosts, use the roles system to grant them the mnetcanroam capability.'; +$string['ssoaclneeds'] = 'For this functionality to work, you must have Moodle Networking On, plus the Moodle Network authentication plugin enabled with auto-add users enabled .'; +$string['mnetdisabled'] = 'Moodle Network is disabled.'; +$string['authmnetdisabled'] = 'Moodle Networking Authentication pluginis disabled.'; +$string['authmnetautoadddisabled'] = 'Auto-add users in Moodle Networking Authentication plugin is disabled.'; ?>