enhanced motor handling, bug fixes, initial optimization code
[debian/openrocket] / web / html / actions / updates.php
index 94c5049f12c96ec7b7799c676cc9347f1695a093..5a8d9994a0efc73820b3ebc606e258748b55f360 100644 (file)
@@ -21,6 +21,7 @@ $orversion = "";
 $oros = "";
 $orjava = "";
 $orcountry = "";
+$orcores = "";
 foreach (getallheaders() as $header => $value) {
     if (preg_match("/^[a-zA-Z0-9 !$%&()*+,.\\/:=?@_~-]{1,40}$/", $value)) {
        $h = strtolower($header);
@@ -34,20 +35,23 @@ foreach (getallheaders() as $header => $value) {
            $orjava = $value;
        } else if ($h == 'x-openrocket-country') {
            $orcountry = $value;
+       } else if ($h == 'x-openrocket-cpus') {
+           $orcores = $value;
        }
     }
 }
 
 // Log the request
 if ((strlen($orversion) > 0 || strlen($orid) > 0 || strlen($oros) > 0
-     || strlen($orjava) > 0 || strlen($orcountry) > 0) &&
-
+     || strlen($orjava) > 0 || strlen($orcountry) > 0 
+     || strlen($orcores) > 0) &&
     (strlen($orversion) < 20 && strlen($orid) < 50 && strlen($oros) < 50
-     && strlen($orjava) < 50 && strlen($orcountry) < 50)) {
+     && strlen($orjava) < 50 && strlen($orcountry) < 50) 
+     && strlen($orcores) < 10) {
 
     $file = $logfiles . gmdate("Y-m");
     $line = gmdate("Y-m-d H:i:s") . ";" . $orid . ";" . $orversion .
-       ";" . $oros . ";" . $orjava . ";" . $orcountry . "\n";
+       ";" . $oros . ";" . $orjava . ";" . $orcountry . ";" . $orcores . "\n";
 
     $fp = fopen($file, 'a');
     if ($fp != FALSE) {
@@ -65,15 +69,23 @@ header("Content-type: text/plain");
 /*
  * Currently all old versions are handled manually.
  * Update checking was introduced in OpenRocket 0.9.4
+ *
+ * We ignore "pre" versions, they are handled exacly like
+ * their non-pre counterparts.
  */
 $version = $_GET["version"];
 $updates = "";
 
-if (preg_match("/^0\.9\.6/",$version)) {
+if (preg_match("/^1\.1\.0/", $version)) {
+  $updates = "Version: 1.1.1\n" .
+    "6: Enhanced motor selection\n" .
+    "5: Rewritten simulation code" .
+    "4: Bug fixes";
+} else if (preg_match("/^0\.9\.6/", $version)) {
   $updates = "Version: 1.0.0\n" .
     "6: Hundreds of new thrustcurves\n" .
     "5: Bug fixes";
-} else if (preg_match("/^0\.9\.(4|5pre|5|6pre)/",$version)) {
+} else if (preg_match("/^0\.9\.[45]/", $version)) {
   $updates = "Version: 1.0.0\n" .
     "7: Hundreds of new thrustcurves\n" .
     "6: Aerodynamic computation updates\n" .