Commit 7be6bba3 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

style fixes

(cherry picked from commit 34b75c5e)
parent 3f304eea
<?php
/*
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2014-2016 Deciso B.V.
Copyright (C) 2010 Ermal Luçi
All rights reserved.
......@@ -34,9 +34,7 @@ require_once("interfaces.inc");
function getUserGroups($username, $authcfg)
{
global $config;
$member_groups = array();
$user = getUserEntry($username);
if ($user !== false) {
$allowed_groups = local_user_get_groups($user, true);
......@@ -52,9 +50,10 @@ function getUserGroups($username, $authcfg)
}
$input_errors = array();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = array("authmode" => "", "username" => "", "password" => "");
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
$pconfig = $_POST;
$authcfg = auth_get_authserver($_POST['authmode']);
......@@ -71,8 +70,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$savemsg = gettext("User") . ": " . $_POST['username'] . " " . gettext("authenticated successfully.");
$groups = getUserGroups($_POST['username'], $authcfg);
$savemsg .= "<br />" . gettext("This user is a member of these groups") . ": <br />";
foreach ($groups as $group)
foreach ($groups as $group) {
$savemsg .= "{$group} ";
}
} else {
$input_errors[] = gettext("Authentication failed.");
}
......@@ -86,49 +86,42 @@ include("head.inc");
<body>
<?php include("fbegin.inc"); ?>
<?php if (isset($savemsg)) print_info_box($savemsg);?>
<form id="iform" name="iform" action="<?php echo $_SERVER['REQUEST_URI'];?>" method="post">
<section class="page-content-main">
<form id="iform" name="iform" method="post">
<section class="page-content-main">
<div class="container-fluid">
<div class="row">
<?php if (isset($savemsg)) print_info_box($savemsg);?>
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors);?>
<section class="col-xs-12">
<div class="content-box">
<header class="content-box-head container-fluid">
<h3><?= gettext('Test a server') ?></h3>
</header>
<div class="content-box-main">
<div class="table-responsive">
<table class="table table-striped __nomb">
<tbody>
<tr>
<td><?=gettext("Authentication Server"); ?></td>
<td><select name="authmode" id="authmode" class="form-control" >
<?php
$auth_servers = auth_get_authserver_list();
foreach ($auth_servers as $auth_server_id => $auth_server):
$selected = "";
if ($auth_server['name'] == $pconfig['authmode'])
$selected = "selected=\"selected\"";
?>
<option value="<?=$auth_server_id;?>" <?=$selected;?>><?=$auth_server['name'];?></option>
<?php endforeach; ?>
<td>
<select name="authmode" id="authmode" class="form-control" >
<?php
foreach (auth_get_authserver_list() as $auth_server_id => $auth_server):?>
<option value="<?=$auth_server_id;?>" <?=$auth_server['name'] == $pconfig['authmode'] ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($auth_server['name']);?>
</option>
<?php
endforeach; ?>
</select>
</td>
</tr>
<tr>
<td><?=gettext("Username"); ?></td>
<td><input type="text" class="form-control formfld unknown" size="20" id="username" name="username" value="<?=htmlspecialchars($pconfig['username']);?>"></td>
<td><input type="text" name="username" value="<?=htmlspecialchars($pconfig['username']);?>"></td>
</tr>
<tr>
<td><?=gettext("Password"); ?></td>
<td><input type="password" class="form-control formfld pwd" size="20" id="password" name="password" value="<?=htmlspecialchars($pconfig['password']);?>"></td>
<td><input type="password" name="password" value="<?=htmlspecialchars($pconfig['password']);?>"></td>
</tr>
<tr>
<td>&nbsp;</td>
......@@ -136,18 +129,12 @@ include("head.inc");
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
</div>
</div>
</section>
</section>
</form>
<?php include('foot.inc');?>
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