h3ktlk Posted May 21, 2009 Share Posted May 21, 2009 Im authenticating again a Novell Radius Server, This works fine, what i want to do is try to authenticate only certain context's that are in the radius server, but am not sure of the php/radius code to only authenticate the novell context. example 4 context are allowed in the radius: context.a context.b context.c context.d i just want to allow users in context.c to authenticate on this page. Here is what i have <?php require_once('radius.class.php'); ?> <?php if ((isset($_POST['user'])) && ('' != trim($_POST['user']))) { $radius = new Radius('xx.xx.xx.xx', 'xxxxxxxx'); $radius->SetNasIpAddress('xx.xx.xx.xx'); $radius->SetDebugMode(TRUE); if ($radius->AccessRequest($_POST['user'], $_POST['pass'])) { echo "<strong>Authentication Accepted.</strong>"; } else { echo "<strong>Authentication rejected.</strong>"; } echo "<br />"; echo "<br /><strong>GetReadableReceivedAttributes</strong><br />"; echo $radius->GetReadableReceivedAttributes(); echo "<br />"; echo "<a href=\"".$_SERVER['PHP_SELF']."\">Reload authentication form</a>"; } else { ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> User: <input name="user" type="text" value="user" /> <br /> Pass: <input name="pass" type="text" value="pass" /> (text type for educational purpose only) <!-- type="text" for educational purpose only ! --> <br /> <input name="submit" type="submit" value="Check authentication" /> </form> <?php } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.