version 1.1.9
[debian/openrocket] / web / html / actions / updates.php
index d1936eccc5b4b517e7e5a4d7a25a5cdd000056b7..6eb20b6cf17d969d1386f12103b19695429e7802 100644 (file)
@@ -22,6 +22,7 @@ $oros = "";
 $orjava = "";
 $orcountry = "";
 $orcores = "";
+$orlocale = "";
 foreach (getallheaders() as $header => $value) {
     if (preg_match("/^[a-zA-Z0-9 !$%&()*+,.\\/:=?@_~-]{1,40}$/", $value)) {
        $h = strtolower($header);
@@ -37,6 +38,8 @@ foreach (getallheaders() as $header => $value) {
            $orcountry = $value;
        } else if ($h == 'x-openrocket-cpus') {
            $orcores = $value;
+       } else if ($h == 'x-openrocket-locale') {
+           $orlocale = $value;
        }
     }
 }
@@ -44,14 +47,15 @@ foreach (getallheaders() as $header => $value) {
 // Log the request
 if ((strlen($orversion) > 0 || strlen($orid) > 0 || strlen($oros) > 0
      || strlen($orjava) > 0 || strlen($orcountry) > 0 
-     || strlen($orcores) > 0) &&
+     || strlen($orcores) > 0 || strlen($orlocale) > 0) &&
     (strlen($orversion) < 20 && strlen($orid) < 50 && strlen($oros) < 50
      && strlen($orjava) < 50 && strlen($orcountry) < 50) 
-     && strlen($orcores) < 10) {
+     && strlen($orcores) < 10 && strlen($orlocale) < 20) {
 
     $file = $logfiles . gmdate("Y-m");
     $line = gmdate("Y-m-d H:i:s") . ";" . $orid . ";" . $orversion .
-       ";" . $oros . ";" . $orjava . ";" . $orcountry . ";" . $orcores . "\n";
+       ";" . $oros . ";" . $orjava . ";" . $orcountry . ";" . $orcores . 
+       ";" . $orlocale . "\n";
 
     $fp = fopen($file, 'a');
     if ($fp != FALSE) {
@@ -76,20 +80,81 @@ header("Content-type: text/plain");
 $version = $_GET["version"];
 $updates = "";
 
-if (preg_match("/^1\.1\.0/", $version)) {
-  $updates = "Version: 1.1.1\n" .
+$unstable = "1.1.9";
+$stable = "1.0.0";
+
+if (preg_match("/^1\.1\.8/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "6: Additional template printing\n" .
+    "5: Geodetic computations\n" .
+    "4: Bug fixes\n" .
+    "";
+} else if (preg_match("/^1\.1\.7/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "6: Additional template printing\n" .
+    "5: Geodetic computations\n" .
+    "4: Bug fixes\n" .
+    "";
+} else if (preg_match("/^1\.1\.6/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "8: Automatic rocket design optimization\n" .
+    "6: Additional template printing\n" .
+    "5: Geodetic computations\n" .
+    "";
+} else if (preg_match("/^1\.1\.5/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "8: Automatic rocket design optimization\n" .
+    "6: Initial localization support\n" .
+    "6: Additional template printing\n" .
+    "5: Geodetic computations\n" .
+    "5: Scaling support\n" .
+    "4: Bug fixes\n" .
+    "";
+} else if (preg_match("/^1\.1\.4/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "8: Automatic rocket design optimization\n" .
+    "6: Initial localization support\n" .
+    "5: Fixes to printing system\n" .
+    "5: Scaling support\n" .
+    "";
+} else if (preg_match("/^1\.1\.3/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "8: Automatic rocket design optimization\n" .
+    "7: Initial printing support\n" .
+    "6: Initial localization support\n" .
+    "5: Scaling support\n" .
+    "4: Bug fixes\n" .
+    "";
+} else if (preg_match("/^1\.1\.[12]/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "8: Automatic rocket design optimization\n" .
+    "6: Initial printing support\n" .
+    "5: Initial drag-and-drop support\n" .
+    "5: Initial localization support\n" .
+    "5: Scaling support\n" .
+    "4: Bug fixes\n" .
+    "";
+} else if (preg_match("/^1\.1\.0/", $version)) {
+  $updates = "Version: " . $unstable . "\n" .
+    "8: Automatic rocket design optimization\n" .
+    "6: Initial printing support\n" .
+    "6: Initial localization support\n" .
     "6: Enhanced motor selection\n" .
     "5: Rewritten simulation code\n" .
-    "4: Bug fixes";
+    "5: Drag-and-drop support\n" .
+    "4: Bug fixes\n" .
+    "";
 } else if (preg_match("/^0\.9\.6/", $version)) {
-  $updates = "Version: 1.0.0\n" .
+  $updates = "Version: " . $stable . "\n" .
     "6: Hundreds of new thrustcurves\n" .
-    "5: Bug fixes";
+    "5: Bug fixes\n" .
+    "";
 } else if (preg_match("/^0\.9\.[45]/", $version)) {
-  $updates = "Version: 1.0.0\n" .
+  $updates = "Version: " . $stable . "\n" .
     "7: Hundreds of new thrustcurves\n" .
     "6: Aerodynamic computation updates\n" .
-    "5: Numerous bug fixes";
+    "5: Numerous bug fixes" .
+    "";
 }