$string['cannotsaveconfig'] = 'Problem saving config \"$a[0]\" as \"$a[1]\" for plugin \"$a[2]\"';
$string['cannotsavecomment'] = 'Cannot save comment';
$string['cannotsavefile'] = 'Cannot save the file\"$a[0]\/$a[1]\"!';
+$string['cannotsaveagreement'] = 'Could not save your agreement';
$string['cannotcallscript'] = 'You cannot call this script in that way';
$string['cannotcreatebackupdir'] = 'Could not create backupdata folder. The site administrator needs to fix the file permissions';
$string['cannotcreatedefaultcat'] = 'Error creating a default category for context $a';
$string['cannotcreatetempdir'] = 'Cannot create temp dir.';
$string['cannotcreatesitedir'] = 'Cannot create site folder. The site administrator needs to fix the file permissions.';
$string['cannotcreateuploaddir'] = 'Cannot create upload folder. The site administrator needs to fix the file permissions';
+$string['cannotcreateuser'] = 'Error creating user record';
$string['cannotcreateorfindstructs'] = 'Error finding or creating section structures for this course';
$string['cannotcreatepopupwin'] = 'Undefined element - cannot create popup window.';
$string['cannotcustomizelocallang'] = 'You do not have permission to customize the strings translation. This permission is controlled by the capability "moodle/site:langeditlocal". Set this capability to allow you to edit local language packages in case you want to modify translations for your site.';
$string['cannoteditsiteform'] = 'You cannot edit the site course using this form';
$string['cannoteditpostorblog'] = 'You can not post or edit blogs.';
$string['cannoteditmasterlang'] = 'You do not have permission to edit master language package. This permission is controlled by the capability "moodle/site:langeditmaster". Set this capability to allow you to edit master language packages in case you are the maintainer of a package.';
+$string['cannotedityourprofile'] = 'Can not edit own profile, sorry.';
$string['cannotfindcomponent'] = 'Cannot find component.';
$string['cannotfindcontext'] = 'Could not find context';
$string['cannotfindcategory'] = 'Cannot find category record from database by ID - $a';
$string['cannotupdatemod'] = 'Could not update $a';
$string['cannotupdatemodcap'] = 'Could not update $a capabilities!';
$string['cannotupdateuser'] = 'updating user failed';
+$string['cannotupdateuseronexauth'] = 'Failed to update user data on external auth: $a. See the server logs for more details.';
+$strign['cannotupdatepasswordonextauth'] = 'Failed to update password on external auth: $a. See the server logs for more details.';
$string['cannotupdateplugincap'] = 'Could not update $a capabilities!';
+$string['cannotupdateprofile'] = 'Error updating user record';
$stirng['cannotupdaterss'] = 'Cannot update rss';
$string['cannotupdatesummary'] = 'Could not update the summary!';
$string['cannotupdatesubcate'] = 'Could not update a child category!';
$contents = optional_param('contents', array(), PARAM_RAW); // array of user notes
$states = optional_param('states', array(), PARAM_ALPHA); // array of notes states
if (! $course = $DB->get_record('course', array('id'=>$id))) {
- print_error("Course ID is incorrect");
+ print_error('invalidcourseid');
}
$context = get_context_instance(CONTEXT_COURSE, $id);
if (!empty($users) && confirm_sesskey()) {
if (count($users) != count($contents) || count($users) != count($states)) {
- print_error('Parameters malformation', '', $CFG->wwwroot.'/user/index.php?id='.$id);
+ print_error('invalidformdata', '', $CFG->wwwroot.'/user/index.php?id='.$id);
}
$note = new object();
$course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
if (!$course = $DB->get_record('course', array('id'=>$course))) {
- print_error('Course ID was incorrect');
+ print_error('invalidcourseid');
}
if ($course->id != SITEID) {
// The user profile we are editing
if (!$user = $DB->get_record('user', array('id'=>$userid))) {
- print_error('User ID was incorrect');
+ print_error('invaliduserid');
}
// Guest can not be edited
if ($user->id == $USER->id) {
//editing own profile - require_login() MUST NOT be used here, it would result in infinite loop!
if (!has_capability('moodle/user:editownprofile', $systemcontext)) {
- print_error('Can not edit own profile, sorry.');
+ print_error('cannotedityourprofile');
}
} else {
$usernew->timemodified = time();
if (!$DB->update_record('user', $usernew)) {
- print_error('Error updating user record');
+ print_error('cannotupdateprofile');
}
// pass a true $userold here
if (! $authplugin->user_update($user, $userform->get_data())) {
// auth update failed, rollback for moodle
$DB->update_record('user', $user);
- print_error('Failed to update user data on external auth: '.$user->auth.
- '. See the server logs for more details.');
+ print_error('cannotupdateprofile');
}
//update preferences
$course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site)
if (!$course = $DB->get_record('course', array('id'=>$course))) {
- print_error('Course ID was incorrect');
+ print_error('invalidcourseid');
}
require_login($course->id);
// editing existing user
require_capability('moodle/user:update', $systemcontext);
if (!$user = $DB->get_record('user', array('id'=>$id))) {
- print_error('User ID was incorrect');
+ print_error('invaliduserid');
}
}
$usernew->confirmed = 1;
$usernew->password = hash_internal_user_password($usernew->newpassword);
if (!$usernew->id = $DB->insert_record('user', $usernew)) {
- print_error('Error creating user record');
+ print_error('cannotcreateuser');
}
} else {
if (!$DB->update_record('user', $usernew)) {
- print_error('Error updating user record');
+ print_error('cannotupdateuser');
}
// pass a true $userold here
if (! $authplugin->user_update($user, $userform->get_data())) {
// auth update failed, rollback for moodle
$DB->update_record('user', $user);
- print_error('Failed to update user data on external auth: '.$user->auth.
- '. See the server logs for more details.');
+ print_error('cannotupdateuseronexauth', '', '', $user->auth);
}
//set new password if specified
if (!empty($usernew->newpassword)) {
if ($authplugin->can_change_password()) {
if (!$authplugin->user_update_password($usernew, $usernew->newpassword)){
- print_error('Failed to update password on external auth: ' . $usernew->auth .
- '. See the server logs for more details.');
+ print_error('cannotupdatepasswordonextauth', '', '', $usernew->auth);
}
}
}
$users = optional_param('userid', array(), PARAM_INT); // array of user id
if (! $course = $DB->get_record('course', array('id'=>$id))) {
- print_error("Course ID is incorrect");
+ print_error('invalidcourseid');
}
$context = get_context_instance(CONTEXT_COURSE, $id);
$today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today), 0, 0, 0);
if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
if (count($form->userid) != count($form->extendperiod) || count($form->userid) != count($form->extendbase)) {
- print_error('Parameters malformation', '', $CFG->wwwroot.'/user/index.php?id='.$id);
+ print_error('invalidformdata', '', $CFG->wwwroot.'/user/index.php?id='.$id);
}
foreach ($form->userid as $k => $v) {
$state = optional_param('state', '', PARAM_ALPHA); // note publish state
if (! $course = $DB->get_record('course', array('id'=>$id))) {
- print_error("Course ID is incorrect");
+ print_error('invalidcourseid');
}
$context = get_context_instance(CONTEXT_COURSE, $id);
$users = optional_param('userid', array(), PARAM_INT); // array of user id
if (! $course = $DB->get_record('course', array('id'=>$id))) {
- print_error("Course ID is incorrect");
+ print_error('invalidcourseid');
}
$context = get_context_instance(CONTEXT_COURSE, $id);
$deluser = optional_param('deluser',0,PARAM_INT);
if (!$course = $DB->get_record('course', array('id'=>$id))) {
- print_error("Invalid course id");
+ print_error('invalidcourseid');
}
require_login();
if ($agree and confirm_sesskey()) { // User has agreed
if (!isguestuser()) { // Don't remember guests
if (!$DB->set_field('user', 'policyagreed', 1, array('id'=>$USER->id))) {
- print_error('Could not save your agreement');
+ print_error('cannotsaveagreement');
}
}
$USER->policyagreed = 1;
$filterselect = clean_param($filterselect, PARAM_INT);
if (empty($currenttab) or empty($user) or empty($course)) {
- //print_error('You cannot call this script in that way');
+ //print_error('cannotcallscript');
}
if (($filtertype == 'site' && $filterselect) || ($filtertype=='user' && $filterselect)) {
}
if (! $user = $DB->get_record("user", array("id"=>$id))) {
- print_error("No such user in this course");
+ print_error('invaliduserid');
}
if (! $course = $DB->get_record("course", array("id"=>$course))) {
- print_error("No such course id");
+ print_error('invalidcourseid');
}
/// Make sure the current user is allowed to see this user