forked from Netrvin/CFPMP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.php
More file actions
37 lines (33 loc) · 865 Bytes
/
auth.php
File metadata and controls
37 lines (33 loc) · 865 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
include_once("cf.class.php");
function msg($s){
$_SESSION["login_msg"]=$s;
header("Location: index.php");
exit(0);
}
if (Enable_reCAPTCHA)
{
if (!empty($_POST["g-recaptcha-response"]))
{
if (!(CF::reCAPTCHA($_POST["g-recaptcha-response"])))
{
msg("请完成验证码");
}
}else{
msg("请完成验证码");
}
}
if ((!empty($_POST["email"]))&&(!empty($_POST["password"])))
{
$r=CF::login($_POST["email"],$_POST["password"]);
if ($r["result"]=="success")
{
$_SESSION["user_key"]=$r["response"]["user_key"];
$_SESSION["email"]=$r["response"]["cloudflare_email"];
header("Location: domains.php");
}else{
msg("登陆 / 注册失败:".$r["msg"]);
}
}else{
msg("用户名和密码不能为空");
}