Skip to content

Commit

Permalink
code climate data
Browse files Browse the repository at this point in the history
  • Loading branch information
bitslip6 committed Jul 15, 2021
1 parent 25c0cab commit 744cb0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function upgrade(\Bitfire\Request $request) {
$root = str_replace(WAF_DIR."cache/bitfire-{$v}/", "", $x);
//echo "base [$base] path [$path] - [" . WAF_DIR . $root . "]\n";
if (!rename($x, WAF_DIR . $root)) {
exit("upgrade failed");
// exit("upgrade failed");
}
}
});//, "/.*.php/");
Expand Down
12 changes: 6 additions & 6 deletions views/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
function add_exception(ex) {
console.log("path: ", url_to_path(ex.getAttribute("data-ex-url")));
console.log("code: ", ex.getAttribute("data-ex-code"));
postData("<?php echo \Bitfire\Config::str("dashboard_path")?>?BITFIRE_API=add_api_exception",
postData("<?php echo $dashboard_path?>?BITFIRE_API=add_api_exception",
{"BITFIRE_API":"add_api_exception",
"_bitfire_p": "<?php echo \Bitfire\Config::str("secret");?>",
"code": ex.getAttribute("data-ex-code"),
Expand Down Expand Up @@ -184,7 +184,7 @@
var e = GBI(elm);
console.log(e);
e.innerText = cap(type);
fetch('<?php echo \Bitfire\Config::str("dashboard_path")?>?param='+elm+'&value='+type+'&BITFIRE_API=toggle_config_value&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now()).then(data => { console.log(data); });
fetch('<?php echo $dashboard_path?>?param='+elm+'&value='+type+'&BITFIRE_API=toggle_config_value&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now()).then(data => { console.log(data); });
if (type == "block" || type == "on" || type == "true") {
e.classList.remove("btn-warning");
e.classList.remove("btn-secondary");
Expand Down Expand Up @@ -1015,7 +1015,7 @@ <h4>Blocks</h4>
if (p1 != p2) { alert("password does not match"); return; }
if (p1.length < 8) { alert("password must be at least 8 characters"); return; }
console.log(p1);
fetch('<?php echo \Bitfire\Config::str("dashboard_path")?>?BITFIRE_API=set_pass&pass1='+encodeURIComponent(p1)+'&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
fetch('<?php echo $dashboard_path?>?BITFIRE_API=set_pass&pass1='+encodeURIComponent(p1)+'&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
.then(response => response.text())
.then(response => {
console.log(response);
Expand Down Expand Up @@ -1187,7 +1187,7 @@ <h4>Blocks</h4>

function upgrade() {
console.log("upgrade!");
fetch('<?php echo \Bitfire\Config::str("dashboard_path")?>?BITFIRE_API=upgrade&ver='+window.LATEST+'&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
fetch('<?php echo $dashboard_path?>?BITFIRE_API=upgrade&ver='+window.LATEST+'&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
.then(response => response.text())
.then(response => {
alert(response);
Expand Down Expand Up @@ -1226,7 +1226,7 @@ <h4>Blocks</h4>
<?php if ($is_free) {
echo "alert('Site Lock only available in PRO');\nreturn;"; } ?>
GBI("lock").innerText = "locking...";
fetch('<?php echo \Bitfire\Config::str("dashboard_path")?>?BITFIRE_API=lock_site&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
fetch('<?php echo $dashboard_path?>?BITFIRE_API=lock_site&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
.then(response => {
console.log(response);
GBI("lock").innerText = "LOCK SITE";
Expand All @@ -1237,7 +1237,7 @@ <h4>Blocks</h4>

GBI("unlock").addEventListener("click", function() {
GBI("unlock").innerText = "unlocking...";
fetch('<?php echo \Bitfire\Config::str("dashboard_path")?>?BITFIRE_API=unlock_site&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
fetch('<?php echo $dashboard_path?>?BITFIRE_API=unlock_site&_bitfire_p=<?php echo \Bitfire\Config::str("secret");?>&ts='+Date.now())
.then(response => {
console.log(response);
GBI("unlock").innerText = "UNLOCK SITE";
Expand Down

0 comments on commit 744cb0f

Please sign in to comment.