]> git.mjollnir.org Git - moodle.git/commitdiff
mnet: Removed hardcoded English strings from some MNET files: MDL-8069
authordonal72 <donal72>
Fri, 5 Jan 2007 05:58:39 +0000 (05:58 +0000)
committerdonal72 <donal72>
Fri, 5 Jan 2007 05:58:39 +0000 (05:58 +0000)
14 files changed:
admin/auth.php
admin/mnet/access_control.php
admin/mnet/delete.html
admin/mnet/delete.php
admin/mnet/index.php
admin/mnet/mnet_log.php [deleted file]
admin/mnet/mnet_review.html
admin/mnet/mnet_services.html
admin/mnet/mnet_services.php
admin/mnet/peers.php
admin/mnet/trustedhosts.php
lang/en_utf8/auth.php
lang/en_utf8/mnet.php
mnet/lib.php

index 2dba551f1ce7ba411ac5837f7163e63ea6787a0d..d1e16c0e3c0856faf639f214a21cba21cc29b78a 100644 (file)
@@ -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) {
index 046159ff3c5442aac6e040615cc9ecc626f04f31..2d86273d8f1b50422c8dc9d06591b9533252fc8b 100644 (file)
@@ -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;
index acc1ada05bed4b9babeca5480b36a6d9f63c65f0..d42352b296b9436e1d908b7d98528fe4f8d4b6e6 100644 (file)
@@ -11,13 +11,13 @@ print_heading(get_string('mnetsettings', 'mnet'));
             <td  class="generalboxcontent">
             <table cellpadding="9" cellspacing="0" >
                 <tr valign="top">
-                    <td colspan="2" class="header" cellpadding="0"><span>Deleting a Server</span></td>
+                    <td colspan="2" class="header" cellpadding="0"><span><?php print_string('deleteaserver', 'mnet'); ?>Deleting a Server</span></td>
                 </tr>
                 <?php
                 if (count($warn) > 0):
                 ?>
                 <tr valign="top">
-                    <td align="right" colspan="2">The following warnings were received:<br />
+                    <td align="right" colspan="2"><?php print_string('receivedwarnings','mnet'); ?>:<br />
                     <?php foreach($warn as $warning) echo $warning .'<br />'; ?>
                     </td>
                 </tr>
@@ -25,7 +25,7 @@ print_heading(get_string('mnetsettings', 'mnet'));
                 endif;
                 ?>
                 <tr valign="top">
-                    <td colspan="2">Are you sure you want to delete the server: "<?php echo $mnet_peer->name; ?>"?</td>
+                    <td colspan="2"><?php print_string('reallydeleteserver','mnet'); ?>: "<?php echo $mnet_peer->name; ?>"?</td>
                 </tr>
                 <tr valign="top">
                     <td width="80">
index 14c517b5e22280210960da2e811f61dbb5a9aa97..0904c70fefdf1628491544716b2ec47c90d08d14 100644 (file)
     $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);
     }
 ?>
index 735f87e98094fc9241d4d33be284a5a24a084fc1..53aa1f56818725755c2eba87f7e3f14933095ddc 100644 (file)
     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')) {
                     <td colspan="2" class="header" cellpadding="0"><?php print_string('aboutyourhost', 'mnet'); ?></td>
                 </tr>
                 <tr valign="top">
-                    <td align="right">Public Key:</td>
+                    <td align="right"><?php print_string('publickey', 'mnet'); ?>:</td>
                     <td><pre><?php echo $MNET->public_key; ?></pre></td>
                 </tr>
                 <tr valign="top">
