Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Mod Name / Version: Advanced Banning

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

Files Altered: addpost.php, doratethread.php, dorateuser.php, editpost.php,
mess_handler.php, newpost.php, newreply.php, sendprivate.php,
ubbt.inc.php, admin/menu.php, admin/banuser.php, admin/dobanuser.php

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.


Attachments
78647-69013-advanced_baning_1_0_1.zip (0 Bytes, 69 downloads)

Sponsored Links
Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
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!!

Thanks in advance!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Backup your database first.....

Then go to Admin -> SQL Command
Then paste this in the box:

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;


Then you should be set.

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
Josh... Thank you... VERY much!

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...

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
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). [/]

Now what?

Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I believe that means you don't have a table called w3t_Banned

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
That's a warning cause the new table is still empty. It should go away when you have banned the first user.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
Hmmmm... I have several banned persons. And they keep editing their profiles and posts and such. That's why I need this mod. Help?

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
Can you run this sql command under Admin -> SQL Command:

SELECT * FROM w3t_Banned;


and post the results here?

Sponsored Links
Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
Here ya go:

[]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
[/]

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
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.

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
[]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:

Code
      $size = filesize("{$config['dumpdir']}/$tablename.sql");


Any help there?

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
[]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.

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
Which directory?

(sorry... I really appreciate your help in this. I'm just really really ignorant right now with this software. )

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
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.

These are all in config. Hope this helps

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
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?!?!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
A blank page is usually either a missing language file or you accidentally uploaded the language file in place of the script.

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
I'm sorry... how could I have uploaded the language file in place of the script? I uploaded exactly what the directions told me to upload...

Joined: Jan 2002
Posts: 266
Kel Offline
Member
Member
Offline
Joined: Jan 2002
Posts: 266
Wait... found my mistake. I didn't modify the sendprivate.php file... and I should have. Ignore me please. Sorry...

Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
Joined: Jun 2003
Posts: 1,025
Hmmm, what happened, I thought there was a new post in here but I guess not.

Joined: Aug 2002
Posts: 32
User
User
Offline
Joined: Aug 2002
Posts: 32
Will this work for 6.3 as well?


Organizer
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
No, but I'm currently updating all my mods to version 6.3.2.
I'm looking forward to release some of them over the weekend.

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
Did this make it to a new release? would like to upgrade it in my 6.4 This is a great hack thanks for sharing it.

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
I reworked it for 6.3.2 but haven't documented it yet.
But this version should work with 6.4 with a few changes.

Joined: Nov 2001
Posts: 126
Junior Member
Junior Member
Offline
Joined: Nov 2001
Posts: 126
All my mods all of a sudden have access to the ban feature..? Is this supposed to happen? If so, can someone give me the code to add it back in :-)

Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
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

Implementing per forum ban mask is beyond my php []http://pages.prodigy.net/rogerlori1/emoticons/bigblush.gif[/] and to be honest I don't have the money to pay attention: no time -> to much exams


Kind regards,
PaNTerSan
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
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.

Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
[] Currently, all scripts only check if the user is in a group that has enough rights to perform the action. [/]
Shouldn't check_ban handle this []http://www.drogart.org/ubbthreads/images/graemlins/fragend013.gif[/].

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


Kind regards,
PaNTerSan
Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
[]Astaran said:
But this version should work with 6.4 with a few changes. [/]

I would like to install this on my 6.4 board... but which changes should I make

Thank you for your help!

Pasqual

Joined: Mar 2004
Posts: 118
Journeyman
Journeyman
Offline
Joined: Mar 2004
Posts: 118
[]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[/]


Kind regards,
PaNTerSan
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
I'm still on 6.3.2 on my board, so I can't provide any instructions for 6.4.
But I'll start on migrating my hacks to 6.5 when the beta is released.

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
[]PaNTerSan said:
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[/] [/]
Fine that you came up with a different and easier solution.

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Does "ban IP" mean that the banned person cannot even (anonymously) view our forums ?

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
I'd love to see this mod for 6.5!

Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
Joined: Dec 2000
Posts: 1,471
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.

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
[]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.

Joined: Jan 2003
Posts: 263
Member
Member
Joined: Jan 2003
Posts: 263
Haven't been on the forum for some time now and I would still love to have this mod in 6.5

Is there anyone who could 'upgrade' this mod to work in 6.5 ?


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)