Description: This hack advances/replaces the normal ban masks. You can set different ban levels and edit existing bans.
Working Under: UBB.Threads 6.2
Mod Status: Finished
Any pre-requisites:
Author(s): Astaran
Date: 02/15/03
Credits: Dave_L, this hack is based on his user privilieges hack
HISTORY: 2003-02-07 Dave_L - 1.0.0 Original release of User privileges 2003-02-15 Astaran - 1.0.0 Original release of Advanced banning 2003-03-02 Astaran - 1.0.1 Updated "Upgrading Instructions" - added missing field in altertable command
New Files: admin/editbanusers.php, admin/doeditbanusers.php
Database Altered: Yes
Info/Instructions: If you already installed Dave_L's user restrictions hack, only follow the upgrading instructions at the end of the file.
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.
Ok... I'm going to bite the bullet on this and ask what I'm sure you will think the ultimate stupid question.
This is the first mod that I'm going to try that involves altering the database (I think?).
The instructions for this mod have this:
[]******** Database ********
Replace "w3t_" by your custom table prefix, if applicable:
ALTER TABLE w3t_Banned ADD B_X_NoEditPost CHAR(1) NOT NULL DEFAULT '1', ADD B_X_NoEditProfile CHAR(1) NOT NULL DEFAULT '1', ADD B_X_NoMessage CHAR(1) NOT NULL DEFAULT '1', ADD B_X_NoPost CHAR(1) NOT NULL DEFAULT '1', ADD B_X_NoRate CHAR(1) NOT NULL DEFAULT '1', ADD B_X_NoLogin CHAR(1) NOT NULL DEFAULT '1', ADD B_Comment TEXT;[/]
Is this something that I actually have to go into the database and do or is this something that just happens on it's own once I've modified the subsequent files?
If this is something that I have to go into my database and do, please give me step by step instructions on how to do that? I have never messed with my database before... it scares the hell out of me!!
I scoped it out and I can do it. I'm going to give a heads up to my members though and shut down the board for the back up. If you don't hear back from me, you'll know that all went well...
I'm afraid you're going to have to hold my hand again, Josh... if you wouldn't mind?
I went to do the back up (I haven't done this before either as my server does regular back ups for me) and this is the error message that I got for each of the tables I tried to back up:
[]Warning: stat failed for /w3t_Banned.sql (errno=2 - No such file or directory) in usr/the address to my board/ubbthreads/admin/dodbbackup.php on line 78 w3t_Banned.sql is 0 bytes or did not get created.
You will need to verify that this command actually backed up the selected table(s). [/]
[]B_Uid B_Hostname B_Reason 69 NULL Ban imported from old UBB installation 347 NULL Ban imported from old UBB installation 414 NULL Ban imported from old UBB installation 812 NULL Ban imported from old UBB installation 1978 NULL Ban imported from old UBB installation 2177 NULL Ban imported from old UBB installation 2194 NULL Ban imported from old UBB installation 2263 NULL Ban imported from old UBB installation 2298 NULL Ban imported from old UBB installation 3680 NULL 2895 NULL Ban imported from old UBB installation 3226 NULL Ban imported from old UBB installation 3870 NULL 3871 NULL 1031 NULL Trolling/Baiting/General disruption 4047 NULL disturbing emails 2205 NULL Trolling/Baiting/General disruption 3345 NULL 0 65.69.154.179 0 67.64.147.240 tkl 4365 NULL tkl 0 64.123.190.94 tkl 4373 NULL tkl 4381 NULL tkl 4389 NULL tkl 4399 NULL tkl 3657 NULL flaming 4278 NULL general rudeness 2735 NULL not complying with policy 2480 NULL unresolve flaming/baiting behavior 4616 NULL baiting 4687 NULL tkl 17 NULL Baiting 4779 NULL spamming/non-sponsor 4781 NULL 4783 NULL [/]
Looks all good. Can you please also run a "CHECK TABLE `w3t_Banned`;" to see if the table is corrupted in any way?
Do you have phpMyAdmin installed on your server so that you can try to make a backup with it? You could do a backup via command line also if you have shell access to your server.
[]Here are the results of your command: "CHECK TABLE `w3t_Banned`;". Resource id #3 row(s) affected by your query. [/]
Yes, I have phpMyAdmin and I have full access. Again, I don't touch things in there 'cuz it scares me.
BTW... I'm just using the w3t_Banned table as an example but every single one of my tables returns the same exact error when I try to do a back up. My first thought is that the path is incorrect? The tables are in a different path? Maybe? I checked line 78 in dodbbackup.php and this is what it says:
[]I'm just using the w3t_Banned table as an example but every single one of my tables returns the same exact error when I try to do a back up. My first thought is that the path is incorrect? The tables are in a different path? Maybe? I[/]
Yes, that should be the reason. For testing purposes you can enter the same path as for the mysql log function.
The directory should be outside of your web root and needs to be writeable.
Make sure the path for: Path to mysql. Only necessary for using the database restore function in the admin section.
is correct. I was getting errors like these when my path was wrong.
Also, make sure this path: Path to mysqldump. Only necessary for using the database backup function in the admin section is correct.
Make sure this path is correct and world writable: Directory to store database backups in. Only necessary for using the database backup/restore function in the admin section. This directory will need to be writeable by the webserver.
If the directory that is pointing to isn't writable the backup will fail. This is probally the mostly likely cause of the problem you are having now.
Ok... I finally got around to getting this done and all went well. I did the database backup from mysqladmin. MUCH easier!!
I modified all of the files and everything went smooth. I didn't blow up my board. I haven't tested it out yet by banning someone and seeing just what they can do from there... I'll be working on that later. But first, there is a glaring problem with my sendprivate.php .... as in, it's not there! Or rather when I try to send a PM, I get a blank page. This seems to be the same for everyone. I can still read the PM's that I have in my in and out boxes but can't get anything but a blank page when I try to send.
Anyone else have this problem and how do I fix it? I didn't realize that I had even done anything to that file with this mod?!?!
This mod could be improved []Astaran said: This hack advances/replaces the normal ban masks. You can set different ban levels and edit existing bans. [/] 1st of all you could use bitwise operators instead of adding 6 (!) rows in w3t_Banned table you would add only one. With bitwise masks you also get free hands when one wants to add another ban mask: no database altering any more.
On our forum we have a lot of PR's and spammers who sometimes get overwhelming with posting.
Now, banning them from whole site would be excessive so why not ban them just from that one forum. This would be level before next level ban - in our case one day ban. It gives time to moderator of the forum to clean the mess they've made and no body gets really pissed-off: they coll down
Sure, most of the hacks could be improved. Bitwise operators would be a good enhancement. Adding and editing new ban levels wasn't and issue while creating that hack. Doing so will require some work, but it's posssible. You only have to change the function that performs the ban check.
Enhancing the hack to allow a per forum banning would require more modifications. You'll have to improve the permission system of threads to allows to exlude certain members. Currently, all scripts only check if the user is in a group that has enough rights to perform the action.
I assume check_ban would take care of bitmask checking and w3t_users would get U_BannedFrom column. This would contain a comma separated list (string) with keywords (BO_keyword) of forums from which user is banned (e.g "ubb1,ubb2,ubb3").
So when user clicks on a post on a forum he is banned from, he gets a nice invitation to go chill-out and watch the birds or smth
[]Astaran said: Enhancing the hack to allow a per forum banning would require more modifications. You'll have to improve the permission system of threads to allows to exlude certain members. Currently, all scripts only check if the user is in a group that has enough rights to perform the action. [/] YAB 0.9.0 was made in less than 4 hours with my poor knowledge of php, html and mysql []http://www.drogart.org/ubbthreads/images/graemlins/coffeedrinker.gif[/]
[]Astaran said: Haven't started to port it over yet, but I'll do it. I think I'll integrate it into the new member management area instead of using a seperate gui. [/]
That's great to hear!
Maybe you could also add the following ban: I've banned several IP's, but somehow they are still able to login. They use the SEARCH feature and lot, and that's something I would also like to ban them from.
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.