-                    <td align="right">Networking:</td>
+                    <td align="right"><?php print_string('net', 'mnet'); ?>:</td>
                     <td><input type="hidden" name="sesskey" value="<?php echo $USER->sesskey ?>" />
                         <input type="radio" name="mode" value="off" <?php echo ("off" == $CFG->mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> <?php print_string('off', 'mnet'); ?> <br />
                         <input type="radio" name="mode" value="strict" <?php echo ("strict" == $CFG->mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> <?php print_string('on', 'mnet'); ?><br />
diff --git a/admin/mnet/mnet_log.php b/admin/mnet/mnet_log.php
deleted file mode 100644 (file)
index f80b880..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php 
-
-
-    require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
-    include_once($CFG->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",
-             '<a href="'.$CFG->wwwroot.'/admin/index.php">'.$stradministration.'</a> -> '.
-             '<a href="'.$CFG->wwwroot.'/admin/mnet/index.php">'.get_string('mnetsettings', 'mnet').'</a> -> '.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", ""); 
-
-?>
-
-<table cellpadding="9" cellspacing="0" >
-<tr>
-    <td align="left" valign="top" colspan="2">
-    Activity Logs
-    </td>
-</tr>
-
-<tr>
-    <td align="left" valign="top" colspan="2">
-    <div id="formElements"><input type="hidden" name="outer" value="4" /></div>
-    </td>
-</tr>
-
-<?php
-
-echo '    </table>';
-print_simple_box_end();
-print_simple_box_end();
-
-?>
-</form>
-
-<?php
-
-print_footer();
-?>
index 205272cae080dc14fd4e9051cc0c4f4c1495daff..d6da1beb18d4d452f8b810949fe5e303af397ab4 100644 (file)
@@ -89,8 +89,8 @@ if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0):
     <tr>
         <td align="right" valign="top" nowrap><?php print_string('deleted'); ?>:</td>
         <td valign="top">
-            <input type="radio" name="deleted" value="0" <?php echo ("off" == $CFG->mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> No - select this option to re-enable this server. <br />
-            <input type="radio" name="deleted" value="1" <?php echo ("strict" == $CFG->mnet_dispatcher_mode)? 'checked="true"' : '' ?> /> Yes<br />
+            <input type="radio" name="deleted" value="0" checked="true" /> <?php print_string('reenableserver','mnet'); ?><br />
+            <input type="radio" name="deleted" value="1"  /> <?php print_string('yes'); ?><br />
         </td>
     </tr>
 <?php
index e230f66aaec489fd8eca4a40092e9f7d0002a188..b1550459e2b42e515b157435cd9fc688a90b807d 100644 (file)
@@ -40,8 +40,8 @@ print_simple_box_start("center", "");
             echo $breakstring;
 ?>
     <input type="hidden" name="exists[<?php echo  $version['serviceid']; ?>]" value="1" />
-    <input type="checkbox" name="publish[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_publish']))? 'checked ': '' ; ?>/> Publish <?php echo $versionstring; if (!empty($version['hostsubscribes'])) echo '<a href="#" title="'.get_string('issubscribed','mnet', $mnet_peer->name).'">&radic;</a> '; if (!empty($version['allhosts_publish'])) print_string("enabled_for_all",'mnet',!empty($version['I_publish']));  ?><br />
-    <input type="checkbox" name="subscribe[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_subscribe']))? 'checked ': '' ; ?>/> Subscribe <?php echo $versionstring; if (!empty($version['hostpublishes'])) echo '<a href="#" title="'.get_string('ispublished','mnet', $mnet_peer->name).'">&radic;</a> '; if (!empty($version['allhosts_subscribe'])) print_string("enabled_for_all",'mnet',!empty($version['I_subscribe'])); ?><br />
+    <input type="checkbox" name="publish[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_publish']))? 'checked ': '' ; ?>/><?php print_string('publish','mnet'); ?><?php echo $versionstring; if (!empty($version['hostsubscribes'])) echo '<a href="#" title="'.get_string('issubscribed','mnet', $mnet_peer->name).'">&radic;</a> '; if (!empty($version['allhosts_publish'])) print_string("enabled_for_all",'mnet',!empty($version['I_publish']));  ?><br />
+    <input type="checkbox" name="subscribe[<?php echo $version['serviceid']; ?>]" <?php echo (!empty($version['I_subscribe']))? 'checked ': '' ; ?>/><?php print_string('subscribe','mnet'); ?><?php echo $versionstring; if (!empty($version['hostpublishes'])) echo '<a href="#" title="'.get_string('ispublished','mnet', $mnet_peer->name).'">&radic;</a> '; if (!empty($version['allhosts_subscribe'])) print_string("enabled_for_all",'mnet',!empty($version['I_subscribe'])); ?><br />
 <?php
             $breakstring = '. . . . . . . . . . . . . . . . . . . . . . . . <br>';
         endforeach;
index b90f43fbe7e5c0cd802ff882ac5a6c9d896ec1bf..eb56b333b4a6fa7401b4eb6e7be52b0e5a7f5d31 100644 (file)
@@ -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.
index 72027de171cc5460217d2ca153bf7f4684319930..a88d5df057f2efe893e972b00a344dd5244b92e5 100644 (file)
@@ -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')) {
index 1d903651af1227b2ea52a3dc2f397fa678125675..4e91d7dbaf6305a002663aefa53ada031e3a92b1 100644 (file)
@@ -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')) {
index d04204d1a60a391e87cf58f0d95e19ea5ffd0984..f8c3ffd694a7755cd6f66f8704195587f2e19e97 100644 (file)
@@ -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 <strong>\'$a\'</strong> and return fields <strong>username</strong> and <strong>password</strong>.<br />Be careful not to enter an incorrect URL as you may lock yourself out of this site.<br />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';
index bd799757bfc31b338c50a969bc7056f461c5d3f1..3476fb77f094fe7e6129c2e36beb6c3018e92591 100644 (file)
@@ -23,6 +23,29 @@ $string['trustedhostsexplain']          = 'Please enter a list of IP addresses o
                                           '192.168.0.0/0<br />'.
                                           '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.';
index 6ce50aa9782057ee61e54600452323aebe3390d0..d9e1c23a537d27ff9867e4c678eb4afc04dbd527 100644 (file)
@@ -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;
         }
     }