The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
External Login Question
Hi there,
I'm new to PHP and modding vb, but I have a page that I want users to be able to log into using their vb5 info. I'm following the instructions in David Grove's guide to set this up. In his example, he's got a form that displays: Code:
////////////////////////// display a login form $userid = vB5_Cookie::get('userid', vB5_Cookie::TYPE_UINT); $hash = vB5_Cookie::get('password', vB5_Cookie::TYPE_STRING); if (empty($userid) OR empty($hash)) { ?> <form action="vb5_external_login.php" method="post"> <input type="text" name="username" value="" placeholder="User Name" /> <input type="password" name="password" value="" placeholder="Password" /> <label><input type="checkbox" name="remember" /> Stay logged in?</label> <input type="submit" value="Log In" /> </form> Sorry if this is a dumb question. Thanks for your help! |
#2
|
||||
|
||||
In his example, it is the same file where his sample code is. He could have also set the form action to blank and it will also go to the same page when the form is submitted.
|
#3
|
|||
|
|||
Excellent, thank you. That seems to work fine. Two other questions..
What would I have to add to other pages for it to check to see if a user was logged in and a member of a certain usergroup? I want only members of group xyz to be able to access this page. And how do I do a log out form? Thanks! |
#4
|
||||
|
||||
Is that a vBulletin page or an external page?
To logout, call the logout() method in user API and passing logouthash which you can find in the userinfo of the logged in user. |
#5
|
|||
|
|||
External page. Thanks again.
|
#6
|
||||
|
||||
Call the fetchUserinfo() method of the user API passing the userid of the logged in user.
PHP Code:
|
Благодарность от: | ||
sn1p3r001 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|