diff options
| author | Cassio de Campos <cassiopc@gmail.com> | 2017-09-08 11:33:36 +0000 |
|---|---|---|
| committer | Cassio de Campos <cassiopc@gmail.com> | 2017-09-08 11:33:36 +0000 |
| commit | cb8298bbc8cb69e04811a4da5a44f34a5d5d5291 (patch) | |
| tree | a18c8641bc5923c6a3671ad34c2746e4c466bfcd /src/scoretable.php | |
| parent | 24e8e000ba6cb5ed671c40ebd7eec01f484aedbf (diff) | |
| download | boca-cb8298bbc8cb69e04811a4da5a44f34a5d5d5291.tar.gz boca-cb8298bbc8cb69e04811a4da5a44f34a5d5d5291.zip | |
remove need of encryption to speed up server
Diffstat (limited to 'src/scoretable.php')
| -rw-r--r-- | src/scoretable.php | 13 |
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; ?> |