Current location: Hot Scripts Forums » General Community » Script Requests » phpbb3 logins


phpbb3 logins

Reply
  #1 (permalink)  
Old 07-22-09, 04:09 AM
loki99 loki99 is offline
New Member
 
Join Date: Jul 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
phpbb3 logins

for years i have been useing a phpbb2 cookies to log into part of my website but since phpbb3 has come out it has stoped working and i didnt know if anyone could help me sort it out


PHP Code:

<?php

include ('inc/config.php');
include (
'inc/openforumdb.php'); 

$AUTH 0;

if (isset(
$_COOKIE['phpbb3_data'])) {
$session_id = isset($_COOKIE['phpbb3_sid']) ? $_COOKIE['phpbb3_sid'] : '';
$sessiondata = isset($_COOKIE['phpbb3_data']) ? unserialize(stripslashes($_COOKIE['phpbb3_data'])) : array();
$session_key $sessiondata['autologinid'];
echo 
stripslashes($_COOKIE['phpbb3_data']) . "<br>";
echo 
"Session ID: " $session_id "<br>";
//echo "Session Key: " . $session_key . "<br>";
echo "Session Key Hashed: " md5($session_key) . "<br>";
echo 
"User ID: " $sessiondata['userid'] . "<br>";
$UID $sessiondata['userid'];
}
if(
$UID == -1)
{
    
$AUTH 0;
    echo 
"User Anonymous / Not logged in<br>";
}
else
{
if(
$sessiondata['autologinid'] == null)
{
    echo 
"USING SESSION<br>";
    
$query  "SELECT * FROM b50__sessions WHERE session_id = '" $session_id "' AND session_user_id = '" $UID "'";
}
else
{
    echo 
"USING KEY<br>";
    
$query  "SELECT * FROM b50__sessions_keys WHERE key_id = '" .  md5($session_key) . "' AND user_id = '" $UID "'";
}
$result mysql_query($query);
if (
mysql_num_rows($result) > 0
{
    echo 
"cookie verified (COOKIE OKOK)" "<br>";
    
$query  "SELECT * FROM  b50__user_group WHERE group_id = '" mysql_real_escape_string($MagGroup) . "' AND user_pending = '0' AND user_id = '" mysql_real_escape_string($UID) . "'";
    
$result mysql_query($query);
    if (
mysql_num_rows($result) > 0
    {
        
$query  "SELECT * FROM  b50__user_group WHERE group_id = '" mysql_real_escape_string($SiteOps) . "' AND user_pending = '0' AND user_id = '" mysql_real_escape_string($UID) . "'";
        
$result mysql_query($query);
        if (
mysql_num_rows($result) > 0
        {
            
$AUTH 3;
            echo 
"SySop (GROUP OKOK)<br>";
        }
        else
        {
            
$AUTH 2;
            echo 
"Maglinker (GROUP OKOK)<br>";
        }
    }
    else
    {
        echo 
"Not authorized (GROUP ERROR)";
        
$AUTH 1;
    }
}
else
{
    echo 
"cookie not verified (COOKIE ERROR)";
    
$AUTH 0;
}
mysql_close($con);
}

?>
that is the part of the script i use to check the cookies but then that works the rest of the site will can anyone help me plz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-22-09, 09:40 AM
loki99 loki99 is offline
New Member
 
Join Date: Jul 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
for got to say this script is to check if the cookes are working right and not the full script
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks

Tags
cookies, php, phpbb3


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom admin login script... phpbb3 database gaogier PHP 1 10-13-08 04:18 PM
phpbb3 integration using existing login acctman PHP 1 07-08-08 11:40 AM
Prevent multiple logins using session id ramush PHP 2 07-01-08 01:46 PM
Logins koncept PHP 5 06-30-07 08:29 AM
Flash Logins, Secure? Defyer Flash & ActionScript 5 06-04-06 09:51 AM


All times are GMT -5. The time now is 06:49 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.