Project

General

Profile

« Previous | Next » 

Revision b473da5f

Added by Ermal LUÇI about 14 years ago

Ticket #1052. Enforce certificates if they are present for authenticating to ldap. Allow to select a CA under ldap type authentication backend to be used for this.

View differences:

usr/local/www/system_authservers.php
54 54
foreach ($a_servers as $servers)
55 55
	$a_server[] = $servers;
56 56

  
57
if (!is_array($config['ca']))
58
        $config['ca'] = array();
59
$a_ca =& $config['ca'];
60

  
57 61
$act = $_GET['act'];
58 62
if ($_POST['act'])
59 63
	$act = $_POST['act'];
......
87 91
		$pconfig['name'] = $a_server[$id]['name'];
88 92

  
89 93
		if ($pconfig['type'] == "ldap") {
94
			$pconfig['ldap_caref'] = $a_server[$id]['ldap_caref'];
90 95
			$pconfig['ldap_host'] = $a_server[$id]['host'];
91 96
			$pconfig['ldap_port'] = $a_server[$id]['ldap_port'];
92 97
			$pconfig['ldap_urltype'] = $a_server[$id]['ldap_urltype'];
......
168 173
			$reqdfieldsn[] = gettext("Bind user DN");
169 174
			$reqdfieldsn[] = gettext("Bind Password");
170 175
		}
171

  
172 176
	}
173 177

  
174 178
	if ($pconfig['type'] == "radius") {
......
222 226

  
223 227
		if ($server['type'] == "ldap") {
224 228

  
229
			if (!empty($pconfig['ldap_caref']))
230
				$server['ldap_caref'] = $pconfig['ldap_caref'];
225 231
			$server['host'] = $pconfig['ldap_host'];
226 232
			$server['ldap_port'] = $pconfig['ldap_port'];
227 233
			$server['ldap_urltype'] = $pconfig['ldap_urltype'];
......
389 395
        url += '&urltype=' + document.getElementById("ldap_urltype").value;
390 396
        url += '&proto=' + document.getElementById("ldap_protver").value;
391 397
	url += '&authcn=' + document.getElementById("ldapauthcontainers").value;
398
	url += '&cert=' + document.getElementById("ldap_caref").value;
392 399

  
393 400
        var oWin = window.open(url,"pfSensePop","width=620,height=400,top=150,left=150");
394 401
        if (oWin==null || typeof(oWin)=="undefined")
......
490 497
								</select>
491 498
							</td>
492 499
						</tr>
500
						<tr id="tls_ca">
501
							<td width="22%" valign="top" class="vncell"><?=gettext("Peer Certificate Authority"); ?></td>
502
                                                        <td width="78%" class="vtable">
503
                                                        <?php if (count($a_ca)): ?>
504
								<select name='ldap_caref' class="formselect">
505
                                                        <?php
506
                                                                foreach ($a_ca as $ca):
507
                                                                        $selected = "";
508
                                                                        if ($pconfig['ldap_caref'] == $ca['refid'])
509
                                                                                $selected = "selected";
510
                                                        ?>
511
									<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['descr'];?></option>
512
                                                        <?php	endforeach; ?>
513
								</select>
514
								<br/><span><?=gettext("This option is used if 'SSL Encrypted' option is choosen.");?> <br/>
515
								<?=gettext("It must match with the CA in the AD otherwise problems will arise.");?></span>
516
                                                        <?php else: ?>
517
                                                                <b>No Certificate Authorities defined.</b> <br/>Create one under <a href="system_camanager.php">System &gt; Cert Manager</a>.
518
                                                        <?php endif; ?>
519
                                                        </td>
520
						</tr>
493 521
						<tr>
494 522
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Protocol version");?></td>
495 523
							<td width="78%" class="vtable">

Also available in: Unified diff