if (!$tables = $db->Metatables() ) { // No tables yet at all.
- print_error("no tables");
+ print_error('notables', 'debug');
}
print_simple_box_start('center');
}
if (!$admin = get_admin()) {
- print_error("No admins");
+ print_error('noadmins', 'error');
}
if (!$admin->country and $CFG->country) {
print_simple_box_start('center');
if (!db_replace($search, $replace)) {
- print_error('An error has occured during this process');
+ print_error('erroroccur', debug);
}
print_simple_box_end();
$confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($CFG->version < 2005042300) {
- print_error("This script does not work with this old version of Moodle");
+ print_error('doesnotworkwitholdversion', 'debug');
}
if (!$site = get_site()) {
$confirm = optional_param('confirm', 0, PARAM_BOOL);
if ($CFG->version < 2004013101) {
- print_error("This script does not work with this old version of Moodle");
+ print_error('doesnotworkwitholdversion', 'debug');
}
if (!$site = get_site()) {
require_capability('moodle/site:uploadusers', get_context_instance(CONTEXT_SYSTEM, SITEID));
if (!$site = get_site()) {
- print_error("Could not find site-level course");
+ print_error('cannotfindsite', 'error');
}
if (!$adminuser = get_admin()) {
- print_error("Could not find site admin");
+ print_error('noadmins', 'error');
}
$strfile = get_string('file');
}
if (!$columns = $cir->get_columns()) {
- print_error('Error reading temporary file', '', $returnurl);
+ print_error('cannotreadtmpfile', 'error', $returnurl);
}
$mform = new admin_uploaduser_form2(null, $columns);
// get initial date from form1
$site = get_site();
if (!has_capability('moodle/user:update', $sitecontext) and !has_capability('moodle/user:delete', $sitecontext)) {
- print_error('You do not have the required permission to edit/delete users.');
+ print_error('nopermissions', 'error', '', 'edit/delete users');
}
$stredit = get_string('edit');
if ($confirmuser and confirm_sesskey()) {
if (!$user = get_record('user', 'id', $confirmuser)) {
- print_error("No such user!");
+ print_error('nousers');
}
$auth = get_auth_plugin($user->auth);
} else if ($delete and confirm_sesskey()) { // Delete a selected user, after confirmation
if (!has_capability('moodle/user:delete', $sitecontext)) {
- print_error('You do not have the required permission to delete a user.');
+ print_error('nopermissions', 'error', '', 'delete a user');
}
if (!$user = get_record('user', 'id', $delete)) {
- print_error("No such user!");
+ print_error('nousers', 'error');
}
if (is_primary_admin($user->id)) {
- print_error("You are not allowed to delete the primary admin user!");
+ print_error('nopermissions', 'error', '', 'delete the primary admin user');
}
if ($confirm != md5($delete)) {
} else if ($acl and confirm_sesskey()) {
if (!has_capability('moodle/user:delete', $sitecontext)) {
// TODO: this should be under a separate capability
- print_error('You are not permitted to modify the MNET access control list.');
+ print_error('nopermissions', 'error', '', 'modify the NMET access control list');
}
if (!$user = get_record('user', 'id', $acl)) {
- print_error("No such user.");
+ print_error('nousers', 'error');
}
if (!is_mnet_remote_user($user)) {
- print_error('Users in the MNET access control list must be remote MNET users.');
+ print_error('usermustbemnet', 'error');
}
$accessctrl = strtolower(required_param('accessctrl', PARAM_ALPHA));
if ($accessctrl != 'allow' and $accessctrl != 'deny') {
- print_error('Invalid access parameter.');
+ print_error('invalidaccessparameter', 'error');
}
$aclrecord = get_record('mnet_sso_access_control', 'username', $user->username, 'mnet_host_id', $user->mnethostid);
if (empty($aclrecord)) {
$aclrecord->username = $user->username;
$aclrecord->accessctrl = $accessctrl;
if (!insert_record('mnet_sso_access_control', $aclrecord)) {
- print_error("Database error - Couldn't modify the MNET access control list.");
+ print_error('dbnotinsert', 'debug', '', 'the MNET access control list');
}
} else {
$aclrecord->accessctrl = $accessctrl;
if (!update_record('mnet_sso_access_control', $aclrecord)) {
- print_error("Database error - Couldn't modify the MNET access control list.");
+ print_error('dbnotupdate', 'debug', '', 'the MNET access control list');
}
}
$mnethosts = get_records('mnet_host', '', '', 'id', 'id,wwwroot,name');
$string['cannotupdaterelease'] = 'ERROR: Could not update release version in database!!';
$string['cannotsetupsite'] = 'Serious Error! Could not set up the site!';
$string['configmoodle'] = 'Moodle has not been configured yet. You need to edit config.php first.';
+$string['dbnotinsert'] = 'Database error - Cannot insert ($a)';
+$string['dbnotupdate'] = 'Database error - Cannot update ($a)'
$string['dbnotsupport'] = 'Error: Your database ($a) is not yet fully supported by Moodle or install.xml is not present. See the lib/db directory.';
$string['dbnotsetup'] = 'Error: Main databases NOT set up successfully';
+$string['doesnotworkwitholdversion'] = 'This script does not work with this old verion of moodle';
+$string['erroroccur'] = 'An error has occured during this process';
$string['fixsetting'] = 'Please fix your settings in config.php: <p>You have:</p> <p>\$CFG->dirroot = \"$a[0]\";</p> <p>but it should be:</p> <p>\$CFG->dirroot = \"$a[1]\"</p>';
+$string['notables'] = 'No Tables!';
$string['phpvaroff'] = 'The PHP server variable \'$a[0]\' should be Off - $a[1]';
$string['phpvaron'] = 'The PHP server variable \'$a[0]\' is not turned On - $a[1]';
$string['prefixcannotbeempty'] = 'Table prefix \"$a[0]\" cannot be empty for your target DB ($a[1])';
$string['cannotfindinfo'] = 'Cannot find info for: \"$a\"';
$string['cannotfindhelp'] = 'Cannot find \"$a\" language help files';
$string['cannotfindlang'] = 'Cannot find \"$a\" language pack!';
+$string['cannotfindsite'] = 'Cannot find site-level course';
+$string['cannotreadtmpfile'] = 'Error reading temporary file';
$string['cannotsavefile'] = 'Cannot save the file \"$a\".';
$string['cannotsavemd5file'] = 'Cannot save md5 file.';
$string['cannotsavezipfile'] = 'Cannot save ZIP file.';
$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['invalidaccessparameter'] = 'Invalid access parameter.';
$string['invalidcourse'] = 'Invalid course';
$string['invalidfieldname'] = '\"$a\" is not a valid field name';
$string['invalidfiletype'] = '\"$a\" is not a valid file type';
$string['nocontext'] = 'Sorry, but that course is not a valid context';
$string['noinstances'] = 'There are no instances of $a in this course!';
$string['nologinas'] = 'You are not allowed to login as that user';
+$string['noadmins'] = 'No administrators!';
+$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['userautherror'] = 'Unknown auth plugin.';
$string['userauthunsupported'] = 'Auth plugin not supported here.';
$string['useremailduplicate'] = 'Duplicate address';
+$string['usermustbemnet'] = 'Users in the MNET access control list must be remote MNET users.';
$string['usernotaddedadmin'] = 'Can not delete admin accounts.';
$string['usernotaddederror'] = 'User not added - error.';
$string['usernotaddedregistered'] = 'User not added - already registered.';