-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusermanager.php
More file actions
46 lines (37 loc) · 867 Bytes
/
usermanager.php
File metadata and controls
46 lines (37 loc) · 867 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
38
39
40
41
42
43
44
45
46
<?php
//
// Action
// 0: sign in
// 1: sign up
// 2: log out
//
include 'lib.php';
// TODO: Add return error process handle.
switch ($_GET["action"]) {
case '0':
$email = $_POST["emailLogin"];
$passwd = $_POST["passwdLogin"];
// echo $email." and ".$passwd;
$res = checkUser($email, $passwd, true);
// header("Location: ./index.php");
break;
case '1':
$email = $_POST["emailRegister"];
$passwd = $_POST["passwordRegister"];
$nickname = $_POST["nameRegister"];
// echo "$email"." ".$passwd." ".$nickname;
$res = registerUser($nickname, $email, $passwd);
// header("Location: ./index.php");
break;
case '2':
deleteCookie();
// header("Location: ./index.php");
break;
default:
// echo "default";
break;
}
// echo "action: ".$_GET["action"];
// header should before any other output.
header("Location: ./index.php");
?>