Browse Source

http vs https related stuff

tkas 2 years ago
parent
commit
d737ba8648
4 changed files with 13 additions and 9 deletions
  1. 10 6
      gp/index.php
  2. 1 1
      index.html
  3. 1 1
      tables/index.php
  4. 1 1
      tables/table.php

+ 10 - 6
gp/index.php

@@ -19,7 +19,7 @@ function show_nodes($where, $class){ //{{{
     $geom = preg_replace('/POINT\(([-0-9.]{1,8})[0-9]* ([-0-9.]{1,8})[0-9]*\)/', '$2&nbsp$1', $row->geom);
     echo "<td><a href=\"http://openstreetmap.org/node/".$row->nodeid."\">".$row->nodeid."</a></td>\n";
     echo "<td><a target=\"hiddenIframe\"
-    href=\"http://localhost:8111/load_object?objects=n".$row->nodeid."\">".$geom."</a></td>\n";
+    href=\"http://127.0.0.1:8111/load_object?objects=n".$row->nodeid."\">".$geom."</a></td>\n";
     echo "<td>".$row->ref."</td>\n";
     echo '<td>';
     foreach(explode('|', $row->img) as $i){
@@ -83,7 +83,7 @@ function show_unused_img(){ //{{{
         $dist = sprintf("%0.2f", $row2->dist);
         if ($dist < $max_ok_distance) $gp_class = ' class="ok"';
         if ($dist > 5000) $gp_class = ' class="bad"';
-        $gp_by_ref = '('.$dist.'m, <a href="http://localhost:8111/load_object?objects=n'.$row2->nodeid.'">'.$row2->nodeid.'</a>)';
+        $gp_by_ref = '('.$dist.'m, <a href="http://127.0.0.1:8111/load_object?objects=n'.$row2->nodeid.'">'.$row2->nodeid.'</a>)';
       }
       pg_free_result($res2);
     }
@@ -297,7 +297,11 @@ if(isset($_GET['fetch'])){ //{{{
   }
 
   //save response as backup for later
-  file_put_contents($photodb_file.".".strftime("%Y-%m-%d-%H-%M"), $response);
+  $json_filename = $photodb_file.".".strftime("%Y-%m-%d-%H-%M");
+  file_put_contents($json_filename, $response);
+  //link to last json file
+  @unlink($photodb_file);
+  @symlink($json_filename, $photodb_file);
 
   $query .= $response;
 
@@ -345,7 +349,7 @@ if(isset($_GET['analyse'])){ //{{{
 if(isset($_GET['analyse-run'])){ //{{{
   $lck = fopen($lock_file, 'w+') or die ('Cannot create lock file');
   if (!flock($lck, LOCK_EX | LOCK_NB)){
-    echo "A: some operation on GP allready running";
+    echo "AR: some operation on GP allready running";
     return;
   }
   
@@ -469,7 +473,7 @@ if(isset($_GET['analyse-run'])){ //{{{
     $geom = preg_replace('/POINT\(([-0-9.]{1,8})[0-9]* ([-0-9.]{1,8})[0-9]*\)/', '$2 $1', $n->geom);
     $img = '';
     echo "<td><a href=\"http://openstreetmap.org/node/".$n->id."\">".$n->id."</a></td>";
-    echo "<td><a target=\"hiddenIframe\" href=\"http://localhost:8111/load_object?objects=n".$n->id."\">".$geom."</a></td><td>".$n->ref."</td>";
+    echo "<td><a target=\"hiddenIframe\" href=\"http://127.0.0.1:8111/load_object?objects=n".$n->id."\">".$geom."</a></td><td>".$n->ref."</td>";
     if(isset($close[$n->id])) {
       echo '<td>';
       foreach($close[$n->id] as $d){
@@ -583,7 +587,7 @@ if(isset($_GET['all'])){ //{{{
     $geom = preg_replace('/POINT\(([-0-9.]{1,8})[0-9]* ([-0-9.]{1,8})[0-9]*\)/', '$2&nbsp$1', $row->geom);
     echo "<td><a href=\"http://openstreetmap.org/node/".$row->nodeid."\">".$row->nodeid."</a></td>\n";
     echo "<td><a target=\"hiddenIframe\"
-    href=\"http://localhost:8111/load_object?objects=n".$row->nodeid."\">".$geom."</a></td>\n";
+    href=\"http://127.0.0.1:8111/load_object?objects=n".$row->nodeid."\">".$geom."</a></td>\n";
     echo "<td>".$row->ref."</td>\n";
     echo '<td>';
     foreach(explode('|', $row->img) as $i){

+ 1 - 1
index.html

@@ -3,7 +3,7 @@
 <head>
     <title>OsmHiCheck</title>
     <meta charset="utf-8"/>
-    <link href='http://fonts.googleapis.com/css?family=PT+Sans&subset=latin-ext' rel='stylesheet' type='text/css'>
+    <link href='https://fonts.googleapis.com/css?family=PT+Sans&subset=latin-ext' rel='stylesheet' type='text/css'>
     <link rel="stylesheet" type="text/css" href="css/stylesheet.css"/>
 </head>
 

+ 1 - 1
tables/index.php

@@ -18,7 +18,7 @@ if(!(isset($_GET['pg']))){
 <head>
     <title>OsmHiCheck - Tabulky</title>
     <meta charset="utf-8"/>
-    <link href='http://fonts.googleapis.com/css?family=PT+Sans&subset=latin-ext' rel='stylesheet' type='text/css'>
+    <link href='https://fonts.googleapis.com/css?family=PT+Sans&subset=latin-ext' rel='stylesheet' type='text/css'>
     <link rel="stylesheet" type="text/css" href="css/stylesheet.css"/>
 </head>
 

+ 1 - 1
tables/table.php

@@ -110,7 +110,7 @@ $result = pg_query($db, $query);
                 ?>
 
         <tr>
-            <td><?php echo "<a target=\"hiddenIframe\" href=\"http://localhost:8111/load_object?relation_members=true&objects=r".$row['id']."\">".$row['id']."</a>"; ?></td>
+            <td><?php echo "<a target=\"hiddenIframe\" href=\"http://127.0.0.1:8111/load_object?relation_members=true&objects=r".$row['id']."\">".$row['id']."</a>"; ?></td>
             <?php
             /* vyber spravneho stylu na zaklade spravnosti prvku */
             $rid = $row['id'];