Пример #1
0
    $groups = $ac->get_user_groups();
    $status = $ac->has_confirmed($ac->user->id);
    if ($status == 0) {
        $dialog = $ac->get_tutor_access_dialog($ac->user->id, $groups);
        echo $dialog;
        die;
    }
    // Navigate directly to gradebook
    $groupid = $groups[0];
    $url = "http://" . $_SERVER['SERVER_NAME'] . "/lms/grade/report/grader/index.php?id=" . $ac->courseid . "&group={$groupid}";
    header("Location: {$url}");
}
if ($roleid == 5) {
    // Check student's access
    $groups = $ac->get_user_groups();
    $status = $ac->has_access($ac->user->id);
    if ($status == 0) {
        $dialog = $ac->get_acces_dialog($ac->user->id, $groups);
        echo $dialog;
        die;
    }
    // Navigate directly to course page section
    $pageid = $nav->get_page_id();
    if ($pageid != 0) {
        $url = "http://" . $_SERVER['SERVER_NAME'] . "/lms/mod/page/view.php?id=" . $pageid . "";
        header("Location: {$url}");
    }
}
echo $OUTPUT->header();
echo $OUTPUT->custom_block_region('content');
echo $OUTPUT->footer();
Пример #2
0
 public function effective_access()
 {
     $access = new Access();
     for ($i = count($this->access) - 1; $i >= 0; $i--) {
         $curr = $this->access[$i];
         if (!$access->has_access() && $curr->has_access()) {
             $access->set_access($curr->get_access());
         }
         if (!$access->has_final() && $curr->has_final()) {
             $access->set_final($curr->is_final());
         }
         if (!$access->has_abstract() && $curr->has_abstract()) {
             $access->set_abstract($curr->is_abstract());
         }
         if (!$access->has_static() && $curr->has_static()) {
             $access->set_static($curr->is_static());
         }
     }
     return $access;
 }