aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-09-08 11:33:36 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-09-08 11:33:36 +0000
commitcb8298bbc8cb69e04811a4da5a44f34a5d5d5291 (patch)
treea18c8641bc5923c6a3671ad34c2746e4c466bfcd /src
parent24e8e000ba6cb5ed671c40ebd7eec01f484aedbf (diff)
downloadboca-cb8298bbc8cb69e04811a4da5a44f34a5d5d5291.tar.gz
boca-cb8298bbc8cb69e04811a4da5a44f34a5d5d5291.zip
remove need of encryption to speed up server
Diffstat (limited to 'src')
-rw-r--r--src/scoretable.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/scoretable.php b/src/scoretable.php
index 855b66c..850ee9a 100644
--- a/src/scoretable.php
+++ b/src/scoretable.php
@@ -175,10 +175,11 @@ if(isset($_GET["remote"])) {
}
exit;
}
-
if(!$redo) {
$conf=globalconf();
- $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"],'score');
+ if($conf['doenc'])
+ $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"],'score');
+ else $strtmp = substr($strtmp,strpos($strtmp,"\n"));
if($strtmp=="") $redo=TRUE;
}
if($redo) {
@@ -396,7 +397,9 @@ if($redo) {
}
$conf=globalconf();
- $strtmp = "<!-- " . time() . " --> <?php exit; ?>\n" . encryptData($strtmp,$conf["key"],false);
+ if($conf['doenc'])
+ $strtmp = "<!-- " . time() . " --> <?php exit; ?>\n" . encryptData($strtmp,$conf["key"],false);
+ else $strtmp = "<!-- " . time() . " --> <?php exit; ?>\n" . $strtmp;
if(file_put_contents($scoretmp, $strtmp,LOCK_EX)===FALSE) {
if($_SESSION["usertable"]["usertype"] == 'admin') {
MSGError("Cannot write to the score cache file -- performance might be compromised");
@@ -404,7 +407,9 @@ if($redo) {
LOGError("Cannot write to the ".$_SESSION["usertable"]["usertype"]."-score cache file -- performance might be compromised");
}
$conf=globalconf();
- $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"]);
+ if($conf['doenc'])
+ $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"]);
+ else $strtmp = substr($strtmp,strpos($strtmp,"\n"));
}
echo $strtmp;
?>