Merge branch 'MDL-49198_master' of https://github.com/markn86/moodle

This commit is contained in:
Dan Poltawski 2015-02-23 16:29:24 +00:00
commit 4b525e7508
2 changed files with 8 additions and 0 deletions

View File

@ -157,6 +157,13 @@ class external_service_form extends moodleform {
$errors = parent::validation($data, $files);
// Add field validation check for duplicate name.
if (!empty($data['name'])) {
if ($DB->record_exists('external_services', array('name' => $data['name']))) {
$errors['name'] = get_string('nameexists', 'webservice');
}
}
// Add field validation check for duplicate shortname.
// Allow duplicated "empty" shortnames.
if (!empty($data['shortname'])) {

View File

@ -126,6 +126,7 @@ $string['missingusername'] = 'Missing username';
$string['missingversionfile'] = 'Coding error: version.php file is missing for the component {$a}';
$string['mobilewsdisabled'] = 'Disabled';
$string['mobilewsenabled'] = 'Enabled';
$string['nameexists'] = 'This name is already in use by another service';
$string['nocapabilitytouseparameter'] = 'The user does not have the required capability to use the parameter {$a}';
$string['nofunctions'] = 'This service has no functions.';
$string['norequiredcapability'] = 'No required capability';