Exemple #1
0
 public static function ValidateLicense($licenseparams)
 {
     if (empty($licenseparams['key'])) {
         $response = array('error_code' => '2', 'status' => 'failed', 'description' => 'No License Key Entered');
     }
     if (empty($licenseparams['deviceid'])) {
         $response = array('error_code' => '2', 'status' => 'failed', 'description' => 'Device ID is empty');
     }
     $response = array();
     $db = Utility::mysqlRes();
     $license = $db->license()->where("licensekey", $licenseparams['key'])->where("used", 0);
     if ($license->count()) {
         if (License::ApplyLicense($licenseparams)) {
             $response = array('error_code' => '0', 'status' => 'success', 'description' => 'Product Activated');
         }
     } else {
         $response = array('error_code' => '1', 'status' => 'failed', 'description' => 'Invalid or Used License Key');
     }
     return $response;
 }