diff --git a/index.php b/index.php index bd34016..3a80602 100644 --- a/index.php +++ b/index.php @@ -26,9 +26,7 @@ if(isset($_POST['username']) && isset($_POST['password'])){ $bind = @ldap_bind($ad, $username.'@'.$domain, $password); if ($bind) { - $userDN = getDN($ad, $username, $baseDN); - $groupDN = getDN($ad, "OpenVPN", $baseDN); - if (checkGroup($ad, $userDN, getDN($ad, $group, $baseDN))){ + if (checkGroup($ad, getDN($ad, $username, $baseDN), getDN($ad, $group, $baseDN))){ header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.basename($configFile).'"'); header('Pragma: no-cache');