Changeset 426 for trunk/admin/modules/Elezioni/aggiornamento.php
- Timestamp:
- Oct 4, 2024, 12:14:01 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/aggiornamento.php
r424 r426 150 150 echo "<form name=\"conferma\" action=\"admin.php\"><input type=\"hidden\" name=\"errmex\" value=\"1\"><input type=\"hidden\" name=\"op\" value=\"aggiorna\">"; 151 151 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"procedi\" value=\"1\">"; 152 echo "<br><table align=\"center\"><tr><td><h3>Procedo con verifica e aggiornamento del solo db (all'ultima versione scaricata)?< /h3></td><td><input type=\"submit\" name=\"vai\" value=\""._OK."\"></td></tr></table></form>";152 echo "<br><table align=\"center\"><tr><td><h3>Procedo con verifica e aggiornamento del solo db (all'ultima versione scaricata)?<br><i>E' consigliato procedere solo dopo aver prodotto una copia di backup</i></h3></td><td><input type=\"submit\" name=\"vai\" value=\""._OK."\"></td></tr></table></form>"; 153 153 }else{ 154 154 aggiornadb(); … … 160 160 if(phpversion()<5.6) $host="http://80.211.143.127"; 161 161 else $host="https://trac.eleonline.it"; 162 163 $headers=get_headers("$host/ele3/changeset/"); 164 165 $testurl=strlen($headers[0])>0?true:false; 166 if($testurl){ 167 $file = file("$host/ele3/changeset/"); 168 $cntFile = count($file); 169 $fine=0; 170 $currentLine=0; 171 foreach ($file as $line_num => $line) { 172 if(strpos($line,'<title>') ) {$fine=1; continue;} 173 if ($fine){ 174 $newrev=(int) filter_var($line, FILTER_SANITIZE_NUMBER_INT); 175 $_SESSION['remoterev']=$newrev; 176 break; 177 } 178 } 179 unset($file); 162 ###################### 163 $rev=0; 164 if ($stream = fopen('http://mail.eleonline.it/version/risposta.php', 'r')) { 165 $rev= stream_get_contents($stream, 4); 166 fclose($stream); 167 168 $newrev=(int) filter_var($rev, FILTER_SANITIZE_NUMBER_INT); 169 $_SESSION['remoterev']=$newrev; 180 170 }else{ 181 171 $errmex=2; … … 183 173 } 184 174 #$newrev=$_SESSION['remoterev']; 185 $myrev=$_SESSION['localrev']; 175 #$myrev=$_SESSION['localrev']; 176 include('versione.php'); 177 $myrev=intval(substr($versione,-4,4)); 178 $_SESSION['localrev']=$myrev; 179 186 180 if (isset($_SESSION['forzadb'])) $myrev=378; 187 181 if($newrev<=$myrev) { … … 213 207 { 214 208 echo '<p class="title"><a href="'. $item->link .'">' . $item->title . "</a></p>"; 215 #$str=preg_replace("--", "<br>--", $item->description );216 209 $str=preg_replace('/\s\--/','<br>--',$item->description); 217 #$str=preg_replace("[^A-Za-z0-9\-]", "<br>", $item->description ); 218 # $str=preg_replace('/\s\`echo "\040"`/','<br>--',$item->description); 219 # $str=htmlentities($item->description); 220 echo "<p class='desc'>" . $str . "</p>"; 210 echo "<p class='desc'>" . $str . "</p>"; 221 211 } 222 212 echo "</div>"; … … 228 218 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"procedi\" value=\"1\">"; 229 219 echo "<br><table align=\"center\"><tr><td><h3>Procedo con l'aggiornamento?</h3></td><td><input type=\"submit\" name=\"vai\" value=\""._OK."\"></td></tr></table></form>"; 230 /* echo "<br><textarea name=\"log\" rows=\"15\" cols=\"150\">";231 foreach ($file as $line_num => $line) echo "$line";232 233 echo "</textarea>";234 ############Ã */235 220 $filename = "$host/ele3/changeset?format=zip&new=$newrev&new_path=%2F&old=$myrev&old_path=%2F"; 236 221
Note:
See TracChangeset
for help on using the changeset viewer.