Commit d8946545 authored by Franco Fichtner's avatar Franco Fichtner

src: fix more auth server foo for translations; refs #467

parent 8e3a78bc
...@@ -61,13 +61,14 @@ function step2_stepbeforeformdisplay() { ...@@ -61,13 +61,14 @@ function step2_stepbeforeformdisplay() {
$found = false; $found = false;
$authlist = auth_get_authserver_list(); $authlist = auth_get_authserver_list();
$fields[1]['options']['option'] = array(); $fields[1]['options']['option'] = array();
foreach ($authlist as $i => $auth) { foreach ($authlist as $key => $auth) {
if ($auth['type'] != "ldap") if ($auth['type'] != 'ldap') {
continue; continue;
}
$found = true; $found = true;
$opts = array(); $opts = array();
$opts['name'] = $auth['name']; $opts['name'] = $auth['name'];
$opts['value'] = $auth['name']; $opts['value'] = $key;
$fields[1]['options']['option'][] = $opts; $fields[1]['options']['option'][] = $opts;
} }
if ($found == false) { if ($found == false) {
...@@ -123,13 +124,14 @@ function step4_stepbeforeformdisplay() { ...@@ -123,13 +124,14 @@ function step4_stepbeforeformdisplay() {
$found = false; $found = false;
$authlist = auth_get_authserver_list(); $authlist = auth_get_authserver_list();
$fields[1]['options']['option'] = array(); $fields[1]['options']['option'] = array();
foreach ($authlist as $i => $auth) { foreach ($authlist as $key => $auth) {
if ($auth['type'] != "radius") if ($auth['type'] != 'radius') {
continue; continue;
}
$found = true; $found = true;
$opts = array(); $opts = array();
$opts['name'] = $auth['name']; $opts['name'] = $auth['name'];
$opts['value'] = $auth['name']; $opts['value'] = $key;
$fields[1]['options']['option'][] = $opts; $fields[1]['options']['option'][] = $opts;
} }
if ($found == false) if ($found == false)
......
...@@ -136,21 +136,17 @@ if ($save_and_test) { ...@@ -136,21 +136,17 @@ if ($save_and_test) {
<select name='authmode' id='authmode' class="selectpicker" data-style="btn-default" > <select name='authmode' id='authmode' class="selectpicker" data-style="btn-default" >
<?php <?php
$auth_servers = auth_get_authserver_list(); $auth_servers = auth_get_authserver_list();
foreach ($auth_servers as $auth_server) : foreach ($auth_servers as $auth_key => $auth_server) :
$selected = ""; $selected = '';
if ($auth_server['name'] == $pconfig['authmode']) { if ($auth_key == $pconfig['authmode']) {
$selected = "selected=\"selected\""; $selected = 'selected="selected"';
} }
if (!isset($pconfig['authmode']) && $auth_server['name'] == "Local Database") { if (!isset($pconfig['authmode']) && $auth_key == 'Local Database') {
$selected = "selected=\"selected\""; $selected = 'selected="selected"';
} }
?> ?>
<option value="<?=$auth_server['name']; <option value="<?=$auth_key; ?>" <?=$selected; ?>><?=$auth_server['name'];?></option>
?>" <?=$selected; <?php endforeach; ?>
?>><?=$auth_server['name'];?></option>
<?php
endforeach;
?>
</select> </select>
</td> </td>
</tr> </tr>
......
...@@ -393,11 +393,9 @@ if (isset($input_errors) && count($input_errors) > 0) { ...@@ -393,11 +393,9 @@ if (isset($input_errors) && count($input_errors) > 0) {
<?php <?php
$authmodes = explode(",", $pconfig['user_source']); $authmodes = explode(",", $pconfig['user_source']);
$auth_servers = auth_get_authserver_list(); $auth_servers = auth_get_authserver_list();
foreach ($auth_servers as $auth_server) : foreach ($auth_servers as $auth_key => $auth_server) : ?>
?> <option value="<?=htmlspecialchars($auth_key)?>" <?=in_array($auth_key, $authmodes) ? 'selected="selected"' : ''?>><?=$auth_server['name']?></option>
<option value="<?=htmlspecialchars($auth_server['name'])?>" <?=in_array($auth_server['name'], $authmodes) ? "selected=\"selected\"" : ""?> ><?=$auth_server['name']?></option> <?php endforeach; ?>
<?php endforeach;
?>
</select> </select>
</td> </td>
</tr> </tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment