Index: /branches/2.0/admin/include/functions.php
===================================================================
--- /branches/2.0/admin/include/functions.php	(revision 2880)
+++ /branches/2.0/admin/include/functions.php	(revision 2881)
@@ -1923,3 +1923,111 @@
 }
 
+/**
+ * Retrieve data from external URL
+ *
+ * @param string $src: URL
+ * @param global $dest: can be a file ressource or string
+ * @return bool
+ */
+function fetchRemote($src, &$dest, $user_agent='Piwigo', $step=0)
+{
+  is_resource($dest) or $dest = '';
+
+  // Try curl to read remote file
+  if (function_exists('curl_init'))
+  {
+    $ch = @curl_init();
+    @curl_setopt($ch, CURLOPT_URL, $src);
+    @curl_setopt($ch, CURLOPT_HEADER, 0);
+    @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
+    is_resource($dest) ?
+      @curl_setopt($ch, CURLOPT_FILE, $dest):
+      @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    $content = @curl_exec($ch);
+    @curl_close($ch);
+    if ($content !== false)
+    {
+      is_resource($dest) or $dest = $content;
+      return true;
+    }
+  }
+
+  // Try file_get_contents to read remote file
+  if (ini_get('allow_url_fopen'))
+  {
+    $content = @file_get_contents($src);
+    if ($content !== false)
+    {
+      is_resource($dest) ? @fwrite($dest, $content) : $dest = $content;
+      return true;
+    }
+  }
+
+  // Try fsockopen to read remote file
+  if ($step > 3)
+  {
+    return false;
+  }
+
+  $src = parse_url($src);
+  $host = $src['host'];
+  $path = isset($src['path']) ? $src['path'] : '/';
+  $path .= isset($src['query']) ? '?'.$src['query'] : '';
+  
+  if (($s = @fsockopen($host,80,$errno,$errstr,5)) === false)
+  {
+    return false;
+  }
+
+  fwrite($s,
+    "GET ".$path." HTTP/1.0\r\n"
+    ."Host: ".$host."\r\n"
+    ."User-Agent: ".$user_agent."\r\n"
+    ."Accept: */*\r\n"
+    ."\r\n"
+  );
+
+  $i = 0;
+  $in_content = false;
+  while (!feof($s))
+  {
+    $line = fgets($s);
+
+    if (rtrim($line,"\r\n") == '' && !$in_content)
+    {
+      $in_content = true;
+      $i++;
+      continue;
+    }
+    if ($i == 0)
+    {
+      if (!preg_match('/HTTP\/(\\d\\.\\d)\\s*(\\d+)\\s*(.*)/',rtrim($line,"\r\n"), $m))
+      {
+        fclose($s);
+        return false;
+      }
+      $status = (integer) $m[2];
+      if ($status < 200 || $status >= 400)
+      {
+        fclose($s);
+        return false;
+      }
+    }
+    if (!$in_content)
+    {
+      if (preg_match('/Location:\s+?(.+)$/',rtrim($line,"\r\n"),$m))
+      {
+        fclose($s);
+        return fetchRemote(trim($m[1]),$dest,$user_agent,$step+1);
+      }
+      $i++;
+      continue;
+    }
+    is_resource($dest) ? @fwrite($dest, $line) : $dest .= $line;
+    $i++;
+  }
+  fclose($s);
+  return true;
+}
+
 ?>
Index: /branches/2.0/admin/include/functions_upgrade.php
===================================================================
--- /branches/2.0/admin/include/functions_upgrade.php	(revision 2880)
+++ /branches/2.0/admin/include/functions_upgrade.php	(revision 2881)
@@ -128,5 +128,5 @@
 
     array_push($page['infos'],
-      l10n('deactivated plugins') . '<pre>' . implode(', ', $plugins) . '</pre>');
+      l10n('deactivated plugins').'<br /><br /><i>'.implode(', ', $plugins).'</i><br />');
   }
 }
