Changeset 5967
- Timestamp:
- 07/08/08 13:48:45 (2 months ago)
- Files:
-
- freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php (modified) (4 diffs)
- freepbx/trunk/amportal.conf (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/admin/functions.inc.php
r5960 r5967 59 59 'XTNCONFLICTABORT' => array('bool' , false), 60 60 'USEDEVSTATE' => array('bool' , false), 61 'MODULEADMINWGET'=> array('bool' , false), 61 62 ); 62 63 … … 2132 2133 } 2133 2134 //$fn = "/usr/src/freepbx-modules/modules.xml"; 2134 $data = @ file_get_contents($fn); 2135 if (!$amp_conf['MODULEADMINWGET']) { 2136 $data = @ file_get_contents($fn); 2137 } else { 2138 $data = ""; 2139 } 2135 2140 2136 2141 if (empty($data)) { … … 2746 2751 } 2747 2752 2748 if (!$dp = @fopen($url,'r')) { 2749 return array(sprintf(_("Error opening %s for reading"), $url)); 2753 // Check MODULEADMINWGET first so we don't execute the fopen() if set 2754 // 2755 if ($amp_conf['MODULEADMINWGET'] || !$dp = @fopen($url,'r')) { 2756 exec("wget -O $filename $url 2> /dev/null", $filedata, $retcode); 2757 if ($retcode != 0) { 2758 return array(sprintf(_("Error opening %s for reading"), $url)); 2759 } else { 2760 if (!$dp = @fopen($filename,'r')) { 2761 return array(sprintf(_("Error opening %s for reading"), $url)); 2762 } 2763 } 2750 2764 } 2751 2765 … … 3340 3354 } 3341 3355 3342 $announcement = @ file_get_contents("http://mirror.freepbx.org/version-".getversion().".html".$options); 3356 if (!$amp_conf['MODULEADMINWGET']) { 3357 $announcement = @ file_get_contents("http://mirror.freepbx.org/version-".getversion().".html".$options); 3358 } else { 3359 $announcement = ''; 3360 } 3361 if (empty($announcement)) { 3362 exec("wget -O - $fn 2> /dev/null", $data_arr, $retcode); 3363 $announcement = implode("\n",$data_arr); 3364 } 3343 3365 return $announcement; 3344 3366 } freepbx/trunk/amportal.conf
r5819 r5967 146 146 # SERVERINTITLE if set to true, the browser title will be preceded with the server name. default false 147 147 SERVERINTITLE=false 148 149 # USEDEVSTATE = true DEFAULT VALUE false 150 # If this is set, it assumes that you are running Asterisk 1.4 or higher and want to take advantage of the 151 # func_devstate.c backport available from Asterisk 1.6 which allows custom hints to be created to support 152 # BLF for server side feature codes such as daynight, followme, etc. 153 # 154 USEDEVSTATE=true 155 156 # MODULEADMINWGET=true DEFAULT VALUE false 157 # Module Admin normally tries to get its online information through direct file open type calls to URLs that 158 # go back to the freepbx.org server. If it fails, typically because of content filters in firewalls that don't 159 # like the way PHP formats the requests, the code will fall back and try a wget to pull the information. 160 # This will often solve the problem. However, in such environemnts there can be a significant timeout before 161 # the failed file open calls to the URLs return and there are often 2-3 of these that occur. Setting this value 162 # will force FreePBX to avoid the attempt to open the URL and go straight to the wget calls. 163 # 164 MODULEADMINWGET=true
