Skip to content

Commit

Permalink
#27 Usage Update improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Gavryliuk committed May 17, 2018
1 parent 75fea0b commit 124d21c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/servers/solusvmpro/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.0
4.1.1
2 changes: 1 addition & 1 deletion modules/servers/solusvmpro/lib/SolusVM.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SolusVM {
protected $configOptionUsernamePrefix;
protected $serviceid;
protected $pid;
protected $configIni;
public $configIni;
public $result = '';
public $rawResult = '';
public $cpHostname;
Expand Down
11 changes: 10 additions & 1 deletion modules/servers/solusvmpro/solusvmpro.php
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,16 @@ function solusvmpro_UsageUpdate($params)
{
$solusvm = new SolusVM($params);

$ownerRows = Capsule::table('tblhosting')->where('server', $params['serverid'])->get();
if (!isset($solusvm->configIni['enableUsageUpdate']) || !$solusvm->configIni['enableUsageUpdate']) {
return false;
}
$ownerRowsHosting = Capsule::table('tblhosting')->where('domainstatus', 'Active')->where('server', $params['serverid']);

if (isset($solusvm->configIni['updateIntervalDay'])) {
$ownerRowsHosting->whereRaw('lastupdate < DATE_ADD(CURDATE(),INTERVAL -' . $solusvm->configIni['updateIntervalDay'] . ' DAY)');
}
$ownerRows = $ownerRowsHosting->get();

if ($ownerRows) {
foreach ($ownerRows as $ownerRow) {
if (!$ownerRow->id) {
Expand Down

0 comments on commit 124d21c

Please sign in to comment.