Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed May 8, 2024
1 parent fd7f082 commit 7b1e6c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
15 changes: 8 additions & 7 deletions app/Http/Controllers/PackagesJsonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,11 @@ protected function getTeamPackages($request, $teamId, $filter = [])

$authDecode = str_replace('license:','', $authDecode);
$authDecode = trim($authDecode);
$authDecode = base64_decode($authDecode);
$authDecodeLicenses = json_decode($authDecode, true);
$authDecode = @base64_decode($authDecode);



$authDecodeLicenses = @json_decode($authDecode, true);
if (!empty($authDecodeLicenses) && is_array($authDecodeLicenses)) {
foreach ($authDecodeLicenses as $decodeLicense) {
if (is_string($decodeLicense) && str_contains($decodeLicense, 'plesk|')) {
Expand Down Expand Up @@ -394,7 +397,7 @@ private function _prepareVersions($versions, $teamPackage)
$preparedPackage = $this->_preparePackage($package, $teamPackage);
if($preparedPackage['dist']['type'] == 'license_key') {
if (isset($teamPackage['composer_request']) && $teamPackage['composer_request']) {
continue;
continue;
}
}

Expand Down Expand Up @@ -555,7 +558,7 @@ public function validateLicenses($request, $whmcsServerId)
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
$_SERVER["HTTP_AUTHORIZATION"] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
}

//dd($_SERVER);
if (isset($_SERVER["HTTP_AUTHORIZATION"]) && (strpos(strtolower($_SERVER["HTTP_AUTHORIZATION"]), 'basic') !== false)) {

/// file_put_contents(base_path().'/lic.txt', print_r((substr($_SERVER["HTTP_AUTHORIZATION"], 6)),1));
Expand All @@ -567,7 +570,6 @@ public function validateLicenses($request, $whmcsServerId)
if(StringHelper::isBase64Encoded($userLicenseKeys)){
$userLicenseKeys = base64_decode($userLicenseKeys);
}

}
if (is_string($userLicenseKeys) and (strpos(strtolower($userLicenseKeys), 'license:') !== false)) {
$userLicenseKeys = substr($userLicenseKeys, 8);
Expand Down Expand Up @@ -610,8 +612,7 @@ public function validateLicenses($request, $whmcsServerId)
foreach ($userLicenseKeysMap as $k=>$userLicenseKey) {

$consumeLicense = MicroweberSAASLicenseValidatorHelper::getLicenseStatus($userLicenseKey);

if (isset($consumeLicense['status']) && $consumeLicense['status']=='Active') {
if (isset($consumeLicense['status']) && strtolower($consumeLicense['status'])=='active') {

$whmcsProductId = false;
if (isset($consumeLicense['package_id'])) {
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"php": "^8.2",
"czproject/git-php": "^4.0",
"darthsoup/laravel-whmcs": "^0.3.1",
"erusev/parsedown": "^1.7",
Expand All @@ -24,16 +24,17 @@
"livewire/livewire": "*",
"rappasoft/laravel-livewire-tables": "^2.7",
"symfony/filesystem": "^5.4",
"nette/schema": "1.3.0",
"symplify/git-wrapper": "^9.3"
},
"require-dev": {
"facade/ignition": "^2.5",
"facade/ignition": "*",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nascent-africa/jetstrap": "^2.5",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
"nunomaduro/collision": "*",
"phpunit/phpunit": "*"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit 7b1e6c0

Please sign in to comment.