aboutsummaryrefslogtreecommitdiff
path: root/src/site
diff options
context:
space:
mode:
Diffstat (limited to 'src/site')
-rw-r--r--src/site/getsite.php45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/site/getsite.php b/src/site/getsite.php
index 5e4b621..25a67d3 100644
--- a/src/site/getsite.php
+++ b/src/site/getsite.php
@@ -30,27 +30,30 @@ if($ct["contestlocalsite"]==$ct["contestmainsite"]) {
LOGLevel("Connection received from site=$fromsite PHPID=".$_COOKIE['PHPSESSID'].",extra=".$_SESSION['usertable']['usersessionextra'].
",session=".session_id().",name=".$getx['name'].", check=".$getx['check'],2);
if($fromsite != '' && is_numeric($fromsite) && $fromsite > 0) {
+ if(isset($_POST)) {
+ if(isset($_POST['xml'])) {
+ // $fp=fopen('/tmp/aaa',"w"); fwrite($fp,$_POST['xml']); fclose($fp);
+ $s = decryptData(rawurldecode($_POST['xml']),myhash($_SESSION["usertable"]["userpassword"]));
+ // $fp=fopen('/tmp/aaa1',"w"); fwrite($fp,$s); fclose($fp);
+ if(strtoupper(substr($s,0,5)) != "<XML>") {
+ echo "<!-- <ERROR8> ".session_id() . " " . session_id() . " -->\n";
+ } else {
+ if(importFromXML($s,$_SESSION["usertable"]["contestnumber"],$fromsite,true))
+ echo "<!-- <OK> -->";
+ else
+ echo "<!-- <NOTOK> -->";
+ }
+ }
+ if(isset($_POST['updatetime']) && is_numeric($_POST['updatetime'])) {
+ $xml = generateSiteXML($_SESSION["usertable"]["contestnumber"],$fromsite,$_POST['updatetime']);
+ echo encryptData($xml,myhash($_SESSION["usertable"]["userpassword"]));
+ }
+ } else {
+ echo "<!-- <ERROR3> ".session_id() . " " . session_id() . " -->\n";
+ }
} else {
- echo "<!-- <ERROR9> ".session_id() . " " . session_id() . " -->\n";
- exit;
+ echo "<!-- <ERROR9> ".session_id() . " " . session_id() . " -->\n";
+ exit;
}
- if(isset($_POST)) {
- if(isset($_POST['xml'])) {
-// $fp=fopen('/tmp/aaa',"w"); fwrite($fp,$_POST['xml']); fclose($fp);
- $s = decryptData(rawurldecode($_POST['xml']),myhash($_SESSION["usertable"]["userpassword"]));
-// $fp=fopen('/tmp/aaa1',"w"); fwrite($fp,$s); fclose($fp);
- if(strtoupper(substr($s,0,5)) != "<XML>") {
- echo "<!-- <ERROR8> ".session_id() . " " . session_id() . " -->\n";
- } else {
- if(importFromXML($s,$_SESSION["usertable"]["contestnumber"],$fromsite,true))
- echo "<!-- <OK> -->";
- else
- echo "<!-- <NOTOK> -->";
- }
- }
- if(isset($_POST['updatetime']) && is_numeric($_POST['updatetime'])) {
- $xml = generateSiteXML($_SESSION["usertable"]["contestnumber"],$fromsite,$_POST['updatetime']);
- echo encryptData($xml,myhash($_SESSION["usertable"]["userpassword"]));
-} else
- echo "<!-- <ERROR3> ".session_id() . " " . session_id() . " -->\n";
+}
?>