Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
  1.  # 1
    Hello,

    i have a big problem. I have a login script in php with sessions. Now the PHP script connects to the LUM_user and i can login with my username and my password but the session isn“t stored.

    how can i make this.

    i have searched in the board and google but didnt find anything.

    i read something about saving the session in the VerivicationKey but this dont work too.

    i hope somebode from this board can help me

    best regards, dominik
    •  
      CommentAuthorFyorl
    • CommentTimeJan 15th 2008
     # 2
    What is it you're trying to do exactly? Use the vanilla database to login to your main site?

    I would suggest using the normal vanilla login form as your login form as that will keep it compatible with future vanilla updates.

    Then you could add a tiny extension to redirect the login to your main site's page. You can study the session variables with a quick var_dump($_SESSION) on a php page and then use them in the rest of your site.
  2.  # 3
    no i want use my own login script on mainsite to make the same session then vanilla. I use the Vanilla MySQL Table "LUM_User" to login. but how can i make it with the session?
  3.  # 4
    Wouldn't it be easier to let vanilla create the session and just check this with your own script?
  4.  # 5
    but i dont know i have to do this? my script is :

    <?
    function connect()
    {
    $con= mysql_connect('removed','removed','removed') or die(mysql_error());
    mysql_select_db('removed',$con) or die(mysql_error());
    }

    function check_user($name, $pass)
    {
    $sql="SELECT UserID
    FROM LUM_User
    WHERE Name='".$name."' AND Password=MD5('".$pass."')
    LIMIT 1";
    $result= mysql_query($sql) or die(mysql_error());
    if ( mysql_num_rows($result)==1)
    {
    $user=mysql_fetch_assoc($result);
    return $user['UserID'];
    }
    else
    return false;
    }

    function login($userid)
    {
    $sql="UPDATE LUM_User
    SET VerificationKey='".session_id()."'
    WHERE UserID=".$userid;
    mysql_query($sql);
    }

    function logged_in()
    {
    $sql="SELECT UserID
    FROM LUM_User
    WHERE VerificationKey='".session_id()."'
    LIMIT 1";
    $result= mysql_query($sql);
    return ( mysql_num_rows($result)==1);
    }

    function logout()
    {
    $sql="UPDATE LUM_User
    SET VerificationKey=NULL
    WHERE VerificationKey='".session_id()."'";
    mysql_query($sql);
    }

    connect();
    ?>
  5.  # 6
    push :-)
  6.  # 7
    I think if you do something like

    include(./path/to/appg/init_people.php);
    if ($Session->UserID > 0) {
    They're logged in
    } else {
    they're not
    }

    ..that's the general concept anyway. You might need to play with $Context->Session->UserID but see what happens...
  7.  # 8
    can you modify my script that it works. i am not so professional to do this :-)

    it would be very nice
  8.  # 9
    Well I was working on the basis that you scrapped your script and just used a small snippet like the one above to interface with vanilla..
  9.  # 10
    no i want the same script only modified for the sessions.

    is anyone able to do this? :-)
Add your comments
    Username Password
  • Format comments as