Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
Fixed : Issue #1
Thanks @myitmx
  • Loading branch information
Netrvin committed May 19, 2018
1 parent bb8db21 commit 8c0b4a9
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions add_domain.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include_once("cf.class.php");

CF::is_login();
$cloudflare->is_login();

function msg($s){
$_SESSION["msg"]=$s;
Expand All @@ -13,7 +13,7 @@ function msg($s){
msg("域名不能为空");
}

$r=CF::zone_set($_POST["domain"],$_POST["domain"],"www:".$_POST["domain"]);
$r=$cloudflare->zone_set($_POST["domain"],$_POST["domain"],"www:".$_POST["domain"]);

if ($r["result"]=="success"){
msg("添加成功");
Expand Down
4 changes: 2 additions & 2 deletions auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function msg($s){
{
if (!empty($_POST["g-recaptcha-response"]))
{
if (!(CF::reCAPTCHA($_POST["g-recaptcha-response"])))
if (!($cloudflare->reCAPTCHA($_POST["g-recaptcha-response"])))
{
msg("请完成验证码");
}
Expand All @@ -23,7 +23,7 @@ function msg($s){

if ((!empty($_POST["email"]))&&(!empty($_POST["password"])))
{
$r=CF::login($_POST["email"],$_POST["password"]);
$r=$cloudflare->login($_POST["email"],$_POST["password"]);
if ($r["result"]=="success")
{
$_SESSION["user_key"]=$r["response"]["user_key"];
Expand Down
4 changes: 3 additions & 1 deletion cf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,6 @@ public function reCAPTCHA($response){
return false;
}
}
}
}

$cloudflare=new CF();
4 changes: 2 additions & 2 deletions delete_domain.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include_once("cf.class.php");

CF::is_login();
$cloudflare->is_login();

function msg($s){
$_SESSION["msg"]=$s;
Expand All @@ -13,7 +13,7 @@ function msg($s){
msg("域名不能为空");
}

$r=CF::zone_delete($_POST["domain"]);
$r=$cloudflare->zone_delete($_POST["domain"]);

if ($r["result"]=="success"){
msg("删除成功");
Expand Down
4 changes: 2 additions & 2 deletions domains.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

include_once("cf.class.php");

CF::is_login();
$cloudflare->is_login();

$r=CF::user_lookup();
$r=$cloudflare->user_lookup();

include_once("header.php");
?>
Expand Down
10 changes: 5 additions & 5 deletions edit_record.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
include_once("cf.class.php");

CF::is_login();
$cloudflare->is_login();

function msg($s){
$_SESSION["mng_msg"]=$s;
Expand All @@ -23,7 +23,7 @@ function msg($s){
msg("记录不能为空");
}

$re=CF::zone_lookup($_POST["domain"]);
$re=$cloudflare->zone_lookup($_POST["domain"]);
if ($re["result"]!="success"){
msg("操作失败:".$re["msg"]);
}
Expand All @@ -34,14 +34,14 @@ function msg($s){
msg("该域名未在".SITE_NAME."接入");
}

$r=CF::remove_zone_name($re["response"]["zone_name"],$re["response"]);
$r=$cloudflare->remove_zone_name($re["response"]["zone_name"],$re["response"]);

if ($_POST["action"]=="delete")
{
if (!empty($r["hosted_cnames"][$_POST["record"]]))
{
unset($r["hosted_cnames"][$_POST["record"]]);
$result=CF::update_record($r["zone_name"],$r["hosted_cnames"]);
$result=$cloudflare->update_record($r["zone_name"],$r["hosted_cnames"]);
if ($result["result"]=="success")
{
msg("删除成功");
Expand All @@ -56,7 +56,7 @@ function msg($s){
if (!empty($_POST["value"]))
{
$r["hosted_cnames"][$_POST["record"]]=$_POST["value"];
$result=CF::update_record($r["zone_name"],$r["hosted_cnames"]);
$result=$cloudflare->update_record($r["zone_name"],$r["hosted_cnames"]);
if ($result["result"]=="success")
{
msg("更新成功");
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</a>.</span>
<br />
<span>
<a href="https://github.com/Netrvin/CFPMP" target="_blank">CFPMP</a> v0.1.0</span>
<a href="https://github.com/Netrvin/CFPMP" target="_blank">CFPMP</a> v0.1.1</span>
</center>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

include_once("cf.class.php");

CF::logout();
$cloudflare->logout();

include_once("header.php");
?>
Expand Down
9 changes: 6 additions & 3 deletions manage_domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

include_once("cf.class.php");

CF::is_login();
$cloudflare->is_login();

function msg($s){
$_SESSION["msg"]=$s;
Expand All @@ -15,7 +15,7 @@ function msg($s){
msg("域名不能为空");
}

$re=CF::zone_lookup($_GET["domain"]);
$re=$cloudflare->zone_lookup($_GET["domain"]);
if ($re["result"]!="success")
{
msg("查询失败:".$re["msg"]);
Expand All @@ -29,7 +29,7 @@ function msg($s){
msg("该域名未在".SITE_NAME."接入");
}

$r=CF::remove_zone_name($re["response"]["zone_name"],$re["response"]);
$r=$cloudflare->remove_zone_name($re["response"]["zone_name"],$re["response"]);

include_once("header.php");
?>
Expand Down Expand Up @@ -107,6 +107,9 @@ function msg($s){
<p>
注 (2):根据先前的测试(2018-02-15),目前启用Universal SSL无需再专门配置CNAME记录,只需配置所需接入的域名的CNAME记录。证书将在24小时内下发。一切以实际情况为准
</p>
<p>
注 (3):回源地址以<strong>CNAME</strong>形式填写,暂时不支持<strong>A</strong>记录和<strong>AAAA</strong>记录
</p>
</div>
</div>
</div>
Expand Down

0 comments on commit 8c0b4a9

Please sign in to comment.