$v) { if ($k == 'code') continue; $v = in_array(strtolower($v), ['true', 'false']) || is_numeric($v) ? strtolower($v) : '\'' . $v . '\''; $contents .= 'define(\'' . $k . '\',' . $v . ');' . PHP_EOL; } $contents .= '?>'; if (!file_put_contents($config_file, $contents)) { return FALSE; } return TRUE; } /*Verify Purchase Code function*/ function verify($code) { /*If the submit form is success*/ if(!empty($code)){ /*add purchase code to the API link*/ $purchase_code = $code; $url = "https://dl.supers0ft.us/anonuptest/api.php?code=".$purchase_code; $curl = curl_init($url); /*Set your personal token*/ // $personal_token = "9COT6mduU2sZSMIlC09aYAQveaRdQ2H9"; /*Correct header for the curl extension*/ $header = array(); $header[] = 'Authorization: Bearer '.$personal_token; $header[] = 'User-Agent: Purchase code verification'; $header[] = 'timeout: 20'; curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_HTTPHEADER,$header); /*Connect to the API, and get values from there*/ $envatoCheck = curl_exec($curl); curl_close($curl); $envatoCheck = json_decode($envatoCheck); /*Variable request from the API*/ $date = new DateTime(isset($envatoCheck->supported_until) ? $envatoCheck->supported_until : false); $support_date = $date->format('Y-m-d H:i:s'); $sold = new DateTime(isset($envatoCheck->sold_at) ? $envatoCheck->sold_at : false); $sold_at = $sold->format('Y-m-d H:i:s'); $buyer = (isset( $envatoCheck->buyer) ? $envatoCheck->buyer : false); $license = (isset( $envatoCheck->license) ? $envatoCheck->license : false); $count = (isset( $envatoCheck->purchase_count) ? $envatoCheck->purchase_count : false); $support_amount = (isset( $envatoCheck->support_amount) ? $envatoCheck->support_amount : false); $item = (isset( $envatoCheck->item->previews->landscape_preview->landscape_url ) ? $envatoCheck->item->previews->landscape_preview->landscape_url : false); /*Check for Special Characters*/ if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬]/', $code)){ return 'Not allowed to use special characters!'; } /*Check for Empty Spaces*/ if(!isset($code) || trim($code) == ''){ return 'You need to fill up the input area!'; } /*If Purchase code exists, But Purchase ended*/ if (isset($envatoCheck->item->name) && (date('Y-m-d H:i:s') >= $support_date)){ return " "; } /*If Purchase code exists, display client information*/ if (isset($envatoCheck->item->name) && (date('Y-m-d H:i:s') < $support_date)){ if (!install()) { return '

Error!

Could not write to file! Please check permissions and try again!'; } return "

"; } /*If Purchase Code doesn't exist, no information will be displayed*/ if (!isset($envatoCheck->item->name)){ return " "; } } } if ($_POST) { if (isset($_POST['code'])) { // Validate code $response = verify($_POST['code']); } else { // No code specified $response = '

Error!

Please enter your Envato code!

'; } } ?> Installer

Installer

Options