MDL-14129, fix misuse string

This commit is contained in:
dongsheng 2008-04-23 01:53:30 +00:00
parent e31a98a6e1
commit a4f9dc75da
2 changed files with 5 additions and 3 deletions

View file

@ -18,18 +18,18 @@
if (!empty($id)) { if (!empty($id)) {
require_login($id); require_login($id);
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $id))) { if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $id))) {
print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php"); print_error('cannotuseadminadminorteacher', 'error', "$CFG->wwwroot/login/index.php");
} }
} else { } else {
require_login(); require_login();
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) { if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php"); print_error('cannotuseadmin', 'error', "$CFG->wwwroot/login/index.php");
} }
} }
if (!empty($to)) { if (!empty($to)) {
if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $to))) { if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $to))) {
print_error('cannotusepage', 'error', "$CFG->wwwroot/login/index.php"); print_error('cannotuseadminadminorteacher', 'error', "$CFG->wwwroot/login/index.php");
} }
} }

View file

@ -39,6 +39,8 @@ $string['cannotsetupcategory'] = 'Serious Error! Could not set up a default cour
$string['cannotsetupsite'] = 'Serious Error! Could not set up the site!'; $string['cannotsetupsite'] = 'Serious Error! Could not set up the site!';
$string['cannotunzipfile'] = 'Cannot unzip file.'; $string['cannotunzipfile'] = 'Cannot unzip file.';
$string['cannotupdaterole'] = 'Cannot update role!'; $string['cannotupdaterole'] = 'Cannot update role!';
$string['cannotuseadmin'] = 'You need to be an admin user to use this page.';
$string['cannotuseadminadminorteacher'] = 'You need to be a teacher or admin user to use this page.';
$string['cannotusepage'] = 'Only teacher and administrator can use this page.'; $string['cannotusepage'] = 'Only teacher and administrator can use this page.';
$string['cannotviewprofile'] = 'You can not view the profile of this user.'; $string['cannotviewprofile'] = 'You can not view the profile of this user.';
$string['cantunenrollfrommetacourse'] = 'You can not unenrol from this meta course.'; $string['cantunenrollfrommetacourse'] = 'You can not unenrol from this meta course.';