Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-24939 block mnet_hosts now displays error message if the dependen…

…cies test fails

The site must be switch at least to DEBUG_NORMAL level and
$CFG->debugdisplay must be turned on. It helps administrators to detect
the problems in their MNet setups.
  • Loading branch information...
commit 95840a8e7bda8288863d9b2433cc8f30394d7bdf 1 parent 0b5549d
@mudrd8mz mudrd8mz authored
View
37 blocks/mnet_hosts/block_mnet_hosts.php
@@ -29,18 +29,39 @@ function get_content() {
// remote users can't on-jump
// so don't show this block to them
if (is_mnet_remote_user($USER)) {
- return '';
+ if (debugging() and !empty($CFG->debugdisplay)) {
+ $this->content = new stdClass();
+ $this->content->footer = html_writer::tag('span',
+ get_string('error_localusersonly', 'block_mnet_hosts'),
+ array('class' => 'error'));
+ return $this->content;
+ } else {
+ return '';
+ }
}
if (!is_enabled_auth('mnet')) {
- // no need to query anything remote related
- debugging( 'mnet authentication plugin is not enabled', DEBUG_ALL );
- return '';
+ if (debugging() and !empty($CFG->debugdisplay)) {
+ $this->content = new stdClass();
+ $this->content->footer = html_writer::tag('span',
+ get_string('error_authmnetneeded', 'block_mnet_hosts'),
+ array('class' => 'error'));
+ return $this->content;
+ } else {
+ return '';
+ }
}
- // check for outgoing roaming permission first
if (!has_capability('moodle/site:mnetlogintoremote', get_context_instance(CONTEXT_SYSTEM), NULL, false)) {
- return '';
+ if (debugging() and !empty($CFG->debugdisplay)) {
+ $this->content = new stdClass();
+ $this->content->footer = html_writer::tag('span',
+ get_string('error_roamcapabilityneeded', 'block_mnet_hosts'),
+ array('class' => 'error'));
+ return $this->content;
+ } else {
+ return '';
+ }
}
if ($this->content !== NULL) {
@@ -81,7 +102,7 @@ function get_content() {
$hosts = $DB->get_records_sql($sql, array($CFG->mnet_localhost_id));
- $this->content = new stdClass;
+ $this->content = new stdClass();
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
@@ -104,5 +125,3 @@ function get_content() {
return $this->content;
}
}
-
-
View
3  blocks/mnet_hosts/lang/en/block_mnet_hosts.php
@@ -23,5 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['error_authmnetneeded'] = 'MNet authentication plugin must be enabled to see the list of MNet network servers';
+$string['error_localusersonly'] = 'Remote users can not jump to other MNet network servers from this host';
+$string['error_roamcapabilityneeded'] = 'Users need the capability \'Roam to a remote application via MNet\' to see the list of MNet network servers';
$string['pluginname'] = 'Network servers';
$string['server'] = 'Server';
View
6 blocks/mnet_hosts/version.php
@@ -15,4 +15,8 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
-$plugin->version = 2007101509;
+/**
+ * Network servers block version is defined in this file
+ */
+
+$plugin->version = 2010112900;
Please sign in to comment.
Something went wrong with that request. Please try again.