how to slov this function for skip validation [on hold]

16
March 15, 2019, at 00:50 AM

Help me please .......

this function for validation license code, any one can help me ?? i want to hack this function for skip this step without any problem**

private function verify_License(){
  $response = '';
  $this->server->HTTP_X_USER = $user = $this->post->username;
  $this->server->HTTP_X_AUTH = $code = $this->post->license;
  $sendLicense = function() use (&$user, &$code) {
     $api = $this->getApi(); 
     $query = []; $query["api"] = "keycheck";
     $data = ['HTTP_X_USER','HTTP_X_AUTH','HTTP_HOST','SCRIPT_URI'];
     foreach($data as $key) { $query[$key] = $this->server->{$key}; }
     $postdata = http_build_query($query); $opts = array('http' => array(
        'timeout' => 10, 'method'  => 'POST', 'content' => $postdata, 
        'header'  => "Content-type: application/x-www-form-urlencoded\r\nX-User: $user\r\nX-Auth: $code"
     ));
     $context  = stream_context_create($opts); 
     file_get_contents($api, false, $context);
  };
  try {
     $sendLicense();
     $context = stream_context_create([
        'http' => [
           'method' => "GET",
           'header' => "Authorization: Bearer g27nxGisUzPmyTGTeOqTxUVqGVg9kjlU\r\n" .
                       "User-Agent: License validation script\r\n"
        ]
     ]);
     if ($handle = fopen("https://api.envato.com/v3/market/author/sale?code={$code}", "r", false, $context)) {
        while ($data = fread($handle, 1024)) { 
           $response .= $data;
        }
        fclose($handle);
     }
     $json = json_decode($response); 
     if (empty($json->buyer) === false && $json->buyer == trim($user)) {
        INI::set("code", $code);
        return $this->Message('success');
     } 
        INI::set("code", $code);
        return $this->Message('success');
  } catch (Exception $e) { $this->Message('error'); }
}

thank you

READ ALSO
crud edit button only showing last variable

crud edit button only showing last variable

I am creating my first php app and running into an issue on how I should try and edit a sql entryI was planning on trying to get a modal window to pop up in order to edit

22
String type casing in php, is it string or String?

String type casing in php, is it string or String?

What is the official name for the php string type?

12
add url parameters to $_GET variable with separated commas issue

add url parameters to $_GET variable with separated commas issue

This is my function, I simply want to output a link like this:

33