forked from maellak/openeclass
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent_view.php
More file actions
28 lines (25 loc) · 850 Bytes
/
student_view.php
File metadata and controls
28 lines (25 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
session_start();
require_once 'include/baseTheme.php';
if (!isset($_SESSION['saved_editor'])) {
$course_id = intval(course_code_to_id($_GET['course']));
$is_editor = FALSE;
if (check_editor()) {
$is_editor = TRUE;
}
}
if ((isset($_SESSION['status']) and $_SESSION['status'] == 1) or $is_editor) {
$_SESSION['saved_status'] = $_SESSION['status'];
$_SESSION['status'] = 5;
$_SESSION['saved_editor'] = $is_editor;
} elseif (isset($_SESSION['saved_status'])) {
$_SESSION['status'] = $_SESSION['saved_status'];
unset($_SESSION['saved_status']);
unset($_SESSION['saved_editor']);
}
if (isset($_SESSION['dbname'])) {
$_SESSION['courses'][$_SESSION['dbname']] = $_SESSION['status'];
header("Location: {$urlServer}courses/$_SESSION[dbname]/");
} else {
header('Location: ' . $urlServer);
}