diff --git a/modules/settings/_includes.php b/modules/settings/_includes.php index 494c7689..ec5689a0 100644 --- a/modules/settings/_includes.php +++ b/modules/settings/_includes.php @@ -12,6 +12,7 @@ include($includePath . './utils/errorMappers/validateEmailChange.errorMapper.php'); include($includePath . './utils/queries/createEmailChangeProcessEntry.query.php'); + include($includePath . './utils/queries/getMovingFleetsCount.query.php'); include($includePath . './utils/queries/getUserWithEmailAddress.query.php'); include($includePath . './utils/validators/validatePasswordChange.validator.php'); diff --git a/modules/settings/utils/queries/getMovingFleetsCount.query.php b/modules/settings/utils/queries/getMovingFleetsCount.query.php new file mode 100644 index 00000000..23e90654 --- /dev/null +++ b/modules/settings/utils/queries/getMovingFleetsCount.query.php @@ -0,0 +1,27 @@ + diff --git a/settings.php b/settings.php index 1e8274ce..861983be 100644 --- a/settings.php +++ b/settings.php @@ -681,9 +681,9 @@ $WarningMsgs[] = $_Lang['Vacation_24hNotPassed']; } - $checkFleets = doquery("SELECT COUNT(*) AS `Count` FROM {{table}} WHERE `fleet_owner` = {$_User['id']} OR `fleet_target_owner` = {$_User['id']};", 'fleets', true); - if($checkFleets['Count'] > 0) - { + $movingFleetsCount = Settings\Utils\Queries\getMovingFleetsCount([ 'userId' => $_User['id'] ]); + + if ($movingFleetsCount > 0) { $allowVacation = false; $WarningMsgs[] = $_Lang['Vacation_FlyingFleets']; }