Jump to content

Novell Radius


h3ktlk

Recommended Posts

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

        }

        ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.