From df477b322c071d81ea06ad972a36ea9f30cdc34f Mon Sep 17 00:00:00 2001 From: cassiopc Date: Mon, 22 Oct 2012 18:50:03 +0200 Subject: update sendscore.sh to cope with new version. Fix password update and hexsub --- boca-1.5.1/src/scoretable.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'boca-1.5.1/src/scoretable.php') diff --git a/boca-1.5.1/src/scoretable.php b/boca-1.5.1/src/scoretable.php index 574b700..dcfc7a6 100644 --- a/boca-1.5.1/src/scoretable.php +++ b/boca-1.5.1/src/scoretable.php @@ -95,7 +95,7 @@ if(file_exists($scoretmp)) { } } -if($_SESSION["usertable"]["usertype"]=='score' || (isset($_GET["remote"]) && is_numeric($_GET["remote"]))) { +if($_SESSION["usertable"]["usertype"]=='score' || $_SESSION["usertable"]["usertype"]=='admin' || (isset($_GET["remote"]) && is_numeric($_GET["remote"]))) { $remotedir = $_SESSION['locr'] . $ds . "private" . $ds . "remotescores"; $destination = $remotedir . $ds ."scores.zip"; if(is_writable($remotedir)) { @@ -115,10 +115,12 @@ if($_SESSION["usertable"]["usertype"]=='score' || (isset($_GET["remote"]) && is_ @file_put_contents($fname . ".tmp",base64_encode(serialize($data0))); @rename($fname . ".tmp",$fname . ".dat"); - if(@create_zip($remotedir,glob($remotedir . '/*.dat'),$destination)!==true) { + if(@create_zip($remotedir,glob($remotedir . '/*.dat'),$fname . ".tmp") != 1) { LOGError("Cannot create score zip file"); + if(@create_zip($remotedir,array(),$fname . ".tmp") == 1) + @rename($fname . ".tmp",$destination); } else { - @create_zip($remotedir,array(),$destination); + @rename($fname . ".tmp",$destination); } } } -- cgit v1.2.3