Unbanning Does Not Change Status

Forum
Last Post
Threads / Messages

Abronsyth

A Headache Embodied
Member
Joined
Aug 25, 2011
Messages
1,012
Points
36
Location
NY
Mysidian Dollar
73,285
This is not an error I've ever encountered. It's only happening to one user.

They were somehow autobanned when their ipad automatically refreshed the pound page after they pounded a pet. Anyways, I went through the ACP and changed their usergroup from "banned" to "registered." For some reason that didn't work. Yet, in the database their usergroup is listed as "3," which is registered. So it turned out that in the user_status table they were still listed for "no" under everything, so they were still effectively banned.

Is there a way to fix it so that when I unban a user it resets all of the options under user_stats to "yes"?
 
It's funny because the function unbanuser() does exist, and should do its job - I just don't think there's actually a button to press that will call upon it.

It exists in functions/functions_users.php:
PHP:
function unbanuser($user){
    // Set the usergroup to 3, the banned usergroup
    $mysidia = Registry::get("mysidia");
	$mysidia->db->update("users", array("usergroup" => 3), "username = '{$user}'");

    // Then update all user permissions to no
	$mysidia->db->update("users_status", array("canlevel" => 'yes', "canvm" => 'yes', "canfriend" => 'yes', "cantrade" => 'yes', "canbreed" => 'yes', "canpound" => 'yes', "canshop" => 'yes'), "username = '{$user}'");
    return TRUE;
}

And while it's called in admincp/user.php, it's called like this:
PHP:
if($mysidia->input->post("unban") == "yes") unbanuser($user->username);

But I don't think there's anywhere on the form where the input can be changed to 'unban'. We can just set the user group, but modifying it doesn't currently actually unban them...

HMMMM. Well I see what's going on.

In admincp/view/userview.php, find the edit() function. There should be a quite a tower of ->buildCheckBox's, and you should be able to add this to the end of it:
PHP:
->buildCheckBox("**UNBAN**", "unban", "yes");
BE SURE TO REMOVE THE ; FROM THE LINE ABOVE IT (if you put it at the end). Lol, I made that mistake~

So now the option exists. It should have existed in that form from the start somewhere, but... apparently did not? You'd think the two would be better intertwined. It was probably intended but didn't make it all the way in.
 
Last edited:
I think in this case, we can just create a checkbox for unbanning user, something like this in admincp/view/userview.php:

PHP:
$userForm->buildCheckBox("Unban this User", "unban", "yes");
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,278
Messages
33,127
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top