require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/backup/lib.php');
- admin_externalpage_setup('reportbackups');
-
- admin_externalpage_print_header();
-
$courseid = optional_param('courseid', 0, PARAM_INT);
- require_capability('moodle/site:backup', get_context_instance(CONTEXT_SYSTEM));
+ admin_externalpage_setup('reportbackups');
+ admin_externalpage_print_header();
/// Scheduled backups are disabled by the server admin
if (!empty($CFG->disablescheduledbackups)) {
require_once($CFG->dirroot.'/lib/statslib.php');
require_once($CFG->libdir.'/adminlib.php');
- admin_externalpage_setup('reportcourseoverview');
-
- admin_externalpage_print_header();
-
$report = optional_param('report', STATS_REPORT_ACTIVE_COURSES, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$numcourses = optional_param('numcourses', 20, PARAM_INT);
- require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM)); // needed?
+ admin_externalpage_setup('reportcourseoverview');
+ admin_externalpage_print_header();
if (empty($CFG->enablestats)) {
redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
--- /dev/null
+<?php // $Id$
+$ADMIN->add('reports', new admin_externalpage('reportcourseoverview', get_string('courseoverview', 'admin'), "$CFG->wwwroot/$CFG->admin/report/courseoverview/index.php",'moodle/site:viewreports'));
+?>
\ No newline at end of file
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup('reportlog');
-
admin_externalpage_print_header();
--- /dev/null
+<?php // $Id$
+$ADMIN->add('reports', new admin_externalpage('reportlog', get_string('log', 'admin'), "$CFG->wwwroot/$CFG->admin/report/log/index.php",'moodle/site:viewreports'));
+?>
\ No newline at end of file
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/questionlib.php');
-// Check permissions.
-require_login();
-$systemcontext = get_context_instance(CONTEXT_SYSTEM);
-require_capability('moodle/site:viewreports', $systemcontext);
-
// Get URL parameters.
$requestedqtype = optional_param('qtype', '', PARAM_SAFEDIR);
-// Log.
-add_to_log(SITEID, "admin", "report questioninstances", "report/questioninstances/index.php?qtype=$requestedqtype", $requestedqtype);
-
-// Print the header.
+// Print the header & check permissions.
admin_externalpage_setup('reportquestioninstances');
admin_externalpage_print_header();
+// Log.
+add_to_log(SITEID, "admin", "report questioninstances", "report/questioninstances/index.php?qtype=$requestedqtype", $requestedqtype);
+
// Prepare the list of capabilites to choose from
$qtypechoices = array();
foreach ($QTYPES as $qtype) {
--- /dev/null
+<?php // $Id$
+$ADMIN->add('reports', new admin_externalpage('reportquestioninstances', get_string('questioninstances', 'report_questioninstances'), "$CFG->wwwroot/$CFG->admin/report/questioninstances/index.php", 'moodle/site:viewreports'));
+?>
\ No newline at end of file
require_once($CFG->libdir.'/adminlib.php');
- admin_externalpage_setup('reportstats');
-
- admin_externalpage_print_header();
-
-
$courseid = optional_param('course', SITEID, PARAM_INT);
$report = optional_param('report', 0, PARAM_INT);
$time = optional_param('time', 0, PARAM_INT);
$userid = optional_param('userid', 0, PARAM_INT);
$roleid = 0;
+ admin_externalpage_setup('reportstats');
+ admin_externalpage_print_header();
+
+ if (empty($CFG->enablestats)) {
+ redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
+ }
+
if ($report > 50) {
$roleid = substr($report,1);
$report = 5;
}
}
- require_login();
-
- if (empty($CFG->enablestats)) {
- redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=stats", get_string('mustenablestats', 'admin'), 3);
- }
-
- require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM));
-
add_to_log($course->id, "course", "report stats", "report/stats/index.php?course=$course->id", $course->id);
stats_check_uptodate($course->id);
<?php // $Id$
-if (!empty($CFG->enablestats)) {
- $ADMIN->add('reports', new admin_externalpage('reportstats', get_string('stats', 'admin'), "$CFG->wwwroot/$CFG->admin/report/stats/index.php",'moodle/site:viewreports'));
-}
+$ADMIN->add('reports', new admin_externalpage('reportstats', get_string('stats', 'admin'), "$CFG->wwwroot/$CFG->admin/report/stats/index.php",'moodle/site:viewreports'));
?>
\ No newline at end of file
--- /dev/null
+<?php // $Id$
+
+///////////////////////////////////////////////////////////////////////////
+// //
+// NOTICE OF COPYRIGHT //
+// //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment //
+// http://moodle.com //
+// //
+// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
+// //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details: //
+// //
+// http://www.gnu.org/copyleft/gpl.html //
+// //
+///////////////////////////////////////////////////////////////////////////
+
+$report_unittest_capabilities = array(
+
+ 'report/unittest:view' => array(
+ 'riskbitmask' => RISK_DATALOSS,
+ 'captype' => 'read',
+ 'contextlevel' => CONTEXT_SYSTEM,
+ 'legacy' => array(
+ 'admin' => CAP_ALLOW
+ ),
+
+ 'clonepermissionsfrom' => 'moodle/site:config',
+ )
+);
+
+?>
require_once('ex_simple_test.php');
require_once('ex_reporter.php');
-require_login();
-require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
-
$showpasses = optional_param('showpasses', 0, PARAM_BOOL);
$selected = optional_param('selected', array(), PARAM_INT);
+// Print the header and check access.
+admin_externalpage_setup('reportdbtest');
+admin_externalpage_print_header();
+
global $UNITTEST;
$UNITTEST = new object();
}
}
-// Print the header.
-admin_externalpage_setup('reportdbtest');
-admin_externalpage_print_header();
$dbinfos = array();
$tests = array();
require_once('ex_simple_test.php');
require_once('ex_reporter.php');
-require_login();
-require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
-
-$langfile = 'simpletest';
-$unittest = true;
-
// CGI arguments
$path = optional_param('path', null, PARAM_PATH);
$showpasses = optional_param('showpasses', false, PARAM_BOOL);
$droptesttables = optional_param('droptesttables', false, PARAM_BOOL);
$testtablesok = optional_param('testtablesok', false, PARAM_BOOL);
+admin_externalpage_setup('reportsimpletest');
+admin_externalpage_print_header();
+
+$langfile = 'simpletest';
+$unittest = true;
+
global $UNITTEST;
$UNITTEST = new object();
// Print the header.
-admin_externalpage_setup('reportsimpletest');
$strtitle = get_string('unittests', $langfile);
-admin_externalpage_print_header();
if ($testtablesok) {
print_heading(get_string('testtablesok', 'simpletest'));
<?php //$Id$
if ($hassiteconfig) {
- $ADMIN->add('development', new admin_externalpage('reportsimpletest', get_string('simpletest', 'admin'), "$CFG->wwwroot/$CFG->admin/report/unittest/index.php",'moodle/site:config'));
- $ADMIN->add('development', new admin_externalpage('reportdbtest', get_string('dbtest', 'admin'), "$CFG->wwwroot/$CFG->admin/report/unittest/dbtest.php",'moodle/site:config'));
+ $ADMIN->add('development', new admin_externalpage('reportsimpletest', get_string('simpletest', 'admin'), "$CFG->wwwroot/$CFG->admin/report/unittest/index.php",'report/unittest:view'));
+ $ADMIN->add('development', new admin_externalpage('reportdbtest', get_string('dbtest', 'admin'), "$CFG->wwwroot/$CFG->admin/report/unittest/dbtest.php",'report/unittest:view'));
}
?>
\ No newline at end of file
--- /dev/null
+<?PHP // $Id$
+
+///////////////////////////////////////////////////////////////////////////
+// //
+// NOTICE OF COPYRIGHT //
+// //
+// Moodle - Modular Object-Oriented Dynamic Learning Environment //
+// http://moodle.com //
+// //
+// Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
+// //
+// This program is free software; you can redistribute it and/or modify //
+// it under the terms of the GNU General Public License as published by //
+// the Free Software Foundation; either version 2 of the License, or //
+// (at your option) any later version. //
+// //
+// This program is distributed in the hope that it will be useful, //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
+// GNU General Public License for more details: //
+// //
+// http://www.gnu.org/copyleft/gpl.html //
+// //
+///////////////////////////////////////////////////////////////////////////
+
+$plugin->version = 2008112601;
+$plugin->requires = 2008112600;
+
+?>
--- /dev/null
+<?php //$Id$
+
+foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
+ $settings_path = "$CFG->dirroot/$CFG->admin/report/$plugin/settings.php";
+ if (file_exists($settings_path)) {
+ include($settings_path);
+ continue;
+ }
+
+ $index_path = "$CFG->dirroot/$CFG->admin/report/$plugin/index.php";
+ if (!file_exists($index_path)) {
+ continue;
+ }
+ // old style 3rd party plugin without settings.php
+ $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $plugin, $index_path, 'moodle/site:viewreports'));
+}
+
+?>
}
$ADMIN->add('root', new admin_category('users', get_string('users','admin')));
+ $ADMIN->add('users', new admin_category('authsettings', get_string('authentication','admin')));
+ $ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
+ $ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
$ADMIN->add('root', new admin_category('courses', get_string('courses','admin')));
$ADMIN->add('root', new admin_category('grades', get_string('grades')));
$ADMIN->add('root', new admin_category('location', get_string('location','admin')));
$ADMIN->add('root', new admin_category('mnet', get_string('net','mnet'), (isset($CFG->mnet_dispatcher_mode) and $CFG->mnet_dispatcher_mode === 'off')));
$ADMIN->add('root', new admin_category('reports', get_string('reports')));
$ADMIN->add('root', new admin_category('development', get_string('development', 'admin')));
+
// hidden unsupported category
$ADMIN->add('root', new admin_category('unsupported', get_string('unsupported', 'admin'), true));
+
// hidden search script
$ADMIN->add('root', new admin_externalpage('search', get_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true));
or has_capability('moodle/role:assign', $systemcontext)) { // speedup for non-admins, add all caps used on this page
- $ADMIN->add('users', new admin_category('authsettings', get_string('authentication','admin')));
-
$temp = new admin_settingpage('manageauths', get_string('authsettings', 'admin'));
$temp->add(new admin_setting_manageauths());
$temp->add(new admin_setting_heading('manageauthscommonheading', get_string('commonsettings', 'admin'), ''));
$securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
}
// stuff under the "accounts" subcategory
- $ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
$ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
$ADMIN->add('accounts', new admin_externalpage('userbulk', get_string('userbulk','admin'), "$CFG->wwwroot/$CFG->admin/user/user_bulk.php", array('moodle/user:update', 'moodle/user:delete')));
$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
// stuff under the "roles" subcategory
- $ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
// "userpolicies" settingpage
$temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
--- /dev/null
+<?PHP // $Id$
+
+$string['unittest:view'] = 'Execute unit tests';
+
+?>
} else {
$compparts = explode('/', $component);
- if ($compparts[0] == 'block') {
+ if ($compparts[0] == 'report') {
+ $defpath = $CFG->dirroot.'/'.$CFG->admin.'/report/'.$compparts[1].'/db/access.php';
+ $varprefix = $compparts[0].'_'.$compparts[1];
+
+ } else if ($compparts[0] == 'block') {
// Blocks are an exception. Blocks directory is 'blocks', and not
// 'block'. So we need to jump through hoops.
$defpath = $CFG->dirroot.'/'.$compparts[0].
$componentname = $components[0]; // choice
switch ($names[0]) {
+ case 'report':
+ $string = get_string($stringname, 'report_'.$componentname);
+ break;
+
case 'mod':
$string = get_string($stringname, $componentname);
break;
} else if (preg_match('|^local|', $component)) {
$langname = str_replace('/', '_', $component);
$string = get_string('local');
+ } else if (preg_match('|^report/|', $component)) {
+ $string = get_string('reports');
} else {
$string = get_string('coresystem');
}
$compsa = explode('/', $cap->component);
$compsb = explode('/', $comp);
-
+ // list of system reports
+ if (($compsa[0] == 'report') &&($compsb[0] == 'report')) {
+ return false;
+ }
// we are in gradebook, still
if (($compsa[0] == 'gradeexport' || $compsa[0] == 'gradeimport' || $compsa[0] == 'gradereport') &&
}
}
- // Add all the report plugings. Do this last so they can choose where in the tree
- // they want to be added.
- foreach (get_list_of_plugins($CFG->admin.'/report') as $plugin) {
- $settingsfile = "$CFG->dirroot/$CFG->admin/report/$plugin/settings.php";
- if (file_exists($settingsfile)) {
- include($settingsfile);
- } else {
- $reportname = get_string($plugin, 'report_' . $plugin);
- if ($reportname[1] == '[') {
- $reportname = get_string($plugin, 'admin');
- }
- $ADMIN->add('reports', new admin_externalpage('report'.$plugin, $reportname, "$CFG->wwwroot/$CFG->admin/report/$plugin/index.php",'moodle/site:viewreports'));
- }
- }
-
if (file_exists($CFG->dirroot.'/local/settings.php')) {
include_once($CFG->dirroot.'/local/settings.php');
}
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2008112400; // YYYYMMDD = date of the last version bump
+ $version = 2008112600; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 dev (Build: 20081126)'; // Human-friendly version name