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.
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.
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.
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
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.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.