Changeset 2881
- Timestamp:
- Nov 15, 2008, 10:11:58 PM (15 years ago)
- Location:
- branches/2.0
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/admin/include/functions.php
r2776 r2881 1923 1923 } 1924 1924 1925 /** 1926 * Retrieve data from external URL 1927 * 1928 * @param string $src: URL 1929 * @param global $dest: can be a file ressource or string 1930 * @return bool 1931 */ 1932 function fetchRemote($src, &$dest, $user_agent='Piwigo', $step=0) 1933 { 1934 is_resource($dest) or $dest = ''; 1935 1936 // Try curl to read remote file 1937 if (function_exists('curl_init')) 1938 { 1939 $ch = @curl_init(); 1940 @curl_setopt($ch, CURLOPT_URL, $src); 1941 @curl_setopt($ch, CURLOPT_HEADER, 0); 1942 @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); 1943 is_resource($dest) ? 1944 @curl_setopt($ch, CURLOPT_FILE, $dest): 1945 @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 1946 $content = @curl_exec($ch); 1947 @curl_close($ch); 1948 if ($content !== false) 1949 { 1950 is_resource($dest) or $dest = $content; 1951 return true; 1952 } 1953 } 1954 1955 // Try file_get_contents to read remote file 1956 if (ini_get('allow_url_fopen')) 1957 { 1958 $content = @file_get_contents($src); 1959 if ($content !== false) 1960 { 1961 is_resource($dest) ? @fwrite($dest, $content) : $dest = $content; 1962 return true; 1963 } 1964 } 1965 1966 // Try fsockopen to read remote file 1967 if ($step > 3) 1968 { 1969 return false; 1970 } 1971 1972 $src = parse_url($src); 1973 $host = $src['host']; 1974 $path = isset($src['path']) ? $src['path'] : '/'; 1975 $path .= isset($src['query']) ? '?'.$src['query'] : ''; 1976 1977 if (($s = @fsockopen($host,80,$errno,$errstr,5)) === false) 1978 { 1979 return false; 1980 } 1981 1982 fwrite($s, 1983 "GET ".$path." HTTP/1.0\r\n" 1984 ."Host: ".$host."\r\n" 1985 ."User-Agent: ".$user_agent."\r\n" 1986 ."Accept: */*\r\n" 1987 ."\r\n" 1988 ); 1989 1990 $i = 0; 1991 $in_content = false; 1992 while (!feof($s)) 1993 { 1994 $line = fgets($s); 1995 1996 if (rtrim($line,"\r\n") == '' && !$in_content) 1997 { 1998 $in_content = true; 1999 $i++; 2000 continue; 2001 } 2002 if ($i == 0) 2003 { 2004 if (!preg_match('/HTTP\/(\\d\\.\\d)\\s*(\\d+)\\s*(.*)/',rtrim($line,"\r\n"), $m)) 2005 { 2006 fclose($s); 2007 return false; 2008 } 2009 $status = (integer) $m[2]; 2010 if ($status < 200 || $status >= 400) 2011 { 2012 fclose($s); 2013 return false; 2014 } 2015 } 2016 if (!$in_content) 2017 { 2018 if (preg_match('/Location:\s+?(.+)$/',rtrim($line,"\r\n"),$m)) 2019 { 2020 fclose($s); 2021 return fetchRemote(trim($m[1]),$dest,$user_agent,$step+1); 2022 } 2023 $i++; 2024 continue; 2025 } 2026 is_resource($dest) ? @fwrite($dest, $line) : $dest .= $line; 2027 $i++; 2028 } 2029 fclose($s); 2030 return true; 2031 } 2032 1925 2033 ?> -
branches/2.0/admin/include/functions_upgrade.php
r2839 r2881 128 128 129 129 array_push($page['infos'], 130 l10n('deactivated plugins') . '<pre>' . implode(', ', $plugins) . '</pre>');130 l10n('deactivated plugins').'<br /><br /><i>'.implode(', ', $plugins).'</i><br />'); 131 131 } 132 132 } -
branches/2.0/admin/include/plugins.class.php
r2701 r2881 269 269 $versions_to_check = array(); 270 270 $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php'; 271 if ($source = @file_get_contents($url) 272 and $pem_versions = @unserialize($source)) 271 if (fetchRemote($url, $result) and $pem_versions = @unserialize($result)) 273 272 { 274 273 if (!preg_match('/^\d+\.\d+\.\d+/', $version)) … … 309 308 $url .= implode(',', $plugins_to_check); 310 309 } 311 if ( $source = @file_get_contents($url))312 { 313 $pem_plugins = @unserialize($ source);310 if (fetchRemote($url, $result)) 311 { 312 $pem_plugins = @unserialize($result); 314 313 if (!is_array($pem_plugins)) 315 314 { … … 322 321 return true; 323 322 } 323 return false; 324 324 } 325 325 … … 358 358 $url = PEM_URL . '/download.php?rid=' . $revision; 359 359 $url .= '&origin=piwigo_' . $action; 360 if (@copy($url, $archive)) 361 { 360 361 if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle)) 362 { 363 fclose($handle); 362 364 include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php'); 363 365 $zip = new PclZip($archive); -
branches/2.0/admin/intro.php
r2529 r2881 43 43 if (isset($_GET['action']) and 'check_upgrade' == $_GET['action']) 44 44 { 45 if (! ini_get('allow_url_fopen'))45 if (!fetchRemote(PHPWG_URL.'/latest_version', $result)) 46 46 { 47 array_push( 48 $page['errors'], 49 l10n('Unable to check for upgrade since allow_url_fopen is disabled.') 50 ); 47 array_push($page['errors'], l10n('Unable to check for upgrade.')); 51 48 } 52 49 else 53 50 { 54 51 $versions = array('current' => PHPWG_VERSION); 55 $lines = @ file(PHPWG_URL.'/latest_version');52 $lines = @explode("\r\n", $result); 56 53 57 54 // if the current version is a BSF (development branch) build, we check -
branches/2.0/admin/plugins_new.php
r2652 r2881 90 90 // | start template output | 91 91 // +-----------------------------------------------------------------------+ 92 if (!ini_get('allow_url_fopen')) 93 { 94 array_push($page['errors'], l10n('Unable to retrieve server informations since allow_url_fopen is disabled.')); 95 } 96 elseif ($plugins->get_server_plugins(true)) 92 if ($plugins->get_server_plugins(true)) 97 93 { 98 94 $plugins->sort_server_plugins($order); -
branches/2.0/admin/plugins_update.php
r2652 r2881 98 98 // | start template output | 99 99 // +-----------------------------------------------------------------------+ 100 if (!ini_get('allow_url_fopen')) 101 { 102 array_push($page['errors'], l10n('Unable to connect to PEM server since allow_url_fopen is disabled.')); 103 } 104 elseif ($plugins->get_server_plugins()) 100 if ($plugins->get_server_plugins()) 105 101 { 106 102 foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) -
branches/2.0/language/de_DE/admin.lang.php
r2714 r2881 178 178 $lang['The %d following tag were deleted'] = 'Der folgende Tag wurde gelöscht'; 179 179 $lang['The %d following tags were deleted'] = 'Die folgenden %d Tags wurden gestrichen'; 180 $lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Unmöglich die neueste Version, die Funktion allow_url_fopen deaktiviert ist.';180 $lang['Unable to check for upgrade.'] = 'Unmöglich die neueste Version.'; 181 181 $lang['Uninstall'] = 'Deinstallieren'; 182 182 $lang['Use default sort order']='Verwenden Sie die Sortierung der Bilder Standard (definiert in der Konfigurationsdatei)'; -
branches/2.0/language/de_DE/upgrade.lang.php
r2864 r2881 22 22 // +-----------------------------------------------------------------------+ 23 23 24 /* TODO */25 24 $lang['Upgrade'] = 'Upgrade'; 26 $lang['introduction message'] = ' This page proposes to upgrade your database corresponding to your old version of Piwigo to the current version.27 The upgrade assistant thinks you are currently running a <strong>release %s</strong> (or equivalent).';28 $lang['Upgrade from %s to %s'] = 'Upgrade from version %s to%s';29 $lang['Statistics'] = 'Statisti cs';30 $lang['total upgrade time'] = ' total upgrade time';31 $lang['total SQL time'] = ' total SQL time';32 $lang['SQL queries'] = 'SQL queries';33 $lang['Upgrade informations'] = 'Upgrade informations';34 $lang['perform a maintenance check'] = ' Perform a maintenance check in [Administration>Specials>Maintenance] if you encounter any problem.';35 $lang['deactivated plugins'] = 'A s a precaution, following plugins have been deactivated. You must check for plugins upgrade before reactiving them:';36 $lang['upgrade login message'] = ' Only administrator can run upgrade: please sign in below.';37 $lang['You do not have access rights to run upgrade'] = ' You do not have access rights to run upgrade';38 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, before <b>?></b>, insert:';25 $lang['introduction message'] = 'Diese Seite schlägt vor aktualisieren Ihre Datenbank von Ihre alte Version von Piwigo auf die aktuelle Version. 26 Der Upgrade-Assistent denkt Sie derzeit ein <strong>Freigabe %s</strong> (oder gleichwertig).'; 27 $lang['Upgrade from %s to %s'] = 'Upgrade von Version %s bis %s'; 28 $lang['Statistics'] = 'Statistik'; 29 $lang['total upgrade time'] = 'insgesamt Upgrade-Zeit'; 30 $lang['total SQL time'] = 'insgesamt SQL-Zeit'; 31 $lang['SQL queries'] = 'SQL-Abfragen'; 32 $lang['Upgrade informations'] = 'Upgrade-Informationen'; 33 $lang['perform a maintenance check'] = 'Führen Sie einen Wartungs-Check am [Administration> Specials> Wartung], wenn Sie auf ein Problem stoßen'; 34 $lang['deactivated plugins'] = 'Als Vorsichtsmaßnahme folgenden Plugins wurden deaktiviert. Sie müssen prüfen, ob Plugins aktualisieren, bevor sie reactiving:'; 35 $lang['upgrade login message'] = 'Nur Administrator können Upgrade ausführen : Bitte melden Sie sich an unter.'; 36 $lang['You do not have access rights to run upgrade'] = 'Sie haben nicht das Recht auf Zugang zum Upgrade ausführen'; 37 $lang['in include/mysql.inc.php, before ?>, insert:'] = 'In <i>include/mysql.inc.php</i>, vor <b>?></b>, wird Folgendes eingefügt:'; 39 38 40 39 // Upgrade informations from upgrade_1.3.1.php 41 $lang['all sub-categories of private categories become private'] = 'All sub-categories of private categories become private';42 $lang['user permissions and group permissions have been erased'] = ' User permissions and group permissions have been erased';43 $lang['only thumbnails prefix and webmaster mail saved'] = ' Only thumbnails prefix and webmaster mail address have been saved from previous configuration';40 $lang['all sub-categories of private categories become private'] = 'Alle Unter-Kategorien von privaten Gruppen wirden privaten'; 41 $lang['user permissions and group permissions have been erased'] = 'Benutzer und Gruppen Berechtigungen wurden gelöscht'; 42 $lang['only thumbnails prefix and webmaster mail saved'] = 'Nur Miniaturansichten Präfix und Webmaster Mail-Adresse gespeichert wurden aus früheren Konfiguration'; 44 43 45 44 ?> -
branches/2.0/language/en_UK/admin.lang.php
r2678 r2881 178 178 $lang['The %d following tag were deleted'] = 'The following tag were deleted'; 179 179 $lang['The %d following tags were deleted'] = 'The %d following tags were deleted'; 180 $lang['Unable to check for upgrade since allow_url_fopen is disabled.'] = 'Unable to check for upgrade since allow_url_fopen is disabled.';180 $lang['Unable to check for upgrade.'] = 'Unable to check for upgrade.'; 181 181 $lang['Uninstall'] = 'Uninstall'; 182 182 $lang['Use default sort order']='Use the default image sort order (defined in the configuration file)'; -
branches/2.0/language/es_ES/admin.lang.php
r2821 r2881 178 178 $lang['The %d following tag were deleted'] = 'El tag siguiente ha sido suprimido'; 179 179 $lang['The %d following tags were deleted'] = 'Los %d tags siguientes han sido suprimidos'; 180 $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.';180 $lang['Unable to check for upgrade.'] = 'Imposible conocer la última versión.'; 181 181 $lang['Uninstall'] = 'Desinstalar'; 182 182 $lang['Use default sort order']='Utilizar la orden de selección de las imágenes por defecto (definido en el fichero de configuración)'; -
branches/2.0/language/fr_FR/admin.lang.php
r2678 r2881 178 178 $lang['The %d following tag were deleted'] = 'Le tag suivant a été supprimé'; 179 179 $lang['The %d following tags were deleted'] = 'Les %d tags suivants ont été supprimés'; 180 $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.';180 $lang['Unable to check for upgrade.'] = 'Impossible de connaître la dernière version.'; 181 181 $lang['Uninstall'] = 'Désinstaller'; 182 182 $lang['Use default sort order']='Utiliser l\'ordre de tri des images par défaut (défini dans le fichier de configuration)'; -
branches/2.0/language/it_IT/admin.lang.php
r2872 r2881 178 178 $lang['The %d following tag were deleted'] = 'Il tag seguente è stato cancellato'; 179 179 $lang['The %d following tags were deleted'] = 'I %d tags seguenti sono stati cancellati'; 180 $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.';180 $lang['Unable to check for upgrade.'] = 'Non è stato possibile identificare l\'ultima versione.'; 181 181 $lang['Uninstall'] = 'Disinstallare'; 182 182 $lang['Use default sort order']='Usare l\'ordinamento delle immagini di defaut (cosi come definito nel file di configurazione)'; -
branches/2.0/language/nl_NL/admin.lang.php
r2685 r2881 178 178 $lang['The %d following tag were deleted'] = 'De volgende tag is verwijderd'; 179 179 $lang['The %d following tags were deleted'] = 'De %d volgende tags zijn verwijderd'; 180 $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.';180 $lang['Unable to check for upgrade.'] = 'Onnmoglijk om een controlle te doen voor een upgrade.'; 181 181 $lang['Uninstall'] = 'Deinstalleren'; 182 182 $lang['Use default sort order']='Gebruik de standaard sortering (defineerd in de configuratie file)';
Note: See TracChangeset
for help on using the changeset viewer.