SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast xsreality's Avatar
    Join Date
    Feb 2006
    Location
    India
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question A login to control multiple systems?

    Hello friends!

    I have a typical case to which i m not able to think of a decent solution..

    i hv a site on which both phpbb forum and wordpress based blog is active. The situation is that not everybody can access these systems. Only some ppl who can specially register and login should get access to both forum and blog. How should i code the user login script so that access to forum and blog is restricted? also plz suggest some good login scripts.

    thnx in advance!

  2. #2
    SitePoint Addict tina88's Avatar
    Join Date
    Jan 2007
    Location
    UK
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hiya, I am not sure if this is the best solution but it is the way I would do it. Basically, I would add an extra two fields to the user table in the db, e.g. forum and blog and give them type tinyint. When a person is registered you could decide if they are allowed to access these two areas e.g. 0 = not allowed and 1 = allowed.

    I would use sessions for the login and on every page I would check if they are logged in. If not then I would send them back to the login page. When accessing the forum or blog, I would again check if they are logged in and also if their status is set to 1 (from users table). If it is then they can access it, if not then they are sent to a page saying that they do not have permission to enter.

    I hope that something in what I have said makes sense Tina

  3. #3
    SitePoint Enthusiast xsreality's Avatar
    Join Date
    Feb 2006
    Location
    India
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for replyin tina!

    the solution u have given has already crossed my mind...

    Quote Originally Posted by tina88 View Post
    I would use sessions for the login and on every page I would check if they are logged in.
    the pages that i hv to restrict are phpbb forum and wordpress blog..i can edit those pages bt just imagine how many pages i wud hv to edit...the forum itself contains around 50-60 files...thats y i wanted to know if their is a better solution or wud i hv to edit each & every page manually?

  4. #4
    SitePoint Addict
    Join Date
    Jan 2005
    Posts
    204
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it possible to like put the check sessions code into the header template that comes with phpbb so that u will only have to put into the header template and every other pages already will include this header template?

  5. #5
    SitePoint Enthusiast xsreality's Avatar
    Join Date
    Feb 2006
    Location
    India
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm...i wil look into ur suggestion..thnx!

  6. #6
    SitePoint Enthusiast xsreality's Avatar
    Join Date
    Feb 2006
    Location
    India
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Strange problem!

    hello friends

    i put the session code in the common header part of the forum as well as the wordpress blog. my session code places 2 cookies like this:

    PHP Code:
    setcookie('xsreality_username'$username0'/','',false);
    setcookie('xsreality_pass'md5($password), 0'/','',false); 
    Now a strange problem is occurring...the forum doesn't start at all and wordpress blog gives the following error:

    Code:
    Sorry, no posts matched your criteria.
    I found the reason for the above error from the wordpress site..it happens because some cookies are defined on the domain. the fix is to remove all cookies. but i have to place those cookies.
    Same is the reason for phpbb forum also.

    the structure of site is like this----

    Code:
    root
       - phpbb forum
       - wordpress blog
       - other site files
       - login.php
    the cookie i generate is for the whole domain and should be readable by forum as well as blog.

    plz help!!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •