From 71a172dff8fa6fc40dcf58cdbe868f14e9264f55 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 31 Jul 2017 23:05:12 +0200 Subject: [PATCH] openvpn: write proxy auth file; closes #1652 --- src/www/vpn_openvpn_export.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/www/vpn_openvpn_export.php b/src/www/vpn_openvpn_export.php index 52d936e23..36620632b 100644 --- a/src/www/vpn_openvpn_export.php +++ b/src/www/vpn_openvpn_export.php @@ -690,6 +690,11 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco file_put_contents("{$tempdir}/{$prefix}.ovpn", $conf); $shkeyfile = "{$tempdir}/{$shkeyfile}"; file_put_contents("{$shkeyfile}", base64_decode($settings['shared_key'])); + if (!empty($proxy['passwdfile'])) { + $pwdfle = "{$proxy['user']}\n"; + $pwdfle .= "{$proxy['password']}\n"; + file_put_contents("{$tempdir}/{$proxy['passwdfile']}", $pwdfle); + } exec("cd {$tempdir}/.. && /usr/local/bin/zip -r /tmp/{$prefix}-config.zip {$prefix}"); // Remove temporary directory exec("rm -rf {$tempdir}");