$string['adminprimarynoedit'] = 'The primary admin cannot be edited by others';
+$string['authnotexisting'] = 'The autorization plugin doesn\'t exist';
$string['authorizeerror'] = 'Authorize error';
$string['blockdoesnotexist'] = 'This block does not exist';
$string['blockcannotinistantiate'] = 'Problem in instantiating block object';
$string['cannotaddcoursemoduletosection'] = 'Could not add the new course module to that section';
$string['cannotaddcmtosection'] = 'Could not add the new course module to that section';
$string['cannotaddrss'] = 'You do not have permission to add rss feeds';
+$string['cannotaddmembergroupiddoesntexist'] = 'Cannot add member group: the group id doesn\'t exist';
$string['cannotaddmodule'] = '$a module could not be added to the module list!';
$string['cannotaddnewmodule'] = 'Could not add a new module of $a';
$string['cannotaddnewinstance'] = 'Could not add a new instance of $a';
$string['confirmsesskeybad'] = 'Sorry, but your session key could not be confirmed to carry out this action. This security feature prevents against accidental or malicious execution of important functions in your name. Please make sure you really wanted to execute this function.';
$string['couldnotassignrole'] = 'A serious but unspecified error occurred while trying to assign a role to you';
$string['countriesphpempty'] = 'Error: The file countries.php in language pack $a is empty or missing.';
+$string['coursedoesntexistcannotcreategroup'] = 'Cannot create group: the course doesn\'t exist';
$string['coursegroupunknown'] = 'Course corresponding to group $a not specified';
$string['coursemisconf'] = 'Course is misconfigured';
$string['courserequestdisabled'] = 'Sorry, but requesting courses has been disabled by the administrator';
$string['generalexceptionmessage'] = 'Exception - $a';
$string['gradepubdisable'] = 'Grade publishing disabled';
$string['groupalready'] = 'User already belongs to group $a';
+$string['groupiddoesntexistcannotdelete'] = 'Cannot delete group: group id doesn\'t exist';
$string['groupexistforcourse'] = 'Group \"$a\" already exists for this course';
$string['groupnotaddederror'] = 'Group \"$a\" not added';
$string['groupunknown'] = 'Group $a not associated to specified course';
$string['urlnotdefinerss'] = 'URL not defined for RSS feed';
$string['userautherror'] = 'Unknown auth plugin';
$string['userauthunsupported'] = 'Auth plugin not supported here';
+$string['useriddoesntexist'] = 'User id doesn\'t exist';
$string['useremailduplicate'] = 'Duplicate address';
$string['usermustbemnet'] = 'Users in the MNET access control list must be remote MNET users';
$string['usernotaddedadmin'] = 'Cannot delete admin accounts';
$string['usernotaddederror'] = 'User not added - error';
$string['usernotaddedregistered'] = 'User not added - already registered';
$string['usernotavailable'] = 'The details of this user are not available to you';
+$string['usernotcreated'] = 'The user could not be created';
$string['usernotdeletederror'] = 'User not deleted - error';
$string['usernotdeletedmissing'] = 'User not deleted - could not find the username';
$string['usernotdeletedoff'] = 'User not deleted - deleting not allowed';
$string['wrongroleid'] = 'Incorrect role ID!';
$string['wrongsourcebase'] = 'Wrong source URL base';
$string['wrongzipfilename'] = 'Wrong ZIP file name';
+$string['wscouldnotaddgroupmembernopermission'] = 'WS - Could not add group member - No permission';
+$string['wscouldnotcreategroupnopermission'] = 'WS - Could not create group - No permission';
+$string['wscouldnotcreateeuserindb'] = 'WS - Could not create a user';
+$string['wscouldnotcreateeusernopermission'] = 'WS - Could not create a user - No permission';
+$string['wscouldnotdeletegroupnopermission'] = 'WS - Could not delete group - No permission';
+$string['wscouldnotdeletenoexistinguser'] = 'WS - Could not delete a user - User doesn\'t exist';
+$string['wscouldnotdeleteusernopermission'] = 'WS - Could not delete a user - No permission';
+$string['wscouldnotgetgroupnopermission'] = 'WS - Could not get group - No permission';
+$string['wscouldnotremovegroupmembernopermission'] = 'WS - Could not remove group member - No permission';
+$string['wscouldnotupdatenoexistinguser'] = 'WS - Could not update a user - User doesn\'t exist';
+$string['wscouldnotupdateuserindb'] = 'WS - Could not update a user';
+$string['wscouldnotupdateusernopermission'] = 'WS - Could not update a user - No permission';
+$string['wscouldnotvieweusernopermission'] = 'WS - Could not view a user - No permission';
$string['wwwrootmismatch'] = 'Incorrect access detected, this server may be accessed only through \"$a\" address, sorry.<br />Please notify server administrator.';
$string['wwwrootslash'] = 'Detected incorrect \$CFG->wwwroot in config.php, it must not contain trailing slash.<br />Please notify server administrator.';
$string['xmldberror'] = 'XMLDB error!';
return get_users(true, $params['search'], false, null, 'firstname ASC','', '', '', 1000, 'id, auth, confirmed, username, idnumber, firstname, lastname, email, emailstop, lang, theme, timezone, mailformat, city, description, country');
}
else {
- throw new moodle_exception('wscouldnotvieweuser');
+ throw new moodle_exception('wscouldnotvieweusernopermission');
}
}
return $userids;
}
else {
- throw new moodle_exception('wscouldnotcreateeuser');
+ throw new moodle_exception('wscouldnotcreateeusernopermission');
}
}
return $deletionsuccessfull;
}
else {
- throw new moodle_exception('wscouldnotdeleteuser');
+ throw new moodle_exception('wscouldnotdeleteusernopermission');
}
}
return $updatesuccessfull;
}
else {
- throw new moodle_exception('wscouldnotupdateuser');
+ throw new moodle_exception('wscouldnotupdateusernopermission');
}
}
$required = array('username','firstname','lastname','email', 'password');
foreach ($required as $req) {
if (!isset($user->{$req})) {
- throw new moodle_exception('missingerequiredfield');
+ throw new moodle_exception('missingrequiredfield');
}
}
$password = hash_internal_user_password($user->password);
} else {
//we could not update properly the newly created user, we need to delete it
$DB->delete_record('user',array('id' => $record->id));
- throw new moodle_exception('couldnotcreateuser');
+ throw new moodle_exception('usernotcreated');
}
}
- throw new moodle_exception('couldnotcreateuser');
+ throw new moodle_exception('usernotcreated');
}
/**
* Unit tests for (some of) user/external.php.
* WARNING: DO NOT RUN THIS TEST ON A PRODUCTION SITE
- * => DO NOT UNCOMMENT THESE TEST FUNCTIONS EXCEPT IF U R DEV
+ * => DO NOT UNCOMMENT THESE TEST FUNCTIONS EXCEPT IF YOU ARE DEVELOPER
* => NONE OF THESE TEST FUNCTIONS SHOULD BE UNCOMMENT BY DEFAULT
* => THESE TEST FUNCTIONS ARE DEPENDENT BETWEEEN EACH OTHER
- * => THE FUNCTION ORDER CAN NOT BE CHANGE
+ * => THE FUNCTION ORDER MUST NOT BE CHANGED
*
*
- * THESE TEST NEED TO BE RUN AS ADMIN!!!
+ * THIS TEST NEEDS TO BE RUN AS ADMIN!!!
* @author Jerome Mouneyrac
*/
$user = array();
$user['username'] = 'mockuserfortestingY';
$params[] = $user;
- $this->expectException(new moodle_exception('missingerequiredfield'));
+ $this->expectException(new moodle_exception('missingrequiredfield'));
$result = user_external::tmp_create_users($params);
}