-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdatemoderate.php
40 lines (31 loc) · 1.18 KB
/
updatemoderate.php
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
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require('app.php');
if(!PupilAuth::isLoggedIn()) {
exit;
}
if(!in_array($User->rollnumber, array(11830, 9216, 9237, 9340))) {
echo '<div class="ui red segment"><h1>access denied, nerds only</h1></div>';
exit;
}
$pupil = $_GET['pupil'];
$author = $_GET['author'];
$text = $_GET['text'];
$signature = $_GET['signature'];
$action = $_GET['action'];
$authorobj = new Author($pupil, $author);
if($action == "accept") {
$authorobj->editStatus(1);
$authorobj->appendActivity("APPLICATION ACCEPTED BY " . $User->firstname . " " . $User->secondname);
}else if($action == "reject") {
$authorobj->editStatus(2);
$authorobj->appendActivity("APPLICATION REJECTED BY " . $User->firstname . " " . $User->secondname);
}else if($action == "edit") {
$authorobj->editText($text);
$authorobj->editSignature($signature);
$authorobj->editStatus(0);
$authorobj->appendActivity("UPDATED TEXT: " . $text);
$authorobj->appendActivity("UPDATED SIGNATURE: " . $signature);
$authorobj->appendActivity("APPLICATION EDITED BY " . $User->firstname . " " . $User->secondname);
}
header("Location: http://yrbk.co/moderate_view.php?select=all&rollnumber=" . $author);
die();