mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 08:55:15 +02:00
mnet: Removed hardcoded English strings from some MNET files: MDL-8069
This commit is contained in:
parent
820aff13a4
commit
cd607643dc
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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">
|
||||
|
@ -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);
|
||||
}
|
||||
?>
|
||||
|
@ -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 @@
|
||||
<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 />
|
||||
|
@ -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();
|
||||
?>
|
@ -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
|
||||
|
@ -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).'">√</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).'">√</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).'">√</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).'">√</a> '; if (!empty($version['allhosts_subscribe'])) print_string("enabled_for_all",'mnet',!empty($version['I_subscribe'])); ?><br />
|
||||
<?php
|
||||
$breakstring = '. . . . . . . . . . . . . . . . . . . . . . . . <br>';
|
||||
endforeach;
|
||||
|
@ -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.
|
||||
|
@ -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')) {
|
||||
|
@ -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')) {
|
||||
|
@ -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';
|
||||
|
@ -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.';
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user