mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 00:58:55 +01:00
fix not working download of holidays from egroupware.org, caused by not working redirect with old network class, now replaced with standard php http wrapper and use egw_framework::proxy_context() for optional proxy server
This commit is contained in:
parent
215baf7497
commit
cd9b6b77fe
@ -264,7 +264,6 @@
|
|||||||
|
|
||||||
/* get the file that contains the calendar events for your locale */
|
/* get the file that contains the calendar events for your locale */
|
||||||
/* "http://www.egroupware.org/cal/holidays.US.csv"; */
|
/* "http://www.egroupware.org/cal/holidays.US.csv"; */
|
||||||
$network =& CreateObject('phpgwapi.network');
|
|
||||||
if(isset($GLOBALS['egw_info']['server']['holidays_url_path']) && $GLOBALS['egw_info']['server']['holidays_url_path'] != 'localhost')
|
if(isset($GLOBALS['egw_info']['server']['holidays_url_path']) && $GLOBALS['egw_info']['server']['holidays_url_path'] != 'localhost')
|
||||||
{
|
{
|
||||||
$load_from = $GLOBALS['egw_info']['server']['holidays_url_path'];
|
$load_from = $GLOBALS['egw_info']['server']['holidays_url_path'];
|
||||||
@ -284,11 +283,12 @@
|
|||||||
// echo 'Loading from: '.$load_from.'/holidays.'.strtoupper($locale).'.csv'."<br>\n";
|
// echo 'Loading from: '.$load_from.'/holidays.'.strtoupper($locale).'.csv'."<br>\n";
|
||||||
if($GLOBALS['egw_info']['server']['holidays_url_path'] == 'localhost')
|
if($GLOBALS['egw_info']['server']['holidays_url_path'] == 'localhost')
|
||||||
{
|
{
|
||||||
$lines = @file(EGW_SERVER_ROOT.'/calendar/egroupware.org/holidays.'.strtoupper($locale).'.csv');
|
$lines = file(EGW_SERVER_ROOT.'/calendar/egroupware.org/holidays.'.strtoupper($locale).'.csv');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$lines = $network->gethttpsocketfile($load_from.'/holidays.'.strtoupper($locale).'.csv');
|
$lines = file($url=$load_from.'/holidays.'.strtoupper($locale).'.csv', 0, egw_framework::proxy_context());
|
||||||
|
//error_log(__METHOD__."('$locale', $year) file('$url')=".array2string($lines));
|
||||||
}
|
}
|
||||||
if (!$lines)
|
if (!$lines)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user