-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimReg.php
executable file
·60 lines (56 loc) · 1.48 KB
/
simReg.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
53
54
55
56
57
58
59
60
<?php
require_once('signin.php');
require_once("$Settings[MyDir]/class/util.class.php");
$redirect = array("page" => $_GET['redirect']);
if($_GET['type']=="signin")
{
if(login($_GET['user'], $_GET['password']))
//echo "Login was successful";
header("location: ".Util::genURI(array("prompt" => "signedin"), $redirect));
else
//echo "Login failed";
header("location: ".Util::genURI(array("prompt" => "signedinFail"), $redirect));
}
elseif($_GET['type']=="signout")
{
if(logout())
//echo "Logout was successful";
header("location: ".Util::genURI(array("prompt" => "signedOut"), $redirect));
else
//echo "Logout failed";
header("location: ".Util::genURI(array("prompt" => "signedOutFail"), $redirect));
}
elseif($_GET['type']=="check")
{
if(getSession()["Status"]>0)
{
echo "You're logged in<br>";
print_r(getSession());
}
else
echo "You're not logged in";
}
elseif($_GET['type']=="userexists")
{
if(userExists($_GET['user']))
echo "User exists";
else
echo "User doesn't exist";
}
elseif($_GET['type']=="delete")
{
if(deleteCurrentUser($_GET['user']))
echo "User deleted";
else
echo "User deletion failed";
}
elseif($_GET['type']=="signup")
{
if(signup($_GET['name'], $_GET['user'], $_GET['password']))
//echo "registration successful";
header("location: ".Util::genURI(array("prompt" => "registrationValidation"), $redirect));
else
//echo "registration failed";
header("location: ".Util::genURI(array("prompt" => "registrationValidationFail"), $redirect));
}
?>