View Full Version : Mods can add/remove users
Martin64
01-09-2003, 10:00 PM
Mods can add/remove users
(by Martin64, martin64@vbhackers.com)
ABOUT:
A hack that's useful if you want your mods to be able to add and remove users. Your mods will not be able to create admins or mods (we don't want them to create admins so they can take over, do we? :p). They are only able to remove users from the registered group.
WHAT IT DOES:
- Mods are able to create users other than admins and mods through the Mod CP.
- Mods are able to delete registered users through the Mod CP.
- Select which mods are allowed to add/remove users from Admin CP (Edit Moderator)
Hack requested by mauce in the following thread: https://vborg.vbsupport.ru/showthread.php?s=&threadid=47541
kalle
01-09-2003, 11:19 PM
can u do it so that only user id x, y & Z can create users ?
sorry my english is very bad !
THX for coding !
regards
kalle
this seems ok, but then wouldn't that just create spammed/dupe members? i might try this one, but if i get too many new members that i don't want i am gonna get rid of it
Martin64
01-10-2003, 12:31 AM
As requested by kalle, you are now able to select which moderators that are allowed to add/remove users. :)
mauce
01-10-2003, 06:23 AM
Great work, I'll check it out.
Many thanks!!!
Martin64
01-10-2003, 10:01 AM
No problem, I hope it'll work like you want it to. :)
mauce
01-10-2003, 03:32 PM
Thank m8, the hack works fine......
.... however :)
I used this in combination with Xenon's mods_can_edit_user-hack.
Now I face the following problem:
When a mod adds a user the usergroup will be "(COPPA) Users Awaiting Moderation", but I like to define a personal defined usergroupid (of course no admin).
In this case (wich is always the case), a moderator still has to go to the admin to change the usergroup of the new user.
I also tried to make the usergroupid of "(COPPA) Users Awaiting Moderation" 'moderatable' in Xenon's hack, but that didn't work (dunno why).
So the solution what I'm thinking of is a definable usergroupid for users that are added by a moderator.
What should I change to make this working?
Thanks in advance (again!).
Chris M
01-10-2003, 09:26 PM
Unless I am mistaken, this hack for the modifications to mod/user.php does not have a check for the usergroupid in the query you are running when you add a user:bored:
Satan
Jadelit
01-11-2003, 08:20 AM
Great hack!
I have some requests to it though:
1. In the mod/smod usergroup list, a link should be displayed to view what users the mod/smod added and removed.
2. Mod/SMods can add users in differnt usergroups, except Mod/SMod/Admin. Like a new usergroup called added by mods...
Other than that, it is a very good hack!
Martin64
01-11-2003, 12:05 PM
Originally posted by hellsatan
Unless I am mistaken, this hack for the modifications to mod/user.php does not have a check for the usergroupid in the query you are running when you add a user:bored:
Satan
Good spot, I'll fix that.
Please forgive me for the mistake, I made this at 2am in the morning and as a request. :P
EDIT: New instructions attached.
Chris M
01-11-2003, 12:27 PM
Hehe no problems;)
Satan
Martin64
01-11-2003, 12:44 PM
New instructions added. The security bug hellsatan noticed has been fixed, and mods are now able to select which usergroup the added user goes in. However, they are not able to create admins and mods. I believe this answer both mauce's and Jadelit's requests. :)
mauce
01-11-2003, 01:46 PM
Thanx Martin64, but what is the delta with the former version?
I already tried the hack in first place, so what are the upgrade instructions ?
I tried to figure out the delta myself....
There is a nice pulldown list of usergroups now (well done) however, the groups moderator and supermoderator are in the list as well (but not administrators).
Where in the script we can define the usergroupid's that appear in the pull down list? Or is this possible at all?
Please advice and thanks again
Martin64
01-12-2003, 10:24 AM
To upgrade, you just need to re-do the changes to mod/user.php as it's the only thing that's changed. The list of usergroups you can select from is pulled from the database, so all your usergroups should be listed (admins as well).
Martin64
01-13-2003, 01:32 PM
The easiest way to do that would be to open mod/user.php and...
FIND:
if ($usergroupid==6 or $usergroupid==5 or $usergroupid==7) {
echo "<p>You can't add admins or mods!</p>";
exit;
}
REPLACE WITH:
if ($usergroupid==6 or $usergroupid==5 or $usergroupid==7 or $usergroupid==XX) {
echo "<p>You can't add admins or mods!</p>";
exit;
}
Replace the XX with the ID of the usergroup you don't want your mods to be able to add users to.
Martin64
01-13-2003, 01:33 PM
Humm...you removed the post, mauce? :)
mauce
01-13-2003, 04:17 PM
Yes,
that's because I found that out myself just now, and removed the post immediately.
Didn't notice your quick reply in the first place.
Thanks for your reply anyway Martin,
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.