Plugin Directory

Changeset 3399496


Ignore:
Timestamp:
11/20/2025 08:12:37 AM (8 weeks ago)
Author:
andy_moyle
Message:

9.2 fix bugs

Location:
emergency-password-reset
Files:
4 added
2 edited

Legend:

Unmodified
Added
Removed
  • emergency-password-reset/trunk/index.php

    r3399475 r3399496  
    44 Plugin URI: http://www.themoyles.co.uk
    55 Description: Resets all passwords, emailing them the reset link -  <a href="./users.php?page=emergency_password_reset_main">Reset Passwords now</a>
    6  Version: 9.1
     6 Version: 9.2
    77 Author: andymoyle
    88 Author URI:http://www.themoyles.co.uk
     
    205205{
    206206    global $wpdb;
    207     if(!is_user_loggedin())exit('Nope!');
    208     if(!current_user_can('manage-options')){exit('Not happening');}
     207    if(!is_user_logged_in())exit('Nope!');
     208    if(!current_user_can('manage_options')){exit('Not happening');}
    209209    $results=$wpdb->get_results('SELECT ID FROM '.$wpdb->prefix.'users',ARRAY_N);
    210210   
     
    222222            {
    223223               
    224                 if(!empty($results[0][$i+($y*10)]))$users[]=$results[0][$i+($y*10)];
     224                if(!empty($results[$i+($y*10)]))$users[]=$results[$i+($y*10)][0];
    225225            }
    226226           
     
    272272            add_filter( 'wp_mail_from', 'emergency_password_reset_from_email' );
    273273            add_filter('wp_mail_content_type','emergency_password_reset_set_html_mail_content_type');
    274             if(wp_mail(get_option('admin_email'),$settings['email_subject'],$message,$headers))
    275             {
    276                 echo '<p>Email sent BCC to '.esc_html(implode(',',$BCC)).'</p>';
    277             }else
    278             {
    279                 echo '<p>Email failure BCC to '.esc_html(implode(',',$BCC)).'</p>';
    280                 echo'<pre>';
    281                 print_r($GLOBALS['phpmailer']);
    282                 echo'</pre>';
    283             }
     274            $return = wp_mail(get_option('admin_email'),$settings['email_subject'],$message,$headers);
     275            if( is_wp_error( $return ) ) {
     276                echo $return->get_error_message();
     277            }
     278           
    284279            remove_filter( 'wp_mail_from_name', 'emergency_password_reset_from_name');
    285280            remove_filter( 'wp_mail_from', 'emergency_password_reset_from_email' );
  • emergency-password-reset/trunk/readme.txt

    r3399475 r3399496  
    55Requires at least: 2.7.0
    66Tested up to: 6.8
    7 Stable tag: 9.1
     7Stable tag: 9.2
    88Text Domain: emergency-password-reset
    99License: GPLv2 or later
     
    4242
    4343== Changelog =
     44= 9.2 =
     45* Fix not all users password changed
    4446= 9.1 =
    4547* Security audit and update
Note: See TracChangeset for help on using the changeset viewer.