mnet MDL-21692 print an error when we can't contact the host when adding a new peer
This commit is contained in:
@@ -301,4 +301,5 @@ $string['importfields'] = 'Fields to import';
|
||||
$string['exportfields'] = 'Fields to export';
|
||||
$string['defaultfields'] = 'The globally set fields, which you are about to override, are: ';
|
||||
$string['leavedefault'] = 'Use the default settings instead';
|
||||
$string['noaddressforhost'] = 'Sorry, but that hostname ($a) could not be resolved!';
|
||||
?>
|
||||
|
||||
+1
-2
@@ -58,8 +58,7 @@ class mnet_peer {
|
||||
|
||||
// Couldn't find the IP address?
|
||||
if ($ip_address === $hostname && !preg_match('/^\d+\.\d+\.\d+.\d+$/',$hostname)) {
|
||||
$this->error[] = array('code' => 2, 'text' => get_string("noaddressforhost", 'mnet'));
|
||||
return false;
|
||||
throw new moodle_exception('noaddressforhost', 'mnet', '', $hostname);
|
||||
}
|
||||
|
||||
$this->name = $wwwroot;
|
||||
|
||||
Reference in New Issue
Block a user