Plugin Directory

Changeset 1470381


Ignore:
Timestamp:
08/08/2016 11:29:36 PM (10 years ago)
Author:
dsader
Message:

WP 4.6 tests OK, cleanup php notices

Location:
user-activation-keys/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • user-activation-keys/trunk/ds_wp3_user_activation_keys.php

    r975629 r1470381  
    55Description: WP Network Multisite user activation key removal or approval Network Plugin. See Network-->Users->"User Activation Keys" to delete activation keys - to allow immediate (re)signup of users who otherwise get the "try again in two days" message. Also, users waiting to be activated (or can't because the email with the generated activation link is "gone") can be approved manually.
    66Author: D. Sader
    7 Version: 3.5.2
     7Version: 4.6
    88Author URI: http://dsader.snowotherway.org
    99Network: true
     
    2020
    2121*/
    22 class ds_user_activation_keys {
     22class DS_User_Activation_Keys {
    2323
    24     function ds_user_activation_keys() {
    25         add_action('network_admin_menu', array(&$this, 'ds_uak_admin_page'));
     24    function __construct() {
     25        add_action('network_admin_menu', array($this, 'ds_uak_admin_page'));
    2626    }
    2727
    2828    function ds_uak_admin_page() {
    29         add_submenu_page('users.php', 'User Activation Keys', 'User Activation Keys', 'edit_users', 'act_keys', array(&$this, 'ds_delete_stale'));
     29        add_submenu_page('users.php', 'User Activation Keys', 'User Activation Keys', 'edit_users', 'act_keys', array($this, 'ds_delete_stale'));
    3030    }
    3131
     
    3737            $delete = $_GET['delete'];
    3838        }
    39 /*      if(isset($_GET['del_stale_active'])) {
    40             $del_stale_active = $_GET['del_stale_active'];
    41         }
    42         if(isset($_GET['del_stale_inactive'])) {
    43             $del_stale_inactive = $_GET['del_stale_inactive'];
    44         }
    45 */ 
     39
    4640        $location = network_admin_url('users.php?page=act_keys');
    4741
    4842        if ( !empty($delete) ) {
    4943            check_admin_referer('activation_key');
    50 //          $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->signups WHERE activation_key = %d",$delete));
    5144            $wpdb->delete( $wpdb->signups, array( 'activation_key' => $delete ) );
    5245            echo '<meta http-equiv="refresh" content="0;url='.$location.'" />';
    5346            exit;
    5447        }
    55 /*      if ( '1' == $del_stale_active ) {
    56             check_admin_referer('activation_key');
    57             $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->signups WHERE active = %d AND DATE(registered) < DATE_SUB(CURDATE(), INTERVAL %s DAY)",1,30));
    58             echo '<meta http-equiv="refresh" content="0;url='.$location.'" />';
    59             exit;
    60         }
    61         if ( '1' == $del_stale_inactive ) {
    62             check_admin_referer('activation_key');
    63             $wpdb->query($wpdb->prepare("DELETE FROM $wpdb->signups WHERE active = %d AND DATE(registered) < DATE_SUB(CURDATE(), INTERVAL %s DAY)",0,30));
    64             echo '<meta http-equiv="refresh" content="0;url='.$location.'" />';
    65             exit;
    66         }
    67 */ 
     48   
    6849        echo '<div class="wrap">';
    6950        echo "<h2>User Activation Keys</h2>";
     
    7152        echo '<p>The following is a list of user activation keys from $wpdb->signups. Delete a key to allow the username to (re)signup and bypass the "couple days" it takes WP to free up its hold on a user name. You can also manually approve users that for whatever reason have not completed their activation.</p>';
    7253
    73 /*      echo '<div class="tablenav"> <span class="alignleft">';
    74             echo '<a class="button-secondary" href="' . wp_nonce_url( $location . '&del_stale_active=1', 'activation_key' ) . '" class="delete">'.__('Delete stale active signup keys older than 30 days').'</a>';
    75             echo '<a class="button-secondary" href="' . wp_nonce_url( $location . '&del_stale_inactive=1', 'activation_key' ) . '" class="delete">'.__('Delete stale inactive signup keys older than 30 days').'</a>';
    76         echo '</span></div><br class="clear" />';
    77 */
    7854        echo '<table class="widefat"><tbody>';
    7955        echo '<thead><th>#</th><th>Registered</th><th>User</th><th>Email</th><th>Approve</th></thead>';
     
    9672}
    9773
    98 if (class_exists("ds_user_activation_keys")) {
    99     $ds_user_activation_keys = new ds_user_activation_keys();   
    100 }
     74new DS_User_Activation_Keys();
    10175?>
  • user-activation-keys/trunk/readme.txt

    r1470278 r1470381  
    4848
    4949== Changelog ==
    50 = 3.5.2 =
    51 * Tested up to: WP 3.9.2, removed batch delete, improved deleting an individual user key, typo fixes.
     50= 4.6 =
     51* WP 4.6 tests OK, cleanup php notices
    5252
    5353== Upgrade Notice ==
    54 = 3.5.2 =
    55 * Tested up to: WP 3.9.2, removed batch delete of old keys, improved deleting an individual user key, typo fixes.
     54= 4.6 =
     55* WP 4.6 tests OK, cleanup php notices
Note: See TracChangeset for help on using the changeset viewer.