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-29-2015, 01:39 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,686
Hwona is on a distinguished road
Default ACP Password Change Bug

Hello! I might be the only one, but has anyone else noticed that if you try and change a user's password via the acp, the user later can't log in with the new or the old password? I'm experimenting with v.1.3.3, but when I checked the v.1.3.4 list of fixed bugs, this wasn't mentioned. Does anyone else have this issue or know how to fix it?

PHP Code:
<?php

class ACPUserController extends AppController{

    const 
PARAM "uid";
    private 
$view;
    private 
$subController;
    
    public function 
__construct(){
        
parent::__construct();
        
$mysidia Registry::get("mysidia");
        if(
$mysidia->usergroup->getpermission("canmanageusers") != "yes"){
            throw new 
NoPermissionException("You do not have permission to manage users.");
        }    
    }
    
    public function 
index(){
        
parent::index();
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();        
        
$stmt $mysidia->db->select("users", array());        
        
$fields = array("uid""username""email""ip""usergroup""uid::edit""uid::delete");
        
        
$userTable = new TableBuilder("user");
        
$userTable->setAlign(new Align("center""middle"));
        
$userTable->buildHeaders("uid""Username""Email""IP""Usergroup""Edit""Delete");
        
$userTable->setHelper(new UserTableHelper);
        
$userTable->setMethod($fields[1], "getProfileLink");
        
$userTable->setMethod($fields[5], "getEditLink");
        
$userTable->setMethod($fields[6], "getDeleteLink");
        
$userTable->buildTable($stmt$fields);
        
$document->add($userTable);    
    }
    
    public function 
add(){
        throw new 
InvalidActionException($mysidia->lang->global_action);
    }
    
