summaryrefslogtreecommitdiffstats
path: root/etc/inc/openvpn.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-03-02 00:12:06 +0000
committerErmal Luçi <eri@pfsense.org>2010-03-02 00:14:33 +0000
commit366d0323a932d58db0dda927544dc675d77927eb (patch)
treeccbf584ba823544ba6a75e7b9e1ec9034b971769 /etc/inc/openvpn.inc
parentd427154a5177744700e9948571d5ef9bb7c7dae3 (diff)
downloadpfsense-366d0323a932d58db0dda927544dc675d77927eb.zip
pfsense-366d0323a932d58db0dda927544dc675d77927eb.tar.gz
Allow the authentication scripts to detect configuration changes. Allow multiple OUs to be specified on basedn.
Diffstat (limited to 'etc/inc/openvpn.inc')
-rw-r--r--etc/inc/openvpn.inc22
1 files changed, 1 insertions, 21 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index 09f9056..a62e01a 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -384,27 +384,7 @@ function openvpn_reconfigure($mode,& $settings) {
else {
$authcfg = system_get_authserver($settings['authmode']);
if ($authcfg) {
- switch ($authcfg['type']) {
- case 'ldap':
- $basednrplc = array("dc=", "DC=");
- $ldapbasedn = str_replace($basednrplc, "", $authcfg['ldap_basedn']);
- $ldapbasedn = str_replace(",", ".", $ldapbasedn);
- $sed = "\$ldapport=\"{$authcfg['ldap_port']}\";";
- if (strstr($authcfg['ldap_urltype'], "Standard"))
- $ldapproto = "ldap";
- else
- $ldapproto = "ldaps";
- $sed .= "\$ldaphost=\"{$ldapproto}:\/\/{$authcfg['host']}\";";
- $sed .= "\$ldapbasedn=\"@{$ldapbasedn}\";";
- $sed .= "\$ldapver={$authcfg['ldap_protver']};";
- break;
- case 'radius':
- $sed = "\$radsrv=\"{$authcfg['host']}\";";
- $sed .= "\$radport=\"{$authcfg['radius_auth_port']}\";";
- $sed .= "\$radsecret=\"{$authcfg['radius_secret']}\";";
- break;
- }
- mwexec("/bin/cat /etc/inc/openvpn.auth-{$authcfg['type']}.php | /usr/bin/sed 's/\/\/<template>/{$sed}/g' > {$g['varetc_path']}/openvpn/{$mode_id}.php");
+ mwexec("/bin/cat /etc/inc/openvpn.auth-{$authcfg['type']}.php | /usr/bin/sed 's/\/\/<template>/\$authmode=\"{$authcfg['name']}\";/g' > {$g['varetc_path']}/openvpn/{$mode_id}.php");
mwexec("/bin/chmod a+x {$g['varetc_path']}/openvpn/{$mode_id}.php");
$conf .= "auth-user-pass-verify {$g['varetc_path']}/openvpn/{$mode_id}.php via-env\n";
}
OpenPOWER on IntegriCloud