[moodle] / moodle / backup / backup.php Repository:

Diff of /moodle/backup/backup.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.48, Fri Apr 4 10:54:23 2008 WST revision 1.50, Wed Apr 23 09:53:30 2008 WST

By dongsheng:

MDL-14129, fix misuse string

# Line 18  Line 18 
18      if (!empty($id)) {      if (!empty($id)) {
19          require_login($id);          require_login($id);
20          if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $id))) {          if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $id))) {
21              print_error("You need to be a teacher or admin user to use this page.", '', "$CFG->wwwroot/login/index.php");              print_error('cannotuseadminadminorteacher', 'error', "$CFG->wwwroot/login/index.php");
22          }          }
23      } else {      } else {
24          require_login();          require_login();
25          if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {          if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM))) {
26              print_error("You need to be an admin user to use this page.", '', "$CFG->wwwroot/login/index.php");              print_error('cannotuseadmin', 'error', "$CFG->wwwroot/login/index.php");
27          }          }
28      }      }
29    
30      if (!empty($to)) {      if (!empty($to)) {
31          if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $to))) {          if (!has_capability('moodle/site:backup', get_context_instance(CONTEXT_COURSE, $to))) {
32              print_error("You need to be a teacher or admin user to use this page.", '', "$CFG->wwwroot/login/index.php");              print_error('cannotuseadminadminorteacher', 'error', "$CFG->wwwroot/login/index.php");
33          }          }
34      }      }
35    
36      //Check site      //Check site
37      if (!$site = get_site()) {      if (!$site = get_site()) {
38          print_error("Site not found!");          print_error("cannotfindsite");
39      }      }
40    
41      //Check necessary functions exists. Thanks to gregb@crowncollege.edu      //Check necessary functions exists. Thanks to gregb@crowncollege.edu
# Line 96  Line 96 
96    
97      //Get and check course      //Get and check course
98      if (! $course = get_record("course", "id", $id)) {      if (! $course = get_record("course", "id", $id)) {
99          print_error("Course ID was incorrect (can't find it)");          print_error('unknowncourseidnumber','error');
100      }      }
101    
102      //Print header      //Print header

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.50

Moodle CVS Admin
ViewVC Help
Powered by ViewVC 1.0.7