From f6b153003b02fd9c775231fdf13399701a511c1a Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Sat, 20 Jul 2024 04:40:59 +0200 Subject: [PATCH] Ensuring user is enabled before it being rendered into the vpn. --- script/get_wg_config.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/get_wg_config.pl b/script/get_wg_config.pl index 870f7f4..168b6cf 100644 --- a/script/get_wg_config.pl +++ b/script/get_wg_config.pl @@ -6,7 +6,7 @@ use warnings; use Moo; use File::Basename qw/dirname/; -use lib dirname(dirname(__FILE__)).'/lib'; +use lib dirname( dirname(__FILE__) ) . '/lib'; use VPNManager::Schema; sub get_vpn_settings($self) { @@ -21,7 +21,7 @@ ListenPort = @{[$config->{vpnclients}{server_port}]} PrivateKey = @{[$config->{vpn}{privkey}]} EOF my $resultset = VPNManager::Schema->Schema->resultset('VPNUser'); - my @users = $resultset->search( {} ); + my @users = $resultset->search( { -bool => 'is_enabled' } ); for my $user (@users) { next if !$user->is_enabled;