Remove cURL check

Anyone know how to stop cURL from checking an external URL for an email address and order ID with the code below?

public function index() {
		$this->load->language('uksb_licensing/uksb_licensing');
		
		$data['regerror_email'] = $this->language->get('regerror_email');
		$data['regerror_orderid'] = $this->language->get('regerror_orderid');
		$data['regerror_noreferer'] = $this->language->get('regerror_noreferer');
		$data['regerror_localhost'] = $this->language->get('regerror_localhost');
		$data['regerror_licensedupe'] = $this->language->get('regerror_licensedupe');
		$data['regerror_quote_msg'] = $this->language->get('regerror_quote_msg');
		$data['license_purchase_thanks'] = $this->language->get('license_purchase_thanks');
		$data['license_registration'] = $this->language->get('license_registration');
		$data['license_opencart_email'] = $this->language->get('license_opencart_email');
		$data['license_opencart_orderid'] = $this->language->get('license_opencart_orderid');
		$data['check_email'] = $this->language->get('check_email');
		$data['check_orderid'] = $this->language->get('check_orderid');
		$data['server_error_curl'] = $this->language->get('server_error_curl');

 		if(isset($this->request->get['emailmal'])){
			$data['emailmal'] = true;
		}

 		if(isset($this->request->get['clear'])){
			$data['clearform'] = true;
		}

		if(isset($this->request->get['regerror'])){
		    if($this->request->get['regerror']=='emailmal'){
		    	$this->error['warning'] = $this->language->get('regerror_email');
		    }elseif($this->request->get['regerror']=='orderidmal'){
		    	$this->error['warning'] = $this->language->get('regerror_orderid');
		    }elseif($this->request->get['regerror']=='noreferer'){
		    	$this->error['warning'] = $this->language->get('regerror_noreferer');
		    }elseif($this->request->get['regerror']=='localhost'){
		    	$this->error['warning'] = $this->language->get('regerror_localhost');
		    }elseif($this->request->get['regerror']=='licensedupe'){
		    	$this->error['warning'] = $this->language->get('regerror_licensedupe');
		    }
		}

		$data['extension_id'] = '19108';
		$data['home'] = 'https://www.secureserverssl.co.uk/opencart-extensions/google-merchant/';
		$domainssl = explode("//", HTTPS_SERVER);
		$domainnonssl = explode("//", HTTP_SERVER);
		$domain = ($domainssl[1] != '' ? $domainssl[1] : $domainnonssl[1]);

		$data['licensed'] = @file_get_contents($data['home'] . 'licensed.php?domain=' . $domain . '&extension=' . $data['extension_id']);

		if(!$data['licensed'] || $data['licensed'] == ''){
			if(extension_loaded('curl')) {
		        $post_data = array('domain' => $domain, 'extension' => $data['extension_id']);
		        $curl = curl_init();
		        curl_setopt($curl, CURLOPT_HEADER, false);
		        curl_setopt($curl, CURLINFO_HEADER_OUT, true);
		        curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17');
		        $follow_allowed = ( ini_get('open_basedir') || ini_get('safe_mode')) ? false : true;
		        if ($follow_allowed) {
		            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
		        }
		        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 9);
		        curl_setopt($curl, CURLOPT_TIMEOUT, 60);
		        curl_setopt($curl, CURLOPT_AUTOREFERER, true); 
		        curl_setopt($curl, CURLOPT_VERBOSE, 1);
		        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
		        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
		        curl_setopt($curl, CURLOPT_FORBID_REUSE, false);
		        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
		        curl_setopt($curl, CURLOPT_URL, $data['home'] . 'licensed.php');
		        curl_setopt($curl, CURLOPT_POST, true);
		        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_data));
		        $data['licensed'] = curl_exec($curl);
		        curl_close($curl);
		    }else{
		        $data['licensed'] = 'curl';
		    }
		}

		$data['entry_free_support'] = $this->language->get('entry_free_support');
		$order_details = @file_get_contents($data['home'] . 'order_details.php?domain=' . $domain . '&extension=' . $data['extension_id']);
		$order_data = json_decode($order_details, true);

		if(!is_array($order_data) || $order_data == ''){
			if(extension_loaded('curl')) {
		        $post_data2 = array('domain' => $domain, 'extension' => $data['extension_id']);
		        $curl2 = curl_init();
		        curl_setopt($curl2, CURLOPT_HEADER, false);
		        curl_setopt($curl2, CURLINFO_HEADER_OUT, true);
		        curl_setopt($curl2, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17');
		        $follow_allowed2 = ( ini_get('open_basedir') || ini_get('safe_mode')) ? false : true;
		        if ($follow_allowed2) {
		            curl_setopt($curl2, CURLOPT_FOLLOWLOCATION, 1);
		        }
		        curl_setopt($curl2, CURLOPT_CONNECTTIMEOUT, 9);
		        curl_setopt($curl2, CURLOPT_TIMEOUT, 60);
		        curl_setopt($curl2, CURLOPT_AUTOREFERER, true); 
		        curl_setopt($curl2, CURLOPT_VERBOSE, 1);
		        curl_setopt($curl2, CURLOPT_SSL_VERIFYHOST, false);
		        curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, false);
		        curl_setopt($curl2, CURLOPT_FORBID_REUSE, false);
		        curl_setopt($curl2, CURLOPT_RETURNTRANSFER, true);
		        curl_setopt($curl2, CURLOPT_URL, $data['home'] . 'order_details.php');
		        curl_setopt($curl2, CURLOPT_POST, true);
		        curl_setopt($curl2, CURLOPT_POSTFIELDS, http_build_query($post_data2));
		        $order_data = json_decode(curl_exec($curl2), true);
		        curl_close($curl2);
		    }else{
				$order_data['status'] = 'disabled';
		    }
		}

		if($order_data['status'] == 'enabled' && $order_data['registered_date'] != ''){
			$data['text_deregister'] = $this->language->get('text_deregister');
			$data['help_deregister'] = $this->language->get('help_deregister');
			$data['link_deregister'] = $this->url->link('extension/feed/uksb_sitemaps/deregister', 'domain=' . urlencode($domain) . '&extension_id=' . $data['extension_id'] . '&token=' . $this->session->data['token'], true);
		} else {
			$data['text_deregister'] = '';
			$data['help_deregister'] = '';
			$data['link_deregister'] = '';
		}

		if(isset($order_data['status']) && $order_data['status'] == 'enabled'){
			$isSecure = false;
			if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
				$isSecure = true;
			} elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
				$isSecure = true;
			}

			$data['support_status'] = 'enabled';
			$data['support_order_id'] = $order_data['order_id'];
			$data['support_extension_name'] = $order_data['extension_name'];
			$data['support_domain'] = $order_data['domain'];
			$data['support_username'] = $order_data['username'];
			$data['support_email'] = $order_data['email'];
			$data['support_registered_date'] = strftime('%Y-%m-%d', $order_data['registered_date']);
			$data['support_order_date'] = strftime('%Y-%m-%d', ($order_data['order_date'] + 31536000));

			if((time() - $order_data['order_date']) > 31536000){
				$data['text_free_support_remaining'] = sprintf($this->language->get('text_free_support_expired'), 1, ($isSecure ? 1 : 0), urlencode($domain) , $data['extension_id'] , $this->session->data['token']);
			}else{
				$data['text_free_support_remaining'] = sprintf($this->language->get('text_free_support_remaining'), 366 - ceil((time() - $order_data['order_date']) / 86400));
			}
		}else{
			$data['support_status'] = 'disabled';
			$data['text_free_support_remaining'] = sprintf($this->language->get('text_free_support_remaining'), 'unknown');
		}

