Fixing cookie.txt location during access to remote exchange rate server.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 20 May 2013 12:41:52 +0000 (14:41 +0200)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 10 Jun 2013 15:47:49 +0000 (17:47 +0200)
gl/includes/db/gl_db_rates.inc

index 9f0f101d12d742704a46f983591c4fb53a6705a0..f3237d55e575f9d78eea50daaa3ebb99ee0f03d2 100644 (file)
@@ -88,6 +88,8 @@ function retrieve_exrate($curr_b, $date)
 
 function get_extern_rate($curr_b, $provider = 'ECB', $date) 
 {
+       global  $path_to_root;
+
        $curr_a = get_company_pref('curr_default');
        if ($provider == 'ECB')
        {
@@ -118,7 +120,7 @@ function get_extern_rate($curr_b, $provider = 'ECB', $date)
                do {
               $ch = curl_init();
           curl_setopt ($ch, CURLOPT_URL, 'http://'.$site.$filename);
-              curl_setopt ($ch, CURLOPT_COOKIEJAR, "cookie.txt");
+              curl_setopt ($ch, CURLOPT_COOKIEJAR, "$path_to_root/tmp/cookie.txt");
           curl_setopt ($ch, CURLOPT_HEADER, 0);
               curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
               // prevent warning while save_mode/open_basedir on (redireciton doesn't occur at least on ECB page)