Ensuring user is enabled before it being rendered into the vpn.
This commit is contained in:
parent
f8711ebd02
commit
f6b153003b
@ -6,7 +6,7 @@ use warnings;
|
|||||||
|
|
||||||
use Moo;
|
use Moo;
|
||||||
use File::Basename qw/dirname/;
|
use File::Basename qw/dirname/;
|
||||||
use lib dirname(dirname(__FILE__)).'/lib';
|
use lib dirname( dirname(__FILE__) ) . '/lib';
|
||||||
use VPNManager::Schema;
|
use VPNManager::Schema;
|
||||||
|
|
||||||
sub get_vpn_settings($self) {
|
sub get_vpn_settings($self) {
|
||||||
@ -21,7 +21,7 @@ ListenPort = @{[$config->{vpnclients}{server_port}]}
|
|||||||
PrivateKey = @{[$config->{vpn}{privkey}]}
|
PrivateKey = @{[$config->{vpn}{privkey}]}
|
||||||
EOF
|
EOF
|
||||||
my $resultset = VPNManager::Schema->Schema->resultset('VPNUser');
|
my $resultset = VPNManager::Schema->Schema->resultset('VPNUser');
|
||||||
my @users = $resultset->search( {} );
|
my @users = $resultset->search( { -bool => 'is_enabled' } );
|
||||||
|
|
||||||
for my $user (@users) {
|
for my $user (@users) {
|
||||||
next if !$user->is_enabled;
|
next if !$user->is_enabled;
|
||||||
|
Loading…
Reference in New Issue
Block a user