Changing userid for users being banned from modCP
MOD Information
The Developer
|
|
|
Version: , by N9ne
Developer Last Online: Jul 2019
| Version: Unknown |
Rating:
|
| Released: 08-31-2002 |
Last Update: Never |
Installs: 0 |
|
|
|
|
No support by the author. |
PHP Code:
// ###################### Start doban #######################
if ($HTTP_POST_VARS['action']=="doban") {
$perms=getpermissions();
if (!$perms[ismoderator] and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid] AND canbanusers=1")) {
echo "<p>You do not have permission to do this!</p>";
exit;
}
$banuser=$DB_site->query_first("SELECT username,userid,usergroupid FROM user WHERE userid=$userid");
$ismod=$DB_site->query_first("SELECT moderatorid FROM moderator WHERE userid=$userid");
if ($banuser['usergroupid']!=2 or $ismod) {
echo "<p>You may not ban someone who is not a normal registered user!</p>";
}
$bangroup=$DB_site->query_first("SELECT usergroupid,title FROM usergroup WHERE title='Banned by Moderators'");
if (!$bangroup) {
$DB_site->query("INSERT INTO usergroup
(usergroupid, title, usertitle, cancontrolpanel, canmodifyprofile, canviewmembers,
canview, cansearch, canemail, canpostnew, canmove, canopenclose, candeletethread, canreplyown,
canreplyothers, canviewothers, caneditpost, candeletepost, canusepm, canpostpoll, canvote,
canpostattachment, ismoderator, canpublicevent, canpublicedit, canthreadrate, cantrackpm,
candenypmreceipts)
VALUES
(NULL, 'Banned by Moderators', 'Banned', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')");
$bangroup['usergroupid'] = $DB_site->insert_id();
$bangroup['title'] = 'Banned by Moderators';
}
if ($bangroup['usergroupid']>6) {
$DB_site->query("UPDATE user SET usergroupid=$bangroup[usergroupid] WHERE userid=$banuser[userid]");
echo "<p>$banuser[username] has been banned!</p>";
} else {
echo "<p>An unknown error occured while attempting to ban $banuser[username] ($banuser[userid]). The group the user was supposed to be moved to was \"$bangroup[usergroupid]\"</p>";
}
}
// ###################### Start viewuser #######################
That's the code from the root/mod/user.php
See where it says:
PHP Code:
$bangroup['usergroupid'] = $DB_site->insert_id();
$bangroup['title'] = 'Banned by Moderators';
}
If I wish to change the group which users banned by moderators go into, do I just change 'Banned by Moderators' to the name of the group I want them to go into? Or is there more to this?
Show Your Support
-
If you like to thanks you by the author -> Click Thanks to the Author
- This modification may not be copied, reproduced or published elsewhere without author's permission.
|