UBB.Dev
Posted By: JoshPet Beta-[6.3] Password Protected Forums 1.0 - 08/12/2003 5:16 AM
Mod Name / Version: Password Protected Forums 1.0

Description: This will allow you to password protect specific forums - similar to UBB.Classic.

Features:
  • You can define the password to a forum when you create or edit the forum
  • You can remove the password from a forum simply by editing the forum.
  • Passwords are safe and secure - same as Threads using one way MD5 encryption
  • If a user visits a password protected forum, it'll prompt them for the password then return them to the forum.
  • On the password page for the forum it'll tell them if they need access to the forum or are having trouble logging in to contact the moderators of that forum. Then it will list links to all the moderators of the forum.
  • After they've entered the correct password, it'll redirect them back to where they were.
  • If they use a "backside" link to showflat, showthreaded, printthread, postlist, printthread, newpost or newreply attempting to get access to the forum, it'll still prompt them for the password, then redirect them to where they were trying to go
  • The encrypted password for the forum is stored in a cookie - so they need only enter it once. And as long as they don't logout they'll have access and see all threads there so they won't need to enter the password repeatedly.
  • I've made this work with cookies or sessions, however with sessions a cookie is used to track access to the password protected forums throughout the length of the browser session.
  • If you allow the guest (unregistered) group to have access to and view the forum, they can access with the password as well. The cookie giving access will last the length of the browser session.
  • I've added an extra config variable so you can determine if everyone must enter the password to view the forum, or if admins, or admins & moderators are exempt from having to enter the password. This is handy if you want Admins to have total access, so they can monitor the posts without having to know the password.
  • Moderators can edit their own forums from the Admin menu - and change the password there if they wish.
  • If you need to "lock everyone out" and start fresh, changing the password to a forum will require everyone to reenter the new password, even if they already have a cookie for the forum.
  • If the user has not yet entered the password for a protected forum, the main index will hide the subject of the Last Post and name of the last poster in the Last Post column indicating that the forum is password protected. Once they enter the password for this forum, they will see this information as normal.
  • If the user has not yet entered the password for a protected forum, any search results including "posts by this user" and "posts within the last x hours/days" will hide the subject of the post and the posters name, indicating it's a password protected forum. Once they enter the password for this forum, this information will appear as normal.
  • All text strings are in language files.
  • The Forum login page is templated.




Working Under: UBB.Threads 6.3

Mod Status: Beta

Any pre-requisites: none

Author(s): JoshPet of www.JoshuaPettit.com

Date: 08/11/03

Credits: Commissioned by JC for http://www.roleplayworlds.com

Files Altered: /admin/viewboard.php, /admin/doeditboard.php, /admin/createboard.php, /admin/docreate.php, postlist.php, showflat.php, showthreaded.php, newpost.php, newreply.php, printthread.php, logout.php, ubbt.inc.php, ubbthreads.php, dosearch.php, /languages/****/admin/generic.php, /languages/****/ubbthreads.php, /languages/****/dosearch.php

New Files: boardlogin.php, doboardlogin.php, /templates/default/boardlogin.tmpl, /languages/****/boardlogin.php

Database Altered: Bo_Password field added to w3t_Boards table

Info/Instructions: Optional variable added to the config file to offer access without passwords to administrators and/or moderators.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.




Attached File
Posted By: jluerken Re: Beta-[6.3] Password Protected Forums 1.0 - 08/12/2003 8:09 AM
Joshpet I want a child from you

This is what I've waited for. Do you think that this will also work with 6.2.3?

Posted By: AKD96 Re: Beta-[6.3] Password Protected Forums 1.0 - 08/12/2003 2:29 PM
Posted By: JoshPet Re: Beta-[6.3] Password Protected Forums 1.0 - 08/12/2003 5:52 PM
[]jluerken said:
Joshpet I want a child from you

This is what I've waited for. Do you think that this will also work with 6.2.3?

[/]

LOL

It would probably need some adjusting to the queries on all the scripts - but it should work.
Posted By: jluerken Re: Beta-[6.3] Password Protected Forums 1.0 - 08/12/2003 9:03 PM
[]JoshPet said:
[]jluerken said:
Joshpet I want a child from you

