mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
system: better authserver parsing for #2578
This commit is contained in:
parent
d4190f08d6
commit
8e28b78c65
@ -1047,16 +1047,25 @@ $( document ).ready(function() {
|
||||
</td>
|
||||
<td class="text-nowrap">
|
||||
<?php
|
||||
$authcfg_type = auth_get_authserver($config['system']['webgui']['authmode'])['type'];
|
||||
if ($authcfg_type == 'ldap') :?>
|
||||
$can_import = false;
|
||||
if (!empty($config['system']['webgui']['authmode'])) {
|
||||
$servers = explode(',', $config['system']['webgui']['authmode']);
|
||||
foreach ($servers as $server) {
|
||||
$authcfg_type = auth_get_authserver($server)['type'];
|
||||
if ($authcfg_type == 'ldap') {
|
||||
$can_import = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if ($can_import): ?>
|
||||
<button type="submit" name="import"
|
||||
id="import_ldap_users"
|
||||
class="btn btn-default btn-xs"
|
||||
title="<?=gettext("import users")?>">
|
||||
<i class="fa fa-cloud-download fa-fw"></i>
|
||||
</button>
|
||||
<?php
|
||||
endif;?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@ -63,8 +63,14 @@ $ldap_users= array();
|
||||
$ldap_is_connected = false;
|
||||
$exit_form = false;
|
||||
|
||||
// find gui auth server
|
||||
$authcfg = auth_get_authserver($config['system']['webgui']['authmode']);
|
||||
// XXX find first LDAP GUI auth server, better select later on
|
||||
$servers = explode(',', $config['system']['webgui']['authmode']);
|
||||
foreach ($servers as $server) {
|
||||
$authcfg = auth_get_authserver($server);
|
||||
if ($authcfg['type'] == 'ldap') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($authcfg['type'] == 'ldap') {
|
||||
// setup peer ca
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user