Changeset 2902 for trunk/admin
- Timestamp:
- Nov 23, 2008, 6:23:57 PM (15 years ago)
- Location:
- trunk/admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r2900 r2902 1949 1949 function fetchRemote($src, &$dest, $user_agent='Piwigo', $step=0) 1950 1950 { 1951 // Try to retrieve data from local file? 1952 if (!url_is_remote($src)) 1953 { 1954 $content = @file_get_contents($src); 1955 if ($content !== false) 1956 { 1957 is_resource($dest) ? @fwrite($dest, $content) : $dest = $content; 1958 return true; 1959 } 1960 else 1961 { 1962 return false; 1963 } 1964 } 1965 1951 1966 // After 3 redirections, return false 1952 1967 if ($step > 3) return false; … … 1965 1980 $content = @curl_exec($ch); 1966 1981 $header_length = @curl_getinfo($ch, CURLINFO_HEADER_SIZE); 1982 $status = @curl_getinfo($ch, CURLINFO_HTTP_CODE); 1967 1983 @curl_close($ch); 1968 if ($content !== false )1984 if ($content !== false and $status >= 200 and $status < 400) 1969 1985 { 1970 1986 if (preg_match('/Location:\s+?(.+)/', substr($content, 0, $header_length), $m)) -
trunk/admin/site_manager.php
r2530 r2902 45 45 global $template, $page; 46 46 47 if($lines = @file($url)) 48 { 47 if (fetchRemote($url, $result)) 48 { 49 $lines = explode("\r\n", $result); 49 50 // cleaning lines from HTML tags 50 51 foreach ($lines as $line) … … 113 114 $clf_url.= '?action=test'; 114 115 $clf_url.= '&version='.PHPWG_VERSION; 115 if ( ($lines = @file($clf_url)) !== false)116 if (fetchRemote($clf_url, $result)) 116 117 { 118 $lines = explode("\r\n", $result); 117 119 $first_line = strip_tags($lines[0]); 118 120 if (!preg_match('/^PWG-INFO-2:/', $first_line)) -
trunk/admin/site_reader_remote.php
r2299 r2902 49 49 if (!isset($listing_url)) 50 50 { 51 $this->listing_url = $this->site_url.' /listing.xml';51 $this->listing_url = $this->site_url.'listing.xml'; 52 52 } 53 53 else … … 66 66 global $errors; 67 67 68 if ( @fopen($this->listing_url, 'r'))68 if ($xml_content = getXmlCode($this->listing_url)) 69 69 { 70 70 $this->site_dirs = array(); 71 71 $this->site_files = array(); 72 $xml_content = getXmlCode($this->listing_url);73 72 $info_xml_element = getChild($xml_content, 'informations'); 74 73 if (getAttribute($info_xml_element , 'phpwg_version') != PHPWG_VERSION) -
trunk/admin/template/goto/install.tpl
r2819 r2902 146 146 </table> 147 147 </form> 148 {else} 149 <p> 150 <br /> 151 <input type="button" name="index" value="{'home'|@translate}" onClick="document.location = 'index.php';"/> 152 <input type="button" name="identification" value="{'Identification'|@translate}" onClick="document.location = 'identification.php';"/> 153 </p> 148 154 {/if} 149 155 </div> {* content *}
Note: See TracChangeset
for help on using the changeset viewer.