View Single Post
  #2  
Old 12-21-2015, 09:56 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 130,997
Kyttias is on a distinguished road
Default

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 Code:
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 Code:
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 Code:
->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.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.

Last edited by Kyttias; 12-21-2015 at 10:04 AM.
Reply With Quote