This is what I've waited for. Do you think that this will also work with 6.2.3?

[/]

LOL

It would probably need some adjusting to the queries on all the scripts - but it should work. [/]

Is it possible that you add the info for 6.2.3 to the instructions?
Posted By: JoshPet Re: Beta-[6.3] Password Protected Forums 1.0 - 08/12/2003 9:10 PM
Not sure if I'm really going to have time to do that anytime soon. I've got too many paying projects on my plate right now. It's probably not hard.... I just developed this for a client who was running 6.3.1.... and I share anything I'm hired to develop here.

In every script postlist.php, showflat.php and showthreaded.php etc... the Board query will be different (becuase the Board keyword no longer needs to be passed in the URL in 6.3), so the trick will simply be adding Bo_Password to the end of the existing query, rather than using the code that I've included.

Likewise the login scripts - when it returns a user to a post - in 6.2 series it will need to pass the board keyword in the URL to properly look up the post.

That was the fundamental change between 6.2 and 6.3.

Unless commissioned to do otherwise, I develop new stuff for the current release.

If you can't figure it out it'll give you good reason to upgrade.
Posted By: jluerken Re: Beta-[6.3] Password Protected Forums 1.0 - 08/13/2003 2:19 PM
No chance to make this on my own and the upgrade is a hard way cause I've 39 hacks installed and this is a pain in the ass for every upgrade

Could become a little bit tricky and a lot of work I guess *hrhrhr*

Anyone time enough to write an instruction for 6.2.3?
Posted By: jluerken Re: Beta-[6.3] Password Protected Forums 1.0 - 08/13/2003 3:05 PM
Hey Josh, I've seen that I can read headers from the password protected forum in the CURRENT THREADS box here in the forum

A little update to the hack that those threads are not displayed would be nice cause even headers can tell the people enough to argue
Posted By: JoshPet Re: Beta-[6.3] Password Protected Forums 1.0 - 08/13/2003 8:27 PM
OK, if you are using JustDave's IIP or SideBar Pal..... I had first thought of modifing the pals to hide subjects and such of restricted forums.... but with cached results that's not possible.
So it's best to exclude password protected forums from any pal boxes

In index.php or sidebarpal.php find this:
Code
<br />		$query = "<br />			SELECT Bo_Keyword,Bo_Title,Bo_Write_Perm,Bo_Reply_Perm,Bo_Read_Perm<br />			FROM {$config['tbprefix']}Boards<br />			WHERE Bo_Keyword != ''<br />			$andexclude<br />			$groupquery<br />			$catonly<br />		";<br />


Change to this:
Code
<br />		$query = "<br />			SELECT Bo_Keyword,Bo_Title,Bo_Write_Perm,Bo_Reply_Perm,Bo_Read_Perm<br />			FROM {$config['tbprefix']}Boards<br />			WHERE Bo_Keyword != ''<br />			AND Bo_Password = ''<br />			$andexclude<br />			$groupquery<br />			$catonly<br />		";<br />


Posted By: jluerken Re: Beta-[6.3] Password Protected Forums 1.0 - 09/19/2003 11:01 AM
@Josh: Do you have forgotten me?
Posted By: AdmiralS3 Re: Beta-[6.3] Password Protected Forums 1.0 - 12/12/2004 11:12 AM
Any chance this can be updated for use in 6.5?
Posted By: JoshPet Re: Beta-[6.3] Password Protected Forums 1.0 - 12/13/2004 10:18 AM
It could be done...although it's probably a good bit of work. None of my clients have needed it in 6.5 so it hasn't made it's way to the top of the list.
Posted By: AdmiralS3 Re: Beta-[6.3] Password Protected Forums 1.0 - 12/17/2004 12:24 AM
If ya get around to it, coolies, if not I will make do with out it.

Was a very useful item in 6.3, and really hated to loose it when I switched to 6.5 LOL, but eh, 6.5 is almsot worth loosing it.
© UBB.Developers