Check if user is logged in in vSigup

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uranuskid
    New Member
    • Mar 2007
    • 19

    #1

    Check if user is logged in in vSigup

    Hey folks,

    I was hoping someone could help me out with following problem:
    I want to use vSigup (available free at www.beanbug.net/vScripts.php) to manage protected pages.

    Well, that all works fine, however, I'd like to include a conditional clause on public pages where either a loginform is displayed or a Welcome user statement. The script works with cookies rather than a session, so I tried to check the cookie without succes

    What I did was:
    [PHP]If (isset($COOKIE['USERNAME'])&&(isset$COOKI E['PASSWORD'])) {

    $USERNAME = $_COOKIE['USERNAME'];
    $PASSWORD = $_COOKIE['PASSWORD'];

    $CheckSecurity = new auth();
    $check = $CheckSecurity->page_check($US ERNAME, $PASSWORD);
    }
    else
    {
    $check = false;
    }

    if ($check == false)
    {<!-- Print the login script -->}
    else { print "Welcome $USERNAME;}
    [/PHP]

    I redirected the resultpage of the loginprocess to the index page where the loginform is. When I login I wont get the Welcome message but again the loginform.

    So, does anyone have experience with vSignup and might be able to give me a clue how I can realize above mentioned issue.

    Kind regards

    Frank
  • devsusen
    New Member
    • Feb 2007
    • 136

    #2
    Hi,

    I havent worked with vSignup but I am very much familier with secure login system that works with cookies.

    firstly in our code If (isset($COOKIE['USERNAME'])&&(isset$COOKI E['PASSWORD'])) {, there should be $_COOKIE. Now the way u r collecting the USERNAME and PASSWORD from cookie may not be proper. Try to echo $COOKIE['USERNAME'] if u r getting it properly or not.

    If its ok then try to check what is returned by the function page_check().

    I think this way u can catch the error easily.

    susen

    Comment

    Working...