From fb0f22c0ec9b86c79b9623d6b710a5f47741b3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Tue, 9 Mar 2010 17:54:00 +0000 Subject: Add a function to get user groups based on authentication server. Use this function to show the groups the user i member of on Diag Authentication. --- usr/local/www/diag_authentication.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'usr/local/www/diag_authentication.php') diff --git a/usr/local/www/diag_authentication.php b/usr/local/www/diag_authentication.php index f579da9..82bb4eb 100755 --- a/usr/local/www/diag_authentication.php +++ b/usr/local/www/diag_authentication.php @@ -56,10 +56,16 @@ if ($_POST) { $input_errors[] = "A valid username and password must be specified."; if (!$input_errors) { - if (authenticate_user($_POST['username'], $_POST['password'], $authcfg)) - $savemsg = "User authenticated sucessfully."; - else + if (authenticate_user($_POST['username'], $_POST['password'], $authcfg)) { + $savemsg = "User: {$_POST['username']} authenticated sucessfully."; + $groups = getUserGroups($_POST['username'], $authcfg); + $savemsg .= "
This user is member of this groups:
"; + foreach ($groups as $group) + $savemsg .= "{$group} "; + } else { + var_dump($authcfg); $input_errors[] = "User did not authenticate succesfully."; + } } } $pgtitle = array("Diagnostics","Authentication"); -- cgit v1.1