Commit bdfa0433 authored by dongsheng's avatar dongsheng
Browse files

MDL-14129, creating error string

parent 8e9d88f2
......@@ -15,7 +15,7 @@
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
if (!$site = get_site()) {
print_error('nosite', '', '', NULL, true);
print_error('nosite', 'error');
}
/// Initialize variables.
......
......@@ -20,7 +20,7 @@ if (!extension_loaded('openssl')) {
if (!$site = get_site()) {
admin_externalpage_print_header();
print_error('nosite', '');
print_error('nosite', 'error');
}
if (!function_exists('curl_init') ) {
......@@ -82,7 +82,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
$temp_wwwroot = clean_param($form->wwwroot, PARAM_URL);
if ($temp_wwwroot !== $form->wwwroot) {
trigger_error("We now parse the wwwroot with PARAM_URL. Your URL will need to have a valid TLD, etc.");
print_error("invalidurl", 'mnet','peers.php');
print_error('invalidurl', 'mnet', 'peers.php');
exit;
}
unset($temp_wwwroot);
......@@ -103,7 +103,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
if (isset($form->public_key)) {
$form->public_key = clean_param($form->public_key, PARAM_PEM);
if (empty($form->public_key)) {
print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id);
print_error("invalidpubkey", 'mnet', 'peers.php?step=update&hostid='.$mnet_peer->id, '');
exit;
} else {
$oldkey = $mnet_peer->public_key;
......@@ -116,8 +116,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
foreach ($mnet_peer->error as $err) {
$errmsg .= $err['code'] . ': ' . $err['text'].'<br />';
}
error(get_string("invalidpubkey", 'mnet') . $errmsg ,'peers.php?step=update&amp;hostid='.$mnet_peer->id);
//print_error("invalidpubkey", 'mnet', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $errmsg);
print_error("invalidpubkey", 'mnet', 'peers.php?step=update&amp;hostid='.$mnet_peer->id, $errmsg);
exit;
}
}
......@@ -139,7 +138,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
if ($bool) {
redirect('peers.php?step=update&amp;hostid='.$mnet_peer->id, get_string('changessaved'));
} else {
print_error('Invalid action parameter.', '', 'index.php');
print_error('invalidaction', 'error', 'index.php');
}
}
}
......
......@@ -67,6 +67,7 @@ $string['groupnotaddederror'] = 'Group \"$a\" not added';
$string['groupunknown'] = 'Group $a not associated to specified course';
$string['guestnoeditprofile'] = 'The guest user cannot edit their profile';
$string['guestnoeditprofileother'] = 'The guest user profile cannot be edited';
$string['invalidaction'] = 'Invalid action parameter.';
$string['invalidaccessparameter'] = 'Invalid access parameter.';
$string['invalidcourse'] = 'Invalid course';
$string['invalidfieldname'] = '\"$a\" is not a valid field name';
......@@ -102,6 +103,7 @@ $string['nousers'] = 'No such user!';
$string['nonmeaningfulcontent'] = 'Non meaningful content';
$string['noparticipatorycms'] = 'Sorry, but you have no participatory course modules to report on.';
$string['nopermissions'] = 'Sorry, but you do not currently have permissions to do that ($a)';
$string['nosite'] = 'No sites';
$string['notavailable'] = 'That is not currently available';
$string['onlyadmins'] = 'Only administrators can do that.';
$string['onlyeditingteachers'] = 'Only editing teachers can do that.';
......
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