Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-21-2015, 01:06 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 117,156
Abronsyth is on a distinguished road
Default Unbanning Does Not Change Status

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"?
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #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: 90,838
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
  #3  
Old 12-21-2015, 10:03 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 392,620
Hall of Famer is on a distinguished road
Default

I think in this case, we can just create a checkbox for unbanning user, something like this in admincp/view/userview.php:

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


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 12-21-2015, 01:03 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 117,156
Abronsyth is on a distinguished road
Default

Okay, added that in, thank you both very much!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:45 PM.

Currently Active Users: 845 (0 members and 845 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636