-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditTAs.php
More file actions
executable file
·37 lines (34 loc) · 934 Bytes
/
editTAs.php
File metadata and controls
executable file
·37 lines (34 loc) · 934 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
29
30
31
32
33
34
35
36
37
<?php
require_once 'CAS-1.3.4/CAS.php';
// Initialize phpCAS
phpCAS::client(CAS_VERSION_2_0,'cas.byu.edu',443,'cas');
$auth = phpCAS::checkAuthentication();
if($auth)
{
if(isset($_POST["username"]) && isset($_POST["action"]))
{
require_once "DBConnect.php";
if(verifyTA(phpCAS::getUser()))
{
if($_POST["action"] == "toggleTAActive")
{
echo json_encode(array("stats"=>toggleTAActive($_POST["username"]), "list"=>array()));
}
else if ($_POST["action"] == "addTA")
{
echo json_encode(array("stats"=>addTA($_POST["username"], $_POST["name"]), "list"=>array()));
}
else
echo json_encode(array("status"=>"error", "message"=>"mal formed post"));
}
else
{
echo json_encode(array("status"=>"error", "message"=>"You are not authorized to preform that action"));
}
}
}
else
{
echo json_encode(array("status"=>"error", "message"=>"not logged in"));
}
?>