phptest-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Phptest-users] Login changes


From: Luis Lebron
Subject: RE: [Phptest-users] Login changes
Date: Tue, 11 Feb 2003 16:15:30 -0600

This is the solution I came up with. I copied the includes and the login.php to the courseware directory. Then created an index page for the courseware that has the following code:

<?php
include("./include/h.inc.php");
if (isset($user->IS_LOGGED_IN))
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Courseware</title>
</head>
<body>
Contents for the courseware goes here. <br />
<a href="" Test</a>
</body>
</html>
<?php
}
else
{
        include("./include/not_logged_in.inc.php");
}
?>


Then I modified the login.php. I changed the last redirect to
header("Location: index.php") instead of pt_redirect('index.php'). I think I will modify the login.php as needed for the courseware users.

(It's easy to do know because the courseware hasn't been developed yet.)


Thanks for the help.


Luis



-----Original Message-----
From: Brandon Tallent [mailto:address@hidden]
Sent: Tuesday, February 11, 2003 3:20 PM
To: general phptest discussion
Subject: Re: [Phptest-users] Login changes


You could start by taking a look at cuser.inc.php.
That's where all the authentication takes place.  For
this to work you would need to (obviously) have the
username and passwords match for both systems.  Once
your user is logged in to your courseware system, you
would use some phptest functions to login the user to
phptest:

    $user = new cUser;
    session_register('user');

    if (!$user->authenticate($username, $password)) {
        session_unregister('user');
        pt_redirect('index.php',
$user->error_message);
    } else {
        pt_redirect('index.php');
    }

You'll have to make sure you have all of the
neccessary phptest includes included in your
courseware login page.

Brandon






--- Luis Lebron <address@hidden> wrote:
> I would like to use phptest as part of an online
> course. However, I don't
> want to make the user login twice. Once to access
> the course materials and
> once to take the quizzes. I would the user to create
> all the neccesary
> variables when the user logs in to the main site so
> that when they go to
> take their test the system recognizes them and gives
> them the appropriate
> tests. Any ideas on how I can do this?
>
>
> thanks,
>
> Luis R. Lebron
> Project Manager
> Sigmatech, Inc
> > _______________________________________________
> Phptest-users mailing list
> address@hidden
>
http://mail.nongnu.org/mailman/listinfo/phptest-users
>


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com


_______________________________________________
Phptest-users mailing list
address@hidden
http://mail.nongnu.org/mailman/listinfo/phptest-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]