PDA

View Full Version : logout link on extranal page solved now


tanshah
10 Dec 2006, 07:43
I have reading lot about the suggested solution to make a link for logout on extranl pages but most of the guys was compaling that solution offer is not working i have worked on that and few hours re search i got the solution which i want to share to help others here is detail

require_once('path/global.php');
require_once('path/includes/functions_login.php');
$hh=$vbulletin->userinfo['logouthash'];
$url1="
<ahref= \"http://url/forum/login.php?$session[sessionurl]do=logout&amp;logouthash=".$hh."\">logut out</a>";
after that you can put link any where you want in your code
if its php then
just <? echo $url1?>

and you are done

Kungfu
12 Dec 2006, 00:16
basically what i have as well

global $me,$bbuserinfo,$vbulletin;
if ($me)
{
echo "Logged in as <a href=\"/forum/usercp.php\">".$me."</a> - (<a href=\"/forum/login.php?do=logout&logouthash=".$bbuserinfo['logouthash']."\">Logout</a>)";
}
else
{
echo "
<form action=\"/forum/login.php\" method=\"post\">
You are not logged in,
Username: <input type=\"text\" name=\"vb_login_username\" id=\"navbar_username\" size=\"10\" accesskey=\"u\" tabindex=\"1\" value=\"User Name\" onfocus=\"if (this.value == 'User Name') this.value = '';\" />
Password: <input type=\"password\" name=\"vb_login_password\" size=\"10\" accesskey=\"p\" tabindex=\"2\" />
<input type=\"submit\" class=\"button\" value=\"Login\" tabindex=\"4\" title=\"Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself.\" accesskey=\"s\" />
or <a href=\"/forum/register.php\"><u>Register</u></a>
<input type=\"hidden\" name=\"s\" value=\"\" />
<input type=\"hidden\" name=\"do\" value=\"login\" />
<input type=\"hidden\" name=\"cookieuser\" value=\"1\" />
<input type=\"hidden\" name=\"forceredirect\" value=\"1\" />
<input type=\"hidden\" name=\"vb_login_md5password\" />
</form>";
}

where $me and bbuserinfo is from a shellscript i have
i couldnt get global to work but
require_once('/home/virtuser/diablo2.com/public_html/forum/includes/init.php');
works fine when including a file for userinfo, just wont have bbcode quotes.

$bbuserinfo = &$vbulletin->userinfo;
and
$me = ($bbuserinfo['userid'] ? $bbuserinfo['username'] : '');

this is in php obviously.

Thats the jist of it.

tanshah
13 Dec 2006, 05:42
instead of using
$bbuserinfo['userid'] or
$bbuserinfo['username']
why you dont use

$vbulletin->userinfo['userid'] and
$vbulletin->userinfo['username'];
..???

Kungfu
19 Dec 2006, 04:06
instead of using
$bbuserinfo['userid'] or
$bbuserinfo['username']
why you dont use

$vbulletin->userinfo['userid'] and
$vbulletin->userinfo['username'];
..???

what do you mean? it is that. if you read what i wrote i said

$bbuserinfo = &$vbulletin->userinfo;

i use it in other areas, obviously you dont have to do that. but i just assigned that whole thing to one variable instead of doing that every time.