$proxy['proxy_authtype'] = $_GET['proxy_authtype'];
		if ($_GET['proxy_authtype'] != "none") {
			if (empty($_GET['proxy_user'])) {
				$error = true;
				$input_errors[] = "You need to specify a username with the proxy config.";
			} else
				$proxy['user'] = $_GET['proxy_user'];
			if (!empty($_GET['proxy_user']) && empty($_GET['proxy_password'])) {
				$error = true;
				$input_errors[] = "You need to specify a password with the proxy user.";
			} else
				$proxy['password'] = $_GET['proxy_password'];
		}
	}

	$exp_name = openvpn_client_export_prefix($srvid);
	if ($act == "skzipconf")
		$zipconf = true;
	$exp_data = openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipconf);
	if (!$exp_data) {
		$input_errors[] = "Failed to export config files!";
		$error = true;
	}
	if (!$error) {
		if ($zipconf) {
			$exp_name = urlencode($exp_data);
			$exp_size = filesize("{$g['tmp_path']}/{$exp_data}");
		} else {
			$exp_name = urlencode($exp_name."-config.ovpn");
			$exp_size = strlen($exp_data);
		}
示例#2
0
        $proxy['proxy_authtype'] = $_GET['proxy_authtype'];
        if ($_GET['proxy_authtype'] != "none") {
            if (empty($_GET['proxy_user'])) {
                $input_errors[] = "You need to specify a username with the proxy config.";
            } else {
                $proxy['user'] = $_GET['proxy_user'];
            }
            if (!empty($_GET['proxy_user']) && empty($_GET['proxy_password'])) {
                $input_errors[] = "You need to specify a password with the proxy user.";
            } else {
                $proxy['password'] = $_GET['proxy_password'];
            }
        }
    }

    $exp_name = openvpn_client_export_prefix($srvid, $usrid, $crtid);

    if (substr($act, 0, 4) == "conf") {
        switch ($act) {
            case "confzip":
                $exp_name = urlencode($exp_name."-config.zip");
                $expformat = "zip";
                break;
            case "conf_yealink_t28":
                $exp_name = urlencode("client.tar");
                $expformat = "yealink_t28";
                break;
            case "conf_yealink_t38g":
                $exp_name = urlencode("client.tar");
                $expformat = "yealink_t38g";
                break;