Index: /branches/2.0/admin/include/pclzip.lib.php
===================================================================
--- /branches/2.0/admin/include/pclzip.lib.php	(revision 2880)
+++ /branches/2.0/admin/include/pclzip.lib.php	(revision 2881)
Index: /branches/2.0/admin/include/plugins.class.php
===================================================================
--- /branches/2.0/admin/include/plugins.class.php	(revision 2880)
+++ /branches/2.0/admin/include/plugins.class.php	(revision 2881)
@@ -269,6 +269,5 @@
     $versions_to_check = array();
     $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php';
-    if ($source = @file_get_contents($url)
-      and $pem_versions = @unserialize($source))
+    if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
     {
       if (!preg_match('/^\d+\.\d+\.\d+/', $version))
@@ -309,7 +308,7 @@
       $url .= implode(',', $plugins_to_check);
     }
-    if ($source = @file_get_contents($url))
-    {
-      $pem_plugins = @unserialize($source);
+    if (fetchRemote($url, $result))
+    {
+      $pem_plugins = @unserialize($result);
       if (!is_array($pem_plugins))
       {
@@ -322,4 +321,5 @@
       return true;
     }
+    return false;
   }
   
@@ -358,6 +358,8 @@
       $url = PEM_URL . '/download.php?rid=' . $revision;
       $url .= '&origin=piwigo_' . $action;
-      if (@copy($url, $archive))
-      {
+
+      if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
+      {
+        fclose($handle);
         include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');
         $zip = new PclZip($archive);
Index: /branches/2.0/admin/intro.php
===================================================================
--- /branches/2.0/admin/intro.php	(revision 2880)
+++ /branches/2.0/admin/intro.php	(revision 2881)
@@ -43,15 +43,12 @@
 if (isset($_GET['action']) and 'check_upgrade' == $_GET['action'])
 {
-  if (!ini_get('allow_url_fopen'))
+  if (!fetchRemote(PHPWG_URL.'/latest_version', $result))
   {
-    array_push(
-      $page['errors'],
-      l10n('Unable to check for upgrade since allow_url_fopen is disabled.')
-      );
+    array_push($page['errors'], l10n('Unable to check for upgrade.'));
   }
   else
   {
     $versions = array('current' => PHPWG_VERSION);
-    $lines = @file(PHPWG_URL.'/latest_version');
+    $lines = @explode("\r\n", $result);
 
     // if the current version is a BSF (development branch) build, we check
Index: /branches/2.0/admin/plugins_new.php
===================================================================
--- /branches/2.0/admin/plugins_new.php	(revision 2880)
+++ /branches/2.0/admin/plugins_new.php	(revision 2881)
@@ -90,9 +90,5 @@
 // |                     start template output                             |
 // +-----------------------------------------------------------------------+
-if (!ini_get('allow_url_fopen'))
-{
-  array_push($page['errors'], l10n('Unable to retrieve server informations since allow_url_fopen is disabled.'));
-}
-elseif ($plugins->get_server_plugins(true))
+if ($plugins->get_server_plugins(true))
 {
   $plugins->sort_server_plugins($order);
Index: /branches/2.0/admin/plugins_update.php
===================================================================
--- /branches/2.0/admin/plugins_update.php	(revision 2880)
+++ /branches/2.0/admin/plugins_update.php	(revision 2881)
@@ -98,9 +98,5 @@
 // |                     start template output                             |
 // +-----------------------------------------------------------------------+
-if (!ini_get('allow_url_fopen'))
-{
-  array_push($page['errors'], l10n('Unable to connect to PEM server since allow_url_fopen is disabled.'));
-}
-elseif ($plugins->get_server_plugins())
+if ($plugins->get_server_plugins())
 {
   foreach($plugins->fs_plugins as $plugin_id => $fs_plugin)
Index: /branches/2.0/language/de_DE/admin.lang.php
===================================================================
--- /branches/2.0/language/de_DE/admin.lang.php	(revision 2880)
+++ /branches/2.0/language/de_DE/admin.lang.php	(revision 2881)
@@ -178,5 +178,5 @@
 $lang['The %d following tag were deleted'] = 'Der folgende Tag wurde gelöscht';
 $lang['The %d following tags were deleted'] = 'Die folgenden %d Tags wurden gestrichen';
-$lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Unmöglich die neueste Version, die Funktion allow_url_fopen deaktiviert ist.';
+$lang['Unable to check for upgrade.'] = 'Unmöglich die neueste Version.';
 $lang['Uninstall'] = 'Deinstallieren';
 $lang['Use default sort order']='Verwenden Sie die Sortierung der Bilder Standard (definiert in der Konfigurationsdatei)';
Index: /branches/2.0/language/de_DE/upgrade.lang.php
===================================================================
--- /branches/2.0/language/de_DE/upgrade.lang.php	(revision 2880)
+++ /branches/2.0/language/de_DE/upgrade.lang.php	(revision 2881)
@@ -22,24 +22,23 @@
 // +-----------------------------------------------------------------------+
 
-/* TODO */
 $lang['Upgrade'] = 'Upgrade';
-$lang['introduction message'] = 'This page proposes to upgrade your database corresponding to your old version of Piwigo to the current version.
-The upgrade assistant thinks you are currently running a <strong>release %s</strong> (or equivalent).';
-$lang['Upgrade from %s to %s'] = 'Upgrade from version %s to %s';
-$lang['Statistics'] = 'Statistics';
-$lang['total upgrade time'] = 'total upgrade time';
-$lang['total SQL time'] = 'total SQL time';
-$lang['SQL queries'] = 'SQL queries';
-$lang['Upgrade informations'] = 'Upgrade informations';
-$lang['perform a maintenance check'] = 'Perform a maintenance check in [Administration>Specials>Maintenance] if you encounter any problem.';
-$lang['deactivated plugins'] = 'As a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:';
-$lang['upgrade login message'] = 'Only administrator can run upgrade: please sign in below.';
-$lang['You do not have access rights to run upgrade'] = 'You do not have access rights to run upgrade';
-$lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, before <b>?></b>, insert:';
+$lang['introduction message'] = 'Diese Seite schlägt vor aktualisieren Ihre Datenbank von Ihre alte Version von Piwigo auf die aktuelle Version.
+Der Upgrade-Assistent denkt Sie derzeit ein <strong>Freigabe %s</strong> (oder gleichwertig).';
+$lang['Upgrade from %s to %s'] = 'Upgrade von Version %s bis %s';
+$lang['Statistics'] = 'Statistik';
+$lang['total upgrade time'] = 'insgesamt Upgrade-Zeit';
+$lang['total SQL time'] = 'insgesamt SQL-Zeit';
+$lang['SQL queries'] = 'SQL-Abfragen';
+$lang['Upgrade informations'] = 'Upgrade-Informationen';
+$lang['perform a maintenance check'] = 'Führen Sie einen Wartungs-Check am [Administration> Specials> Wartung], wenn Sie auf ein Problem stoßen';
+$lang['deactivated plugins'] = 'Als Vorsichtsmaßnahme folgenden Plugins wurden deaktiviert. Sie müssen prüfen, ob Plugins aktualisieren, bevor sie reactiving:';
+$lang['upgrade login message'] = 'Nur Administrator können Upgrade ausführen : Bitte melden Sie sich an unter.';
+$lang['You do not have access rights to run upgrade'] = 'Sie haben nicht das Recht auf Zugang zum Upgrade ausführen';
+$lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, vor <b>?></b>, wird Folgendes eingefügt:';
 
 // Upgrade informations from upgrade_1.3.1.php
-$lang['all sub-categories of private categories become private'] = 'All sub-categories of private categories become private';
-$lang['user permissions and group permissions have been erased'] = 'User permissions and group permissions have been erased';
-$lang['only thumbnails prefix and webmaster mail saved'] = 'Only thumbnails prefix and webmaster mail address have been saved from previous configuration';
+$lang['all sub-categories of private categories become private'] = 'Alle Unter-Kategorien von privaten Gruppen wirden privaten';
+$lang['user permissions and group permissions have been erased'] = 'Benutzer und Gruppen Berechtigungen wurden gelöscht';
+$lang['only thumbnails prefix and webmaster mail saved'] = 'Nur Miniaturansichten Präfix und Webmaster Mail-Adresse gespeichert wurden aus früheren Konfiguration';
 
 ?>
Index: /branches/2.0/language/en_UK/admin.lang.php
===================================================================
--- /branches/2.0/language/en_UK/admin.lang.php	(revision 2880)
+++ /branches/2.0/language/en_UK/admin.lang.php	(revision 2881)
@@ -178,5 +178,5 @@
 $lang['The %d following tag were deleted'] = 'The following tag were deleted';
 $lang['The %d following tags were deleted'] = 'The %d following tags were deleted';
-$lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Unable to check for upgrade since allow_url_fopen is disabled.';
+$lang['Unable to check for upgrade.'] = 'Unable to check for upgrade.';
 $lang['Uninstall'] = 'Uninstall';
 $lang['Use default sort order']='Use the default image sort order (defined in the configuration file)';
Index: /branches/2.0/language/es_ES/admin.lang.php
===================================================================
--- /branches/2.0/language/es_ES/admin.lang.php	(revision 2880)
+++ /branches/2.0/language/es_ES/admin.lang.php	(revision 2881)
@@ -178,5 +178,5 @@
 $lang['The %d following tag were deleted'] = 'El tag siguiente ha sido suprimido';
 $lang['The %d following tags were deleted'] = 'Los %d tags siguientes han sido suprimidos';
-$lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Imposible conocer la última versión cat la función allow_url_fopen es desactivada.';
+$lang['Unable to check for upgrade.'] = 'Imposible conocer la última versión.';
 $lang['Uninstall'] = 'Desinstalar';
 $lang['Use default sort order']='Utilizar la orden de selección de las imágenes por defecto (definido en el fichero de configuración)';
Index: /branches/2.0/language/fr_FR/admin.lang.php
===================================================================
--- /branches/2.0/language/fr_FR/admin.lang.php	(revision 2880)
+++ /branches/2.0/language/fr_FR/admin.lang.php	(revision 2881)
@@ -178,5 +178,5 @@
 $lang['The %d following tag were deleted'] = 'Le tag suivant a été supprimé';
 $lang['The %d following tags were deleted'] = 'Les %d tags suivants ont été supprimés';
-$lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Impossible de connaître la dernière version car la fonction allow_url_fopen est désactivée.';
+$lang['Unable to check for upgrade.'] = 'Impossible de connaître la dernière version.';
 $lang['Uninstall'] = 'Désinstaller';
 $lang['Use default sort order']='Utiliser l\'ordre de tri des images par défaut (défini dans le fichier de configuration)';
Index: /branches/2.0/language/it_IT/admin.lang.php
===================================================================
--- /branches/2.0/language/it_IT/admin.lang.php	(revision 2880)
+++ /branches/2.0/language/it_IT/admin.lang.php	(revision 2881)
@@ -178,5 +178,5 @@
 $lang['The %d following tag were deleted'] = 'Il tag seguente è stato cancellato';
 $lang['The %d following tags were deleted'] = 'I %d tags seguenti sono stati cancellati';
-$lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Non è stato possibile identificare l\'ultima versione a causa della funzione allow_url_fopen tuttora disattiva.';
+$lang['Unable to check for upgrade.'] = 'Non è stato possibile identificare l\'ultima versione.';
 $lang['Uninstall'] = 'Disinstallare';
 $lang['Use default sort order']='Usare l\'ordinamento delle immagini di defaut (cosi come definito nel file di configurazione)';
Index: /branches/2.0/language/nl_NL/admin.lang.php
===================================================================
--- /branches/2.0/language/nl_NL/admin.lang.php	(revision 2880)
+++ /branches/2.0/language/nl_NL/admin.lang.php	(revision 2881)
@@ -178,5 +178,5 @@
 $lang['The %d following tag were deleted'] = 'De volgende tag is verwijderd';
 $lang['The %d following tags were deleted'] = 'De %d volgende tags zijn verwijderd';
-$lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Onnmoglijk om een controlle te doen voor een upgrade omdat allow_url_fopen is uitgeschakeld.';
+$lang['Unable to check for upgrade.'] = 'Onnmoglijk om een controlle te doen voor een upgrade.';
 $lang['Uninstall'] = 'Deinstalleren';
 $lang['Use default sort order']='Gebruik de standaard sortering (defineerd in de configuratie file)';
