Project

General

Profile

« Previous | Next » 

Revision c61e4626

Added by Ermal Luçi over 15 years ago

Allow the GUI auth API to be used for doing authentication against authentication servers specified. Teach Openvpn to use this API. Allow openvpn to authenticate against multiple servers that can be selected on the server configuration page.

View differences:

usr/local/www/vpn_openvpn_server.php
265 265
		if ($_POST['disable'] == "yes")
266 266
			$server['disable'] = true;
267 267
		$server['mode'] = $pconfig['mode'];
268
		$server['authmode'] = $pconfig['authmode'];
268
		$server['authmode'] = implode(",", $pconfig['authmode']);
269 269
		$server['protocol'] = $pconfig['protocol'];
270 270
		list($server['interface'], $server['ipaddr']) = explode ("|",$pconfig['interface']);
271 271
		$server['local_port'] = $pconfig['local_port'];
......
338 338
		header("Location: vpn_openvpn_server.php");
339 339
		exit;
340 340
	}
341
	$pconfig['authmode'] = implode(",", $pconfig['authmode']);
341 342
}
342 343

  
343 344
include("head.inc");
......
545 546
					<tr id="authmodetr" style="display:none">
546 547
                                                <td width="22%" valign="top" class="vncellreq"><?=gettext("Backend for authentication");?></td>
547 548
                                                        <td width="78%" class="vtable">
548
                                                        <select name='authmode' id='authmode' class="formselect">
549
                                                                <option value="local" <?php if ($pconfig['authmode'] == "local") echo "selected";?>>Local authentication database</option>
549
                                                        <select name='authmode[]' id='authmode' class="formselect" multiple="true" size="<?php echo count($auth_servers) + 1; ?>">
550
							<?php $authmodes = explode(",", $pconfig['authmode']); ?>
551
                                                                <option value="local" <?php if (in_array("local", $authmodes)) echo "selected";?>>Local authentication database</option>
550 552
                                                        <?php
551 553
                                                                foreach ($auth_servers as $auth_server):
552 554
                                                                        $selected = "";
553
                                                                        if ($pconfig['authmode'] == $auth_server['name'])
555
                                                                        if (in_array($auth_server['name'], $authmodes))
554 556
                                                                                $selected = "selected";
555 557
                                                        ?>
556 558
                                                                <option value="<?=$auth_server['name'];?>" <?=$selected;?>><?=$auth_server['name'];?></option>

Also available in: Unified diff