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
    I did a search for login scripts on other pages then the forums and got a couple sudo code looking responces but nothing that i could get to work. Im still kinda new to vanilla but really would like this feature.

    What it needs.
    To be able to be included on any page and create all needed sessions, check login, Allow use to login if not already(this can forward to another page if its easier).

    Any help would be appreciated.
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 20th 2008
     # 2
    I'm not really sure what it is you need, could you be a bit clearer?
  2.  # 3
    Sorry i hope this is more clear.

    I am just looking for a small chunk of code to place on the rest of my site not just my forums, to see if a member is logged in or not. If they are i want it to show their user name and if they are not then i want it to show a login link.
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 20th 2008
     # 4
    Ah I see. That's done easily enough, assuming you have a database connection further up in your code and also assuming your database table prefix is 'LUM_':

    if(!isset($_SESSION['LussumoUserID'])) {
    // Not logged in
    echo '<a href="path/to/login/page">Login</a>';
    } else {
    // Logged in
    $sql = "
    SELECT *
    FROM `LUM_User`
    WHERE `UserID`='$_SESSION[LussumoUserID]'
    ";
    $User = mysql_fetch_assoc(mysql_query($sql));

    echo $User['Name'];
    }
  3.  # 5
    hum, It doesnt register that im logged in.

    I checked the sessions and they are empty. Any change i could get code to continue the session as well.
    • CommentAuthorCoryMathews
    • CommentTimeFeb 20th 2008 edited
     # 6
    Nevermind got it. Didnt have my session_start() on the pages.

    Thanks for all your help.
    •  
      CommentAuthorHamed
    • CommentTimeFeb 20th 2008
     # 7
    do you think you could show me your site
    i would like to see how this works

    you can whisper it to me if you want
    • CommentAuthorCoryMathews
    • CommentTimeFeb 20th 2008 edited
     # 8
    the site is www.osguide.net But i havent put the sign in part online just yet. hopefully by tomarrow i will.
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 21st 2008
     # 9
    Yeah, sorry, I realised this morning that I should have mentioned session_start();
    • CommentAuthornan
    • CommentTimeFeb 25th 2008
     # 10
    Hi all, I need something similar. My users have to log in to my website and then they have access to my Vanilla forum, so I would like to add some code to also log them into the Forum. I think I can use the above code, but can you please tell me what code I can add to the registration page for my website that will also insert them into the Forum table when they are signing up for my website?
    This means they get to the forum pages and they are logged in.
    Also, I need to add a link to the navigation bar for users to get back to the rest of the website, and I can't find this in the code, maybe I could just be told what page to look on?
    Thank you,
    Nan
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 26th 2008
     # 11
    For the link, I would write a mini-extension to use the AddTab() function but other people like to suggest the PageManager add-on. I've never used it but that should do what you want.

    As for registration, it basically boils down to inserting the appropriate data in the appropriate tables. You can look at Vanilla's code for that.
    • CommentAuthornan
    • CommentTimeFeb 26th 2008
     # 12
    When you say to look at Vanilla's code, can you tell me which file to look at? I have been trying to find this in the code for days. I have boiled it down to one of the people files, right?
    Thank you for your help.
    • CommentAuthorCoryMathews
    • CommentTimeFeb 27th 2008 edited
     # 13
    Ok its online finally and working. I only had to add session_start() above the code but other then that I didn't have to change anything to the above code but i did just for looks, and so it would link to the correct login and register pages. You can check it out here

    http://www.osguide.net
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 28th 2008
     # 14
    @nan: library/People.Class.UserManager.php look at the CreateUser method.
    •  
      CommentAuthorHamed
    • CommentTimeApr 20th 2008
     # 15
    is it possible to actually have a login box on an external page

    like a box for user name
    and a box for password
    kind of like this : http://twitter.com/ or facebook

    also
    is it possible to like integrate this other page with vanilla
    so when your logged in an viewing the external page
    it shows up logged in as blah blah
    and when your not logged in
    the boxes show up
Add your comments
    Username Password
  • Format comments as