From: donal72 Date: Fri, 5 Jan 2007 05:58:39 +0000 (+0000) Subject: mnet: Removed hardcoded English strings from some MNET files: MDL-8069 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cd607643dc05d5cd34b95976bb777dab34506027;p=moodle.git mnet: Removed hardcoded English strings from some MNET files: MDL-8069 --- diff --git a/admin/auth.php b/admin/auth.php index 2dba551f1c..d1e16c0e3c 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -72,7 +72,7 @@ switch ($params->action) { case 'enable': // check auth plugin is valid first if (!exists_auth_plugin($params->auth)) { - error("Authentication plugin '{$params->auth}' is not installed.", $url); + error(get_string('pluginnotinstalled', 'auth', $params->auth), $url); } // add to enabled list if (!array_search($params->auth, $authsenabled)) { @@ -86,7 +86,7 @@ switch ($params->action) { $key = array_search($params->auth, $authsenabled); // check auth plugin is valid if ($key === false) { - error("Authentication plugin '{$params->auth}' is not enabled.", $url); + error(get_string('pluginnotenabled', 'auth', $params->auth), $url); } // move down the list if ($key < (count($authsenabled) - 1)) { @@ -101,7 +101,7 @@ switch ($params->action) { $key = array_search($params->auth, $authsenabled); // check auth is valid if ($key === false) { - error("Authentication plugin '{$params->auth}' is not enabled.", $url); + error(get_string('pluginnotenabled', 'auth', $params->auth), $url); } // move up the list if ($key >= 1) { diff --git a/admin/mnet/access_control.php b/admin/mnet/access_control.php index 046159ff3c..2d86273d8f 100644 --- a/admin/mnet/access_control.php +++ b/admin/mnet/access_control.php @@ -39,20 +39,20 @@ if (!empty($action) and confirm_sesskey()) { // boot if insufficient permission if (!has_capability('moodle/user:delete', $sitecontext)) { - error('You are not permitted to modify the MNET access control list.'); + error(get_string('nomodifyacl','mnet')); } // fetch the record in question $id = required_param('id', PARAM_INT); if (!$idrec = get_record('mnet_sso_access_control', 'id', $id)) { - error('Record does not exist.', '/admin/mnet/access_control.php'); + error(get_string('recordnoexists','mnet'), '/admin/mnet/access_control.php'); } switch ($action) { case "delete": delete_records('mnet_sso_access_control', 'id', $id); - notify("SSO ACL: delete record for user '{$idrec->username}' from {$mnethosts[$idrec->mnet_host_id]}."); + notify(get_string('deleteuserrecord', 'mnet', array($idrec->username, $mnethosts[$idrec->mnet_host_id]))); break; case "acl": @@ -60,16 +60,16 @@ if (!empty($action) and confirm_sesskey()) { // require the access parameter, and it must be 'allow' or 'deny' $access = trim(strtolower(required_param('access', PARAM_ALPHA))); if ($access != 'allow' and $access != 'deny') { - error('Invalid access parameter.', '/admin/mnet/access_control.php'); + error(get_string('invalidaccessparam', 'mnet') , '/admin/mnet/access_control.php'); } if (mnet_update_sso_access_control($idrec->username, $idrec->mnet_host_id, $access)) { - notify("SSO ACL: $access user '{$idrec->username}' from {$mnethosts[$idrec->mnet_host_id]}"); + notify(get_string('ssoacl', 'mnet', array($access, $idrec->username, $mnethosts[$idrec->mnet_host_id]))); } break; default: - error('Invalid action parameter.', '/admin/mnet/access_control.php'); + error(get_string('invalidactionparam', 'mnet'), '/admin/mnet/access_control.php'); } redirect('access_control.php', get_string('changessaved')); } @@ -81,16 +81,16 @@ if ($form = data_submitted() and confirm_sesskey()) { // check permissions and verify form input if (!has_capability('moodle/user:delete', $sitecontext)) { - error('You are not permitted to modify the MNET access control list.', '/admin/mnet/access_control.php'); + error(get_string('nomodifyacl','mnet'), '/admin/mnet/access_control.php'); } if (empty($form->username)) { - $formerror['username'] = 'Please enter a username, or a list of usernames separated by commas.'; + $formerror['username'] = get_string('enterausername','mnet'); } if (empty($form->mnet_host_id)) { - $formerror['mnet_host_id'] = 'Please select a remote Moodle host.'; + $formerror['mnet_host_id'] = get_string('selectahost','mnet'); } if (empty($form->access)) { - $formerror['access'] = 'Please select an access level from the list.'; + $formerror['access'] = get_string('selectaccesslevel','mnet'); ; } // process if there are no errors @@ -136,7 +136,7 @@ $acl = get_records('mnet_sso_access_control', '', '', "$sort $dir", '*'); //, $p $aclcount = count_records('mnet_sso_access_control'); if (!$acl) { - print_heading('No entries in the SSO access control list'); + print_heading(get_string('noaclentries','mnet')); $table = NULL; } else { $table->head = $headings; diff --git a/admin/mnet/delete.html b/admin/mnet/delete.html index acc1ada05b..d42352b296 100644 --- a/admin/mnet/delete.html +++ b/admin/mnet/delete.html @@ -11,13 +11,13 @@ print_heading(get_string('mnetsettings', 'mnet')); - + 0): ?> - @@ -25,7 +25,7 @@ print_heading(get_string('mnetsettings', 'mnet')); endif; ?> - + - + - +
Deleting a ServerDeleting a Server
The following warnings were received:
+
:
'; ?>
Are you sure you want to delete the server: "name; ?>"?: "name; ?>"?
diff --git a/admin/mnet/delete.php b/admin/mnet/delete.php index 14c517b5e2..0904c70fef 100644 --- a/admin/mnet/delete.php +++ b/admin/mnet/delete.php @@ -10,16 +10,12 @@ $strmnetedithost = get_string('reviewhostdetails', 'mnet'); require_login(); - if (!isadmin()) { - error('Only administrators can use this page!'); - } - $context = get_context_instance(CONTEXT_SYSTEM, SITEID); require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions"); if (!$site = get_site()) { - error('Site isn\'t defined!'); + error(get_string('nosite','mnet')); } /// Initialize variables. @@ -32,7 +28,7 @@ $warn = array(); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - redirect('index.php', "The delete function requires a POST request.",7); + redirect('index.php', get_string('postrequired','mnet') ,7); } if ('verify' == $step) { @@ -47,6 +43,6 @@ $mnet_peer = new mnet_peer(); $mnet_peer->set_id($hostid); $mnet_peer->delete(); - redirect('peers.php', 'Ok - host deleted', 5); + redirect('peers.php', get_string('hostdeleted', 'mnet'), 5); } ?> diff --git a/admin/mnet/index.php b/admin/mnet/index.php index 735f87e980..53aa1f5681 100644 --- a/admin/mnet/index.php +++ b/admin/mnet/index.php @@ -15,11 +15,11 @@ require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions"); if (!$site = get_site()) { - error('Site isn\'t defined!'); + error(get_string('nosite','mnet')); } if (!function_exists('curl_init') ) { - error('PHP Curl library is not installed'); + error(get_string('nocurl','mnet')); } if (!extension_loaded('openssl')) { @@ -93,11 +93,11 @@
Public Key::
public_key; ?>
Networking:: mnet_dispatcher_mode)? 'checked="true"' : '' ?> />
mnet_dispatcher_mode)? 'checked="true"' : '' ?> />
diff --git a/admin/mnet/mnet_log.php b/admin/mnet/mnet_log.php deleted file mode 100644 index f80b880ce9..0000000000 --- a/admin/mnet/mnet_log.php +++ /dev/null @@ -1,63 +0,0 @@ -dirroot.'/mnet/lib.php'); - - require_login(); - - if (!isadmin()) { - error('Only administrators can use this page!'); - } - - if (!$site = get_site()) { - error('Site isn\'t defined!'); - } - $hostid = optional_param('hostid', NULL, PARAM_INT); - $stradministration = get_string('administration'); - $strconfiguration = get_string('configuration'); - $strmnetsettings = get_string('mnetsettings', 'mnet'); - $strmnetservices = get_string('mnetservices', 'mnet'); - $strmnetlog = get_string('mnetlog', 'mnet'); - $strmnetedithost = get_string('reviewhostdetails', 'mnet'); - $strmneteditservices = get_string('reviewhostservices', 'mnet'); - -print_header("$site->shortname: $strmnetsettings", "$site->fullname", - ''.$stradministration.' -> '. - ''.get_string('mnetsettings', 'mnet').' -> '.get_string('hostsettings', 'mnet')); - -print_heading(get_string('mnetsettings', 'mnet')); -$tabs[] = new tabobject('mnetdetails', 'index.php?step=update&hostid='.$hostid, $strmnetedithost, $strmnetedithost, false); -$tabs[] = new tabobject('mnetservices', 'mnet_services.php?step=list&hostid='.$hostid, $strmnetservices, $strmnetservices, false); -$tabs[] = new tabobject('mnetlog', 'mnet_log.php?step=list&hostid='.$hostid, $strmnetlog, $strmnetlog, false); -print_tabs(array($tabs), 'mnetlog'); -print_simple_box_start("center", ""); - -?> - - - - - - - - - - -'; -print_simple_box_end(); -print_simple_box_end(); - -?> - - - diff --git a/admin/mnet/mnet_review.html b/admin/mnet/mnet_review.html index 205272cae0..d6da1beb18 100644 --- a/admin/mnet/mnet_review.html +++ b/admin/mnet/mnet_review.html @@ -89,8 +89,8 @@ if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0): - /> Publish name).'">√ '; if (!empty($version['allhosts_publish'])) print_string("enabled_for_all",'mnet',!empty($version['I_publish'])); ?>
- /> Subscribe name).'">√ '; if (!empty($version['allhosts_subscribe'])) print_string("enabled_for_all",'mnet',!empty($version['I_subscribe'])); ?>
+ />name).'">√ '; if (!empty($version['allhosts_publish'])) print_string("enabled_for_all",'mnet',!empty($version['I_publish'])); ?>
+ />name).'">√ '; if (!empty($version['allhosts_subscribe'])) print_string("enabled_for_all",'mnet',!empty($version['I_subscribe'])); ?>
'; endforeach; diff --git a/admin/mnet/mnet_services.php b/admin/mnet/mnet_services.php index b90f43fbe7..eb56b333b4 100644 --- a/admin/mnet/mnet_services.php +++ b/admin/mnet/mnet_services.php @@ -14,7 +14,7 @@ require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions"); if (!$site = get_site()) { - error('Site isn\'t defined!'); + error(get_string('nosite','mnet')); } /// Initialize variables. diff --git a/admin/mnet/peers.php b/admin/mnet/peers.php index 72027de171..a88d5df057 100644 --- a/admin/mnet/peers.php +++ b/admin/mnet/peers.php @@ -15,11 +15,11 @@ $context = get_context_instance(CONTEXT_SYSTEM, SITEID); require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions"); if (!$site = get_site()) { - error('Site isn\'t defined!'); + error(get_string('nosite','mnet')); } if (!function_exists('curl_init') ) { - error('PHP Curl library is not installed'); + error(get_string('nocurl','mnet')); } if (!extension_loaded('openssl')) { diff --git a/admin/mnet/trustedhosts.php b/admin/mnet/trustedhosts.php index 1d903651af..4e91d7dbaf 100644 --- a/admin/mnet/trustedhosts.php +++ b/admin/mnet/trustedhosts.php @@ -14,7 +14,7 @@ require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions"); if (!$site = get_site()) { - error('Site isn\'t defined!'); + error(get_string('nosite','mnet')); } if (!extension_loaded('openssl')) { diff --git a/lang/en_utf8/auth.php b/lang/en_utf8/auth.php index d04204d1a6..f8c3ffd694 100644 --- a/lang/en_utf8/auth.php +++ b/lang/en_utf8/auth.php @@ -5,6 +5,9 @@ $string['alternatelogin'] = 'If you enter a URL here, it will be used as the login page for this site. The page should contain a form which has the action property set to \'$a\' and return fields username and password.
Be careful not to enter an incorrect URL as you may lock yourself out of this site.
Leave this setting blank to use the default login page.'; $string['alternateloginurl'] = 'Alternate Login URL'; +$string['pluginnotenabled'] = 'Authentication plugin \'$a\' is not enabled.'; +$string['pluginnotinstalled'] = 'Authentication plugin \'$a\' is not installed.'; + // CAS plugin $string['auth_cas_logincas'] = 'Secure connection access'; $string['auth_cas_invalidcaslogin'] = 'Sorry, your login has failed - you could not be authorised'; diff --git a/lang/en_utf8/mnet.php b/lang/en_utf8/mnet.php index bd799757bf..3476fb77f0 100644 --- a/lang/en_utf8/mnet.php +++ b/lang/en_utf8/mnet.php @@ -23,6 +23,29 @@ $string['trustedhostsexplain'] = 'Please enter a list of IP addresses o '192.168.0.0/0
'. 'Obviously the last example is not a recommended configuration.'; +$string['nomodifyacl'] = 'You are not permitted to modify the MNET access control list.'; +$string['recordnoexists'] = 'Record does not exist.'; +$string['enterausername'] = 'Please enter a username, or a list of usernames separated by commas.'; +$string['selectahost'] = 'Please select a remote Moodle host.'; +$string['selectaccesslevel'] = 'Please select an access level from the list.'; +$string['noaclentries'] = 'No entries in the SSO access control list'; +$string['deleteaserver'] = 'Deleting a Server'; +$string['nosite'] = 'Could not find site-level course'; +$string['postrequired'] = 'The delete function requires a POST request.'; +$string['hostdeleted'] = 'Ok - host deleted'; +$string['reenableserver'] = 'No - select this option to re-enable this server.'; +$string['nocurl'] = 'PHP Curl library is not installed'; +$string['publish'] = 'Publish'; +$string['subscribe'] = 'Subscribe'; +$string['failedaclwrite'] = 'Failed to write to the MNET access control list for user \'$a\'.'; + +$string['receivedwarnings'] = 'The following warnings were received'; +$string['reallydeleteserver'] = 'Are you sure you want to delete the server'; + +$string['deleteuserrecord'] = 'SSO ACL: delete record for user \'$a[0]\' from $a[1].'; +$string['invalidaccessparam'] = 'Invalid access parameter.'; +$string['invalidactionparam'] = 'Invalid action parameter.'; +$string['ssoacl'] = 'SSO ACL: $a[0] user \'$a[1]\' from $a[2]'; $string['currentkey'] = 'Current Public Key'; $string['keymismatch'] = 'The public key you are holding for this host is different from the public key it is currently publishing.'; $string['invalidurl'] = 'Invalid URL parameter.'; diff --git a/mnet/lib.php b/mnet/lib.php index 6ce50aa978..d9e1c23a53 100644 --- a/mnet/lib.php +++ b/mnet/lib.php @@ -469,7 +469,7 @@ function mnet_update_sso_access_control($username, $mnet_host_id, $access) { add_to_log(SITEID, 'admin/mnet', 'update', 'admin/mnet/access_control.php', "SSO ACL: $access user '$username' from {$mnethost->name}"); } else { - error("Failed to write to the MNET access control list for user '$username'."); + error(get_string('failedaclwrite','mnet', $username)); return false; } } else { @@ -481,7 +481,7 @@ function mnet_update_sso_access_control($username, $mnet_host_id, $access) { add_to_log(SITEID, 'admin/mnet', 'add', 'admin/mnet/access_control.php', "SSO ACL: $access user '$username' from {$mnethost->name}"); } else { - error("Failed to write to the MNET access control list for user '$username'."); + error(get_string('failedaclwrite','mnet', $username)); return false; } }
- Activity Logs -
-
-
: - mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> No - select this option to re-enable this server.
- mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> Yes
+
+