Can you expand on the question? Or is it something as simple as changing these lines

$data['check_email'] = $this->language->get('check_email');
$data['check_orderid'] = $this->language->get('check_orderid');

to assign false to each array element?

This function asks the user for a valid email and order id which uses curl to query a server with those details.

Basically looking to set the variable to enable or true without using curl

Will give your suggestion a try

It looks like this code checked the licensed.php?domain to see if it’s in a array on that file more than likely

$data['licensed'] = @file_get_contents($data['home'] . 'licensed.php?domain=' . $domain . '&extension=' . $data['extension_id']);

		if(!$data['licensed'] || $data['licensed'] == ''){
			if(extension_loaded('curl')) {
		        $post_data = array('domain' => $domain, 'extension' => $data['extension_id']);
		        $curl = curl_init();
		        curl_setopt($curl, CURLOPT_HEADER, false);
		        curl_setopt($curl, CURLINFO_HEADER_OUT, true);
		        curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17');
		        $follow_allowed = ( ini_get('open_basedir') || ini_get('safe_mode')) ? false : true;
		        if ($follow_allowed) {
		            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
		        }
		        curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 9);
		        curl_setopt($curl, CURLOPT_TIMEOUT, 60);
		        curl_setopt($curl, CURLOPT_AUTOREFERER, true); 
		        curl_setopt($curl, CURLOPT_VERBOSE, 1);
		        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
		        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
		        curl_setopt($curl, CURLOPT_FORBID_REUSE, false);
		        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
		        curl_setopt($curl, CURLOPT_URL, $data['home'] . 'licensed.php');
		        curl_setopt($curl, CURLOPT_POST, true);
		        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_data));
		        $data['licensed'] = curl_exec($curl);
		        curl_close($curl);
		    }else{
		        $data['licensed'] = 'curl';
		    }

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.