Check for SSL enabled vhost-container for ssl-related settings in froxlor-vhost-settings; fixes #642

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-02-24 09:03:03 +01:00
parent 2f38de90e5
commit 51efba0a8d
2 changed files with 7 additions and 7 deletions

View File

@@ -6,9 +6,9 @@ use Froxlor\Database\Database;
class FroxlorVhostSettings
{
public static function hasVhostContainerEnabled()
public static function hasVhostContainerEnabled($need_ssl = false)
{
$sel_stmt = Database::prepare("SELECT COUNT(*) as vcentries FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `vhostcontainer`= '1'");
$sel_stmt = Database::prepare("SELECT COUNT(*) as vcentries FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `vhostcontainer`= '1'" . ($need_ssl ? " AND `ssl` = '1'" : ""));
$result = Database::pexecute_first($sel_stmt);
return $result['vcentries'] > 0 ? true : false;
}