-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a0443c
commit ceee6e7
Showing
13 changed files
with
1,163 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
.DS_Store | ||
/.cache | ||
/.vscode | ||
*.txt | ||
*.txt | ||
domainName.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { | ||
$res['code'] = 0; | ||
$res['message'] = '提交失败!'; | ||
|
||
session_start(); | ||
$user = isset($_SESSION['wop_admin_user']) ? $_SESSION['wop_admin_user'] : ''; | ||
if (empty($user)) { | ||
$res['code'] = -1; | ||
$res['message'] = '登陆过期!'; | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
$domainName = strip_tags(trim($_POST['domain_name'])); | ||
|
||
if (empty($domainName)) { | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
$domainNameArr = array(); | ||
$file = './domainName.json'; | ||
if (file_exists($file)) { | ||
$domainNameArr = json_decode(file_get_contents($file), true); | ||
} | ||
|
||
$hasDomainName = false; | ||
if (count($domainNameArr)) { | ||
foreach ($domainNameArr as $key=>$value) { | ||
if ($value == $domainName) { | ||
$hasDomainName = true; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
if (!$hasDomainName) { | ||
array_unshift($domainNameArr, $domainName); | ||
file_put_contents('./domainName.json', json_encode($domainNameArr)); | ||
} | ||
|
||
$res['code'] = 1; | ||
$res['message'] = '提交成功!'; | ||
echo json_encode($res); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { | ||
$res['code'] = 0; | ||
$res['message'] = '移除失败!'; | ||
|
||
session_start(); | ||
$user = isset($_SESSION['wop_admin_user']) ? $_SESSION['wop_admin_user'] : ''; | ||
if (empty($user)) { | ||
$res['code'] = -1; | ||
$res['message'] = '登陆过期!'; | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
$domainName = strip_tags(trim($_POST['domain_name'])); | ||
|
||
if (empty($domainName)) { | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
$domainNameArr = array(); | ||
$file = './domainName.json'; | ||
if (file_exists($file)) { | ||
$domainNameArr = json_decode(file_get_contents($file), true); | ||
} | ||
|
||
$hasDomainName = false; | ||
if (count($domainNameArr)) { | ||
foreach ($domainNameArr as $key=>$value) { | ||
if ($value == $domainName) { | ||
$hasDomainName = true; | ||
unset($domainNameArr[$key]); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
if (!$hasDomainName) { | ||
$res['message'] = '域名不存在!'; | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
file_put_contents('./domainName.json', json_encode($domainNameArr)); | ||
|
||
$res['code'] = 1; | ||
$res['message'] = '移除成功!'; | ||
echo json_encode($res); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { | ||
$res['code'] = 0; | ||
$res['message'] = '移除失败!'; | ||
|
||
session_start(); | ||
$user = isset($_SESSION['wop_admin_user']) ? $_SESSION['wop_admin_user'] : ''; | ||
if (empty($user)) { | ||
$res['code'] = -1; | ||
$res['message'] = '登陆过期!'; | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
$verify = strip_tags(trim($_POST['verify'])); | ||
|
||
if (empty($verify)) { | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
$file = $_SERVER['DOCUMENT_ROOT'] . '/' . $verify; | ||
if (!file_exists($file)) { | ||
$res['message'] = '验证文件不存在!'; | ||
echo json_encode($res); | ||
exit(); | ||
} | ||
|
||
unlink($file); | ||
|
||
$res['code'] = 1; | ||
$res['message'] = '移除成功!'; | ||
echo json_encode($res); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.