system_authservers.php: fix PHP Warning: in_array() expects parameter 2 to be array, null given in /usr/local/www/system_authservers.php on line 756

closes https://github.com/opnsense/core/issues/4242
This commit is contained in:
Ad Schellevis 2020-08-04 18:05:10 +02:00
parent 6dbd1d4abc
commit 14496cb451

View File

@ -753,7 +753,7 @@ endif; ?>
<select name='ldap_sync_memberof_groups[]' id="ldap_sync_memberof_groups" class="selectpicker" multiple="multiple">
<?php
foreach (config_read_array('system', 'group') as $group):
$selected = in_array($group['name'], $pconfig['ldap_sync_memberof_groups']) ? 'selected="selected"' : ''; ?>
$selected = !empty($pconfig['ldap_sync_memberof_groups']) && in_array($group['name'], $pconfig['ldap_sync_memberof_groups']) ? 'selected="selected"' : ''; ?>
<option value="<?= $group['name'] ?>" <?= $selected ?>><?= $group['name'] ?></option>
<?php
endforeach; ?>