-
Notifications
You must be signed in to change notification settings - Fork 4
/
functions.php
52 lines (47 loc) · 1.4 KB
/
functions.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
41
42
43
44
45
46
47
48
49
50
51
52
<?php
use lib\CertMaker;
function makeCT(){
$pass = require_once "config.php";
if (!isset($_SESSION['leadLogin']) && !password_verify($_SESSION['leadLogin'],$pass['pass'])){
header("Location:/ct19/lg");
}
if (isset($_POST['name']) && isset($_POST['univ']) && isset($_POST['lead'])){
$data = [
"temp"=>"ct",
"name"=>$_POST['name'],
"univ"=>$_POST['univ'],
"lead"=>$_POST['lead'],
];
CertMaker::coreTeam($data);
}
}
function viewHome(){
return require_once 'views/home.php';
}
function logLeadPage(){
return require_once 'views/leadLogin.php';
}
function coreTeamPage(){
$pass = require_once "config.php";
if (isset($_SESSION['leadLogin']) && password_verify($_SESSION['leadLogin'],$pass['pass'])){
return require_once 'views/coreTeam.php';
} else {
header("Location:/ct19/lg");
}
}
function leadLogin(){
$pass = require_once "config.php";
$code = $_POST['code'];
if (!empty($code)){
if (password_verify($code,$pass['pass'])){
$_SESSION['invalidCode'] = null;
$_SESSION['leadLogin'] = $code;
header("Location:/ct19");
} else {
$_SESSION['invalidCode'] = true;
header("Location:/ct19/lg");
}
} else {
echo "Invalid Request";
}
}