Current location: Hot Scripts Forums » Programming Languages » PHP » User Management - forum login used throughout site.


User Management - forum login used throughout site.

Reply
  #1 (permalink)  
Old 11-29-03, 06:32 PM
Ayumi Ayumi is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy User Management - forum login used throughout site.

I have been racking my brain and these boards (plus other places) to find a way to use my /forum login throughout my site; from main directory to the last subdirectory. My problem is getting it to work with everything. I will be having the main page with news and things, a gallery, a search engine, and a forum. I want to use my forum login on every page, yet when someone is logged in, I want it to display their welcome (user) blah blah. Also, I wanted to use the same user infos for the gallery (using coppermine) so members won't have to login to everything separately. I will be using vbulliten. If anyone can help me, you'd be my best friend. I don't have enough time to sit down and study php like I wish, so any help here WILL be credited. Thanks.
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 11-30-03, 03:59 AM
fyrestrtr fyrestrtr is offline
Wannabe Coder
 
Join Date: Nov 2003
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
I had to work on something similar.

What you need to do is grab a hold of the session information that vb populates once a user is logged in. You can use that to find out if a user is logged in, what group they belong to, etc. etc. All the details.

The simple way to get to this information is to run a vb on your test server, and edit the index.php file (of the forum index page) to include this line
PHP Code:

echo "<pre>"print_r($_SESSION); echo "</pre>"
It will tell you what variables are available to your scripts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 11-30-03, 08:57 PM
Ayumi Ayumi is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I tried that, but it didn't do anything.

I wanted to use the login script on every page of the site, but I only need the script to log one into the gallery and forums. (coppermine & vb). How would I go about that? The gallery doesn't have a session string.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 12-01-03, 02:25 AM
fyrestrtr fyrestrtr is offline
Wannabe Coder
 
Join Date: Nov 2003
Posts: 191
Thanks: 0
Thanked 0 Times in 0 Posts
I hope this isn't against vb regulations, but this is the session/array information for vb :

Code:
Session Array

Array
(
    [sessionhash] => 51c27213dc3dc40436eec0322f12fab6
    [host] => 192.168.1.100
    [useragent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv
    [userid] => 0
    [lastactivity] => 1070264145
    [styleid] => 0
    [dbsessionhash] => 51c27213dc3dc40436eec0322f12fab6
)

Permissions Array

Array
(
    [0] => 1
    [usergroupid] => 1
    [1] => Unregistered / Not Logged In
    [title] => Unregistered / Not Logged In
    [2] => Guest
    [usertitle] => Guest
    [3] => 0
    [cancontrolpanel] => 0
    [4] => 1
    [canmodifyprofile] => 1
    [5] => 1
    [canviewmembers] => 1
    [6] => 1
    [canview] => 1
    [7] => 1
    [cansearch] => 1
    [8] => 1
    [canemail] => 1
    [9] => 0
    [canpostnew] => 0
    [10] => 0
    [canmove] => 0
    [11] => 0
    [canopenclose] => 0
    [12] => 0
    [candeletethread] => 0
    [13] => 0
    [canreplyown] => 0
    [14] => 0
    [canreplyothers] => 0
    [15] => 1
    [canviewothers] => 1
    [16] => 0
    [caneditpost] => 0
    [17] => 0
    [candeletepost] => 0
    [18] => 0
    [canusepm] => 0
    [19] => 0
    [canpostpoll] => 0
    [20] => 0
    [canvote] => 0
    [21] => 0
    [canpostattachment] => 0
    [22] => 0
    [canpublicevent] => 0
    [23] => 0
    [canpublicedit] => 0
    [24] => 1
    [canthreadrate] => 1
    [25] => 0
    [maxbuddypm] => 0
    [26] => 0
    [maxforwardpm] => 0
    [27] => 0
    [cantrackpm] => 0
    [28] => 0
    [candenypmreceipts] => 0
    [29] => 0
    [canwhosonline] => 0
    [30] => 0
    [canwhosonlineip] => 0
    [31] => 0
    [ismoderator] => 0
    [32] => 0
    [showgroup] => 0
    [33] => 1
    [cangetattachment] => 1
)

BBUserinfo Array

Array
(
    [sessionhash] => 51c27213dc3dc40436eec0322f12fab6
    [host] => 192.168.1.100
    [useragent] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv
    [userid] => 0
    [lastactivity] => 1070264145
    [styleid] => 0
    [username] => Unregistered
    [password] => 
    [daysprune] => -1
    [lastvisit] => 1070264145
    [cookieuser] => 0
    [nosessionhash] => 0
    [usergroupid] => 1
    [timezoneoffset] => 0
    [showsignatures] => 1
    [showavatars] => 1
    [showimages] => 1
    [showvbcode] => 0
    [lastvisitdate] => 12-01-2003 07:35 AM
)
For vb, you can simply copy the code of the login form to your index page (or template) for vb.

As far as the gallery script goes -- I am not familiar with coppermine, however you can pass the authentication information to a "gateway" script that will pass it along to both coppermine and vb.

For example -- say coppermine requires a third item in the login form (a drop down that has the gallery to be logged into for example). You can add this to your "generic" login form. Set the target of your form to your gateway script. In that gateway script -- pass the user name/password/sessionid to the vb login form -- and the user name/password/gallery information to the coppermine login script. That way, using one form, your user is logged into both applications. You can have this gateway script set a cookie when the user is logged in, and check that cookie in your main site template. If that cookie exists, don't display the login form.

Last edited by fyrestrtr; 12-01-03 at 02:27 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 12-01-03, 07:22 PM
Ayumi Ayumi is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Hey, thanks! I really appreciate your help more than you know. I found a way to get coppermine and vb to work together (using a bridge that they include for optional use, silly me for not noticing), but my problem now is getting the bridge file in the right place. I can configure it just fine, just that I don't know where to put it. They don't say, and I can't find the solution anywhere. Does anyone know?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 12-01-03, 09:29 PM
Ayumi Ayumi is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
I finally got it to work! Thank you so much. I'll be sure to credit you when I finally get the site the way I want. Thanks again!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


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
The Art Nexus seeking PHP programmers TheArtNexus Job Offers & Assistance 5 02-26-08 04:08 AM
user management useratloser Script Requests 2 10-30-03 04:13 AM
user management and searching.. alvibd Script Requests 1 09-27-03 01:53 PM
Ad management and optimisation using php surebetdmg PHP 0 08-28-03 07:45 PM
User Management System Kaikki Script Requests 1 08-07-03 09:25 AM


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