Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding different way of finding client ID for WHMCS 8.x #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
modules/servers/solusvmpro/.idea
modules/servers/solusvmpro/callback.php
modules/servers/solusvmpro/configure.ini
modules/servers/solusvmpro/custom.php
modules/servers/solusvmpro/custom.php
.idea
6 changes: 6 additions & 0 deletions modules/servers/solusvmpro/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require_once __DIR__ . '/lib/CaseInsensitiveArray.php';
require_once __DIR__ . '/lib/SolusVM.php';

use Composer\Semver\Comparator;
use Illuminate\Database\Capsule\Manager as Capsule;
use SolusVM\SolusVM;

Expand All @@ -33,7 +34,12 @@
}
$uid = (int)$_GET['uid'];
}else{
// Adding this to workaround CORE-15619 WHMCS bug
$whmcsVersion = $CONFIG['Version'];
$uid = $ca->getUserID();
if (Comparator::greaterThanOrEqualTo($whmcsVersion,'8')) {
$uid = Auth::client()->id;
}
}
$servid = (int) $_GET['id'];
if ( $servid == "" ) {
Expand Down
6 changes: 6 additions & 0 deletions modules/servers/solusvmpro/get_client_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require_once __DIR__ . '/lib/CaseInsensitiveArray.php';
require_once __DIR__ . '/lib/SolusVM.php';

use Composer\Semver\Comparator;
use Illuminate\Database\Capsule\Manager as Capsule;
use SolusVM\SolusVM;

Expand All @@ -21,7 +22,12 @@
exit();
}

// Adding this to workaround CORE-15619 WHMCS bug
$whmcsVersion = $CONFIG['Version'];
$uid = $ca->getUserID();
if (Comparator::greaterThanOrEqualTo($whmcsVersion,'8')) {
$uid = Auth::client()->id;
}

$params = SolusVM::getParamsFromVserviceID( $vserverid, $uid );
if ( ! $params ) {
Expand Down
6 changes: 6 additions & 0 deletions modules/servers/solusvmpro/html5console.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require_once __DIR__ . '/lib/CaseInsensitiveArray.php';
require_once __DIR__ . '/lib/SolusVM.php';

use Composer\Semver\Comparator;
use Illuminate\Database\Capsule\Manager as Capsule;
use SolusVM\SolusVM;

Expand Down Expand Up @@ -61,7 +62,12 @@
}
$uid = (int)$_GET['uid'];
} else {
// Adding this to workaround CORE-15619 WHMCS bug
$whmcsVersion = $CONFIG['Version'];
$uid = $ca->getUserID();
if (Comparator::greaterThanOrEqualTo($whmcsVersion,'8')) {
$uid = Auth::client()->id;
}
}

$servid = (int)$_GET['id'];
Expand Down
6 changes: 6 additions & 0 deletions modules/servers/solusvmpro/vnc.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
require_once __DIR__ . '/lib/CaseInsensitiveArray.php';
require_once __DIR__ . '/lib/SolusVM.php';

use Composer\Semver\Comparator;
use Illuminate\Database\Capsule\Manager as Capsule;
use SolusVM\SolusVM;

Expand All @@ -32,7 +33,12 @@
}
$uid = (int)$_GET['uid'];
} else {
// Adding this to workaround CORE-15619 WHMCS bug
$whmcsVersion = $CONFIG['Version'];
$uid = $ca->getUserID();
if (Comparator::greaterThanOrEqualTo($whmcsVersion,'8')) {
$uid = Auth::client()->id;
}
}

$servid = isset( $_GET['id'] ) ? (int) $_GET['id'] : "";
Expand Down