Ejemplo n.º 1
0
        }
        //check if user exists
        if ($dbh_user->check_user($username)->user_exists) {
            //Good
        } else {
            $message = 'Specified username does not exist.';
        }
        if ($message == "") {
            require 'password_crypto.php';
            $hashed_password = cobalt_password_hash('NEW', $password, $username, $new_salt, $new_iteration, $new_method);
            $data_con = new data_abstraction();
            $data_con->set_query_type('UPDATE');
            $data_con->set_table('user');
            $data_con->set_update("`password`='{$hashed_password}', `salt`='{$new_salt}', `iteration`='{$new_iteration}', `method`='{$new_method}'");
            $data_con->set_where("username='******'");
            $data_con->make_query();
            $message = 'The password has been successfully reset.';
            $message_type = 'SYSTEM';
            $password = '';
        }
    }
}
require 'subclasses/user_html.php';
$html = new user_html();
$html->draw_header('Reset Password', $message, $message_type);
$html->fields['password']['control_type'] = 'password';
$html->fields['password']['label'] = 'Temporary Password';
$html->exception = array('person_id', 'role_id', 'skin_id');
$html->draw_controls('add', 'Password Reset Form');
$html->draw_footer();