$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 = []; $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 "
CLIENT: | {$buyer} |
SOLD AT: | {$sold_at} |
SUPPORT UNTIL: | {$support_date} |
LICENSE: | {$license} |
COUNT: | {$count} |
SUPPORT EXTENSION: | {$support_amount} |
Could not write to file! Please check permissions and try again!'; } return "
CLIENT: | {$buyer} |
SOLD AT: | {$sold_at} |
SUPPORT UNTIL: | {$support_date} |
LICENSE: | {$license} |
COUNT: | {$count} |
SUPPORT EXTENSION: | {$support_amount} |
CLIENT: | NOT VERIFIED |
SOLD AT: | NONE |
SUPPORT UNTIL: | NONE |
LICENSE: | NONE |
COUNT: | NONE |
SUPPORT EXTENSION: | NONE |
Please enter your Envato code!
'; } } ?>