Ejemplo n.º 1
0
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Course Enrolment reports
 *
 * @package    local
 * @subpackage semesters
 * @copyright  2013 Vinodkumar <*****@*****.**>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/local/semesters/lib.php');
require_once($CFG->dirroot . '/local/lib.php');

global $CFG;
$mysemester = semesters::getInstance();
$systemcontext =context_system::instance();
//get the admin layout
$PAGE->set_pagelayout('admin');
//check the context level of the user and check weather the user is login to the system or not
$PAGE->set_context($systemcontext);

require_login();
if ($CFG->forcelogin) {
    require_login();
} else {
    user_accesstime_log();
}

$capabilities_array = $mysemester->semester_capabilities();
if (!has_any_capability($capabilities_array, $systemcontext)) {
Ejemplo n.º 2
0
 public static function getInstance() {
     if (!self::$_semester) {
         self::$_semester = new semesters();
     }
     return self::$_semester;
 }