Rev 484 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 484 | Rev 496 | ||
---|---|---|---|
Line 132... | Line 132... | ||
132 | if (!function_exists('curl_init')) { |
132 | if (!function_exists('curl_init')) { |
133 | throw new Exception(_L('The "%1" PHP extension is not installed at your system. Please enable the PHP extension <code>%2</code>.','CURL','php_curl')); |
133 | throw new Exception(_L('The "%1" PHP extension is not installed at your system. Please enable the PHP extension <code>%2</code>.','CURL','php_curl')); |
134 | } |
134 | } |
135 | 135 | ||
136 | $ch = curl_init(); |
136 | $ch = curl_init(); |
137 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::basePath() . '/3p/certs/cacert.pem'); |
137 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::localpath() . '3p/certs/cacert.pem'); |
138 | curl_setopt($ch, CURLOPT_URL, 'https://oidplus.viathinksoft.com/reg2/query.php'); |
138 | curl_setopt($ch, CURLOPT_URL, 'https://oidplus.viathinksoft.com/reg2/query.php'); |
139 | curl_setopt($ch, CURLOPT_POST, 1); |
139 | curl_setopt($ch, CURLOPT_POST, 1); |
140 | if (function_exists('gzdeflate')) { |
140 | if (function_exists('gzdeflate')) { |
141 | $compressed = "1"; |
141 | $compressed = "1"; |
142 | $data2 = gzdeflate(json_encode($data)); |
142 | $data2 = gzdeflate(json_encode($data)); |
Line 202... | Line 202... | ||
202 | public function sendRegistrationQuery($privacy_level=null) { |
202 | public function sendRegistrationQuery($privacy_level=null) { |
203 | if (is_null($privacy_level)) { |
203 | if (is_null($privacy_level)) { |
204 | $privacy_level = OIDplus::config()->getValue('reg_privacy'); |
204 | $privacy_level = OIDplus::config()->getValue('reg_privacy'); |
205 | } |
205 | } |
206 | 206 | ||
207 | $system_url = OIDplus::getSystemUrl(); |
207 | $system_url = OIDplus::webpath(); |
208 | 208 | ||
209 | // It is very important that we set the ping time NOW, because ViaThinkSoft might contact us during the ping, |
209 | // It is very important that we set the ping time NOW, because ViaThinkSoft might contact us during the ping, |
210 | // and this would cause an endless loop! |
210 | // and this would cause an endless loop! |
211 | OIDplus::config()->setValue('reg_last_ping', time()); |
211 | OIDplus::config()->setValue('reg_last_ping', time()); |
212 | 212 | ||
Line 235... | Line 235... | ||
235 | if (!function_exists('curl_init')) { |
235 | if (!function_exists('curl_init')) { |
236 | return false; // throw new Exception(_L('The "%1" PHP extension is not installed at your system. Please enable the PHP extension <code>%2</code>.','CURL','php_curl')); |
236 | return false; // throw new Exception(_L('The "%1" PHP extension is not installed at your system. Please enable the PHP extension <code>%2</code>.','CURL','php_curl')); |
237 | } |
237 | } |
238 | 238 | ||
239 | $ch = curl_init(); |
239 | $ch = curl_init(); |
240 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::basePath() . '/3p/certs/cacert.pem'); |
240 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::localpath() . '3p/certs/cacert.pem'); |
241 | curl_setopt($ch, CURLOPT_URL, 'https://oidplus.viathinksoft.com/reg2/query.php'); |
241 | curl_setopt($ch, CURLOPT_URL, 'https://oidplus.viathinksoft.com/reg2/query.php'); |
242 | curl_setopt($ch, CURLOPT_POST, 1); |
242 | curl_setopt($ch, CURLOPT_POST, 1); |
243 | if (function_exists('gzdeflate')) { |
243 | if (function_exists('gzdeflate')) { |
244 | $compressed = "1"; |
244 | $compressed = "1"; |
245 | $data2 = gzdeflate(json_encode($data)); |
245 | $data2 = gzdeflate(json_encode($data)); |
Line 334... | Line 334... | ||
334 | if (!function_exists('curl_init')) { |
334 | if (!function_exists('curl_init')) { |
335 | return false; // throw new Exception(_L('The "%1" PHP extension is not installed at your system. Please enable the PHP extension <code>%2</code>.','CURL','php_curl')); |
335 | return false; // throw new Exception(_L('The "%1" PHP extension is not installed at your system. Please enable the PHP extension <code>%2</code>.','CURL','php_curl')); |
336 | } |
336 | } |
337 | 337 | ||
338 | $ch = curl_init(); |
338 | $ch = curl_init(); |
339 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::basePath() . '/3p/certs/cacert.pem'); |
339 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::localpath() . '3p/certs/cacert.pem'); |
340 | curl_setopt($ch, CURLOPT_URL, 'https://oidplus.viathinksoft.com/reg2/query.php'); |
340 | curl_setopt($ch, CURLOPT_URL, 'https://oidplus.viathinksoft.com/reg2/query.php'); |
341 | curl_setopt($ch, CURLOPT_POST, 1); |
341 | curl_setopt($ch, CURLOPT_POST, 1); |
342 | if (function_exists('gzdeflate')) { |
342 | if (function_exists('gzdeflate')) { |
343 | $compressed = "1"; |
343 | $compressed = "1"; |
344 | $data2 = gzdeflate(json_encode($data)); |
344 | $data2 = gzdeflate(json_encode($data)); |
Line 483... | Line 483... | ||
483 | return; |
483 | return; |
484 | } |
484 | } |
485 | 485 | ||
486 | $testurl = 'https://www.google.com/'; |
486 | $testurl = 'https://www.google.com/'; |
487 | $ch = curl_init(); |
487 | $ch = curl_init(); |
488 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::basePath() . '/3p/certs/cacert.pem'); |
488 | if (ini_get('curl.cainfo') == '') curl_setopt($ch, CURLOPT_CAINFO, OIDplus::localpath() . '3p/certs/cacert.pem'); |
489 | curl_setopt($ch, CURLOPT_URL, $testurl); |
489 | curl_setopt($ch, CURLOPT_URL, $testurl); |
490 | curl_setopt($ch, CURLOPT_HEADER, TRUE); |
490 | curl_setopt($ch, CURLOPT_HEADER, TRUE); |
491 | curl_setopt($ch, CURLOPT_NOBODY, TRUE); |
491 | curl_setopt($ch, CURLOPT_NOBODY, TRUE); |
492 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
492 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
493 | curl_exec($ch); |
493 | curl_exec($ch); |