    public function 
edit(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        if(!
$mysidia->input->get("uid")){
            
$this->index();
            return;
        }
        
$user = new Member($mysidia->input->get("uid"));        
        
        if(
$mysidia->input->post("submit")){
            
// A form has been submitted, we will be processing the request.
            
if($mysidia->input->post("pass1")){
                
$newsalt codegen(150); 
                
$password passencr($username$pass1$newsalt);
                
$mysidia->db->update("users", array("password" => $password), "uid='{$mysidia->input->get("uid")}'");
                if(
$mysidia->input->post("emailpwchange") == "yes"){
                    
//SEND THE PASSWORD CHANGE EMAIL...    
                    
$systememail $mysidia->settings->systememail;
                    
$headers "From: {$systememail}";
                    
$message "Hello {$user->username};\n\nYour password at {$mysidia->settings->sitename} has been changed by the site admin. Your new account details are as follows:\n
                                Username: 
{$user->username}\nPassword: {$mysidia->input->post("pass1")}\n
                                You can log in to your account at: 
{$mysidia->path->getAbsolute()}login\n
                                Thank You. The 
{$mysidia->settings->sitename} team.";
                    
mail($mysidia->input->post("email"), "{$mysidia->settings->sitename} - Your password has been changed"$message$headers);                    
                }
            }
                
            
$mysidia->db->update("users", array("email" => $mysidia->input->post("email")), "uid='{$mysidia->input->get("uid")}'");
            if(
is_numeric($mysidia->input->post("level"))) $mysidia->db->update("users", array("usergroup" => $mysidia->input->post("level")), "uid='{$mysidia->input->get("uid")}'");
            
            
//Carry out user banning options
            
if($mysidia->input->post("canlevel") == "no"$mysidia->db->update("users_status", array("canlevel" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canvm") == "no"$mysidia->db->update("users_status", array("canvm" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canfriend") == "no"$mysidia->db->update("users_status", array("canfriend" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("cantrade") == "no"$mysidia->db->update("users_status", array("cantrade" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canbreed") == "no"$mysidia->db->update("users_status", array("canbreed" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canpound") == "no"$mysidia->db->update("users_status", array("canpound" => 'no'), "uid='{$mysidia->input->get("uid")}'");  
            if(
$mysidia->input->post("canshop") == "no"$mysidia->db->update("users_status", array("canshop" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("unban") == "yes"unbanuser($user->username);
          
            
$document->setTitle($mysidia->lang->edited_title);
            
$document->addLangvar($mysidia->lang->edited);
        }
        else{
            
// Show default form action
            
$userForm = new FormBuilder("editform"$mysidia->input->get("uid"), "post");
            
$userForm->add(new Comment("<br><br>"));
            
$userForm->add(new Image("templates/icons/delete.gif"));
            
$userForm->buildCheckBox(" Delete This User. <strong>This cannot be undone!</strong>""delete""yes")
                     ->
buildComment("Assign New Password: "FALSE)->buildPasswordField("password""pass1"""TRUE)
                     ->
buildComment("Passwords may contain letters and numbers only. Leave the box blank to keep the current password.")
                     ->
buildCheckBox(" Email the user the new password (Only takes effect if setting a new password) ""emailpwchange""yes")
                     ->
buildComment("Change Email Address: "FALSE)->buildTextField("email"$user->getemail())
                     ->
buildCheckBox(" Ban this user's rights to click adoptables""canlevel""no")
                     ->
buildCheckBox(" Ban this user's rights to post profile comments""canvm""no")
                     ->
buildCheckBox(" Ban this user's rights to make trade offers""cantrade""no")
                     ->
buildCheckBox(" Ban this user's rights to send friend requests""canfriend""no")
                     ->
buildCheckBox(" Ban this user's rights to breed adoptables""canbreed""no")
                     ->
buildCheckBox(" Ban this user's rights to abandon adoptables""canpound""no")
                     ->
buildCheckBox(" Ban this user's rights to visit Shops""canshop""no");
                     
            
$userForm->add(new Comment("<u>{$user->username}'s Current Usergroup:</u> Group {$user->usergroup}"));    
            
$userForm->add(new Comment("Change {$user->username}'s Usergroup To:"FALSE));
            
$userForm->buildDropdownList("level""UsergroupList"$user->usergroup->gid)                    
                     ->
buildButton("Edit User""submit""submit");
            
$document->add($userForm);
        }
    }
    
    public function 
delete(){
         
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        if(!
$mysidia->input->get("uid")){
            
$this->index();
            return;
        }

        
$user = new Member($mysidia->input->get("uid"));
        
deleteuser($user->username);
        
$document->setTitle($mysidia->lang->delete_title);
        
$document->addLangvar($mysidia->lang->delete);
        
header("Refresh:3; URL='../../index'");
    }
    
    public function 
merge(){
        
$mysidia Registry::get("mysidia");
        throw new 
InvalidActionException($mysidia->lang->global_action);
    }
    
    public function 
search(){
        
$mysidia Registry::get("mysidia");
        throw new 
InvalidActionException($mysidia->lang->global_action);
    }
}

?>
__________________
Reply With Quote
  #2  
Old 04-02-2016, 10:48 AM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 18,653
NobodysHero is on a distinguished road
Default Password Reset/Password Change Glitch

I also have this issue and my users aren't getting their password resets when they try to reset it. No email, nothing. I've tested this myself, so I know it's indeed a problem. It's always been an issue, just kept forgetting to look for a fix and normally just have them re-register, then I change their username or change the user name in the db, have them re-register, then change the db ID number. T_T Very involved and frustrating.

As I continued reading, I saw the issue with Yahoo, but I'm using mystfell@gmail.com as my admin email and tested it using another gmail to receive the reset.

Last edited by NobodysHero; 04-02-2016 at 10:55 AM.
Reply With Quote
  #3  
Old 04-02-2016, 11:36 AM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 15,391
pachoofoosh is on a distinguished road
Default

Just looked through that script... it seems to update the password hash in the database but not the salt. Try changing line 39, which looks like:
PHP Code:
$mysidia->db->update("users", array("password" => $password), "uid='{$mysidia->input->get("uid")}'"); 
To this:
PHP Code:
$mysidia->db->update("users", array("password" => $password"salt" => $newsalt), "uid='{$mysidia->input->get("uid")}'"); 
edit: omg didn't realize op posted this a few months ago ok whoops

@NobodysHero I'm not sure about the email thing, though. ;o; Last time I ran Mysidia the password resets were working fine... Does your host have the mail() function enabled? Some hosting providers disable that function.
__________________
The calzones... betrayed me?

Last edited by pachoofoosh; 04-02-2016 at 11:44 AM.
Reply With Quote
  #4  
Old 04-02-2016, 12:37 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 18,653
NobodysHero is on a distinguished road
Default

Just tried that, Pachoo, doesn't seem to work. T_T

Here's mine, in case maybe I did something wrong?


PHP Code:
<?php

class ACPUserController extends AppController{

    const 
PARAM "uid";
    
    public function 
__construct(){
        
parent::__construct();
        
$mysidia Registry::get("mysidia");
        if(
$mysidia->usergroup->getpermission("canmanageusers") != "yes"){
            throw new 
NoPermissionException("You do not have permission to manage users.");
        }    
    }
    
    public function 
index(){
        
parent::index();
        
$mysidia Registry::get("mysidia");    
        
$stmt $mysidia->db->select("users");        
        
$this->setField("stmt", new DatabaseStatement($stmt));
    }
    
    public function 
add(){
        throw new 
InvalidActionException("global_action");
    }
    
    public function 
edit(){
        
$mysidia Registry::get("mysidia");
        if(!
$mysidia->input->get("uid")){
            
$this->index();
            return;
        }
        
$user = new Member($mysidia->input->get("uid"));        
        
        if(
$mysidia->input->post("submit")){
            
// A form has been submitted, we will be processing the request.
            
if($mysidia->input->post("pass1")){
                
$newsalt codegen(150); 
                
$password passencr($username$pass1$newsalt);
                
$mysidia->db->update("users", array("password" => $password"salt" => $newsalt), "uid='{$mysidia->input->get("uid")}'");  
                if(
$mysidia->input->post("emailpwchange") == "yes"){
                    
//SEND THE PASSWORD CHANGE EMAIL...    
                    
$systememail $mysidia->settings->systememail;
                    
$headers "From: {$systememail}";
                    
$message "Hello {$user->username};\n\nYour password at {$mysidia->settings->sitename} has been changed by the site admin. Your new account details are as follows:\n
                                Username: 
{$user->username}\nPassword: {$mysidia->input->post("pass1")}\n
                                You can log in to your account at: 
{$mysidia->path->getAbsolute()}login\n
                                Thank You. The 
{$mysidia->settings->sitename} team.";
                    
mail($mysidia->input->post("email"), "{$mysidia->settings->sitename} - Your password has been changed"$message$headers);                    
                }
            }
                
            
$mysidia->db->update("users", array("email" => $mysidia->input->post("email")), "uid='{$mysidia->input->get("uid")}'");
            if(
is_numeric($mysidia->input->post("level"))) $mysidia->db->update("users", array("usergroup" => $mysidia->input->post("level")), "uid='{$mysidia->input->get("uid")}'");
            
            
//Carry out user banning options
            
if($mysidia->input->post("canlevel") == "no"$mysidia->db->update("users_status", array("canlevel" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canvm") == "no"$mysidia->db->update("users_status", array("canvm" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canfriend") == "no"$mysidia->db->update("users_status", array("canfriend" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("cantrade") == "no"$mysidia->db->update("users_status", array("cantrade" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canbreed") == "no"$mysidia->db->update("users_status", array("canbreed" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("canpound") == "no"$mysidia->db->update("users_status", array("canpound" => 'no'), "uid='{$mysidia->input->get("uid")}'");  
            if(
$mysidia->input->post("canshop") == "no"$mysidia->db->update("users_status", array("canshop" => 'no'), "uid='{$mysidia->input->get("uid")}'");
            if(
$mysidia->input->post("unban") == "yes"unbanuser($user->username);
        }
    }
    
    public function 
delete(){
         
$mysidia Registry::get("mysidia");
        if(!
$mysidia->input->get("uid")){
            
$this->index();
            return;
        }

        
$user = new Member($mysidia->input->get("uid"));
        
deleteuser($user->username);
    }
    
    public function 
merge(){
        throw new 
InvalidActionException("global_action");
    }
    
    public function 
search(){
        throw new 
InvalidActionException("global_action");
    }
}
?>
Reply With Quote
  #5  
Old 04-02-2016, 01:35 PM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 15,391
pachoofoosh is on a distinguished road
Default

Everything looks fine in the file. :'o If your site's users are not getting emails, it could be possible that your host has PHP's mail() function disabled. Try submitting a support ticket to your host to find out if PHP's mail() function is enabled?
__________________
The calzones... betrayed me?
Reply With Quote
  #6  
Old 04-02-2016, 02:32 PM
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: 331,482
Hall of Famer is on a distinguished road
Default

Ditto to what Pachoofoosh said, some webhosts have disabled php's mail function for shared hosting accounts. On MysidiaHost we dont have this problem, but I cant speak for other webhosts.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #7  
Old 04-02-2016, 08:41 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 18,653
NobodysHero is on a distinguished road
Default

OH! YES RIGHT! I also forgot to mention, replaced that line that was suggested by Pachoo, but it's still not changing the password successfully. x.x I tried to log in using the password I made and it didn't let me in. T_T If either of you are willing to give it a good poke around, I'd appreciate it.

PS:And I did send in a ticket, just waiting for a response from the host.
Reply With Quote
  #8  
Old 04-03-2016, 09:31 AM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 15,391
pachoofoosh is on a distinguished road
Default

Hmm.... Try pasting this on line 2, under the <?php line:
PHP Code:
include('../functions/functions.php'); 
__________________
The calzones... betrayed me?

Last edited by pachoofoosh; 04-03-2016 at 09:45 AM.
Reply With Quote
  #9  
Old 04-03-2016, 10:39 AM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 18,653
NobodysHero is on a distinguished road
Default

That gives me:

Quote:
The mystfell.com page isn’t working

mystfell.com is currently unable to handle this request.
500
Just for that page. Taking it out returned access to the page. x.x
Reply With Quote
  #10  
Old 04-03-2016, 10:50 AM
pachoofoosh's Avatar
pachoofoosh pachoofoosh is offline
Artist
 
Join Date: Dec 2012
Location: New York
Posts: 98
Gender: Unknown/Other
Credits: 15,391
pachoofoosh is on a distinguished road
Default

Dang, sorry, i'm not quote sure what's going on with the code then. :c Maybe HoF can help? Seems to be there might be some hidden bug in the page's password updating code.
__________________
The calzones... betrayed me?
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 09:42 AM.

Currently Active Users: 9807 (0 members and 9807 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