public function init() { global $PAGE; parent::init(); // Set up the page header. $PAGE->set_context(\CONTEXT_SYSTEM::instance()); $PAGE->set_title(get_string('apidiagnostics', 'mod_collaborate')); $PAGE->set_heading(get_string('apidiagnostics', 'mod_collaborate')); $PAGE->set_url('/mod/collaborate/testapi.php'); $renderer = $PAGE->get_renderer('mod_collaborate'); $this->testapiservice = new testapi_service($renderer); }
if (isset($notice['style'])) { notify($notice['message'], $notice['style']); } else { notify($notice['message']); } } unset($notice); ?> </div> <?php echo $OUTPUT->course_content_header(); echo $OUTPUT->main_content(); echo $OUTPUT->course_content_footer(); $context = CONTEXT_SYSTEM::instance(); echo '<ul id="dashboard-icons">'; $userroleshortname = array(); $userroleshort = $DB->get_records_sql("SELECT a.shortname FROM {role} a,{role_assignments} b,{context} c WHERE a.id=b.roleid and b.userid=$USER->id and b.contextid=c.id and c.contextlevel=10 ORDER BY b.id"); foreach($userroleshort as $rsn){ $userroleshortname[] = $rsn->shortname; } $out = ''; if (is_siteadmin()) { echo'<div class="icons_maindiv"> <div class="admin_header"><span>Admin Activities</span></div>'; echo '<ul class="icons_ul">'; $coursemgt = '<li>'.html_writer::link(new moodle_url('/course/edit.php?category=1&returnto=catmanage'), html_writer::empty_tag('img', array('src' => $CFG->wwwroot.'/theme/clean/pix/dashboard_icons/add_course_dashboard.png', 'title' => 'ADD COURSE', 'alt' => 'ADD COURSE'))).'Add Course</li>'; $coursemgt .= '<li>'.html_writer::link(new moodle_url('/course/draftcourses.php'), html_writer::empty_tag('img', array('src' => $CFG->wwwroot.'/theme/clean/pix/dashboard_icons/draft_course_dashboard.png', 'title' => 'DRAFT COURSE', 'alt' => 'DRAFT COURSE'))).'Draft Course</li>'; $coursemgt .= '<li>'.html_writer::link(new moodle_url('/course/activecourses.php'), html_writer::empty_tag('img', array('src' => $CFG->wwwroot.'/theme/clean/pix/dashboard_icons/available_courses_dashboard.png', 'title' => 'AVAILABLE COURSES', 'alt' => 'AVAILABLE COURSES'))).'Available Courses</li>';
$urltogo = $CFG->wwwroot; if ($CFG->wwwroot[strlen($CFG->wwwroot) - 1] != '/') { $urltogo .= '/'; } $err['login'] = $e->getMessage(); log_saml_error('Moodle SAML module:' . $err['login'], $pluginconfig->samllogfile); saml_error($err['login'], $urltogo, $pluginconfig->samllogfile); } // Now we close simpleSAMLphp session session_write_close(); // We load all moodle config and libs require_once '../../config.php'; require_once 'error.php'; global $CFG, $USER, $SAML_COURSE_INFO, $SESSION, $err, $DB, $PAGE; $PAGE->set_url('/auth/saml/index.php'); $PAGE->set_context(CONTEXT_SYSTEM::instance()); $urltogo = $CFG->wwwroot; if ($CFG->wwwroot[strlen($CFG->wwwroot) - 1] != '/') { $urltogo .= '/'; } // set return rul from wantsurl if (isset($_REQUEST['wantsurl'])) { $urltogo = $_REQUEST['wantsurl']; } // Get the plugin config for saml $pluginconfig = get_config('auth/saml'); if (!$valid_saml_session) { // Not valid session. Ship user off to Identity Provider unset($USER); try { $as = new SimpleSAML_Auth_Simple($saml_param->sp_source);