Changeset 2624596
- Timestamp:
- 11/04/2021 03:58:43 PM (4 years ago)
- Location:
- disable-user-login
- Files:
-
- 4 added
- 8 edited
- 1 copied
-
tags/1.3.2 (copied) (copied from disable-user-login/trunk)
-
tags/1.3.2/disable-user-login.php (modified) (2 diffs)
-
tags/1.3.2/includes/class-ss-disable-user-login-plugin.php (modified) (8 diffs)
-
tags/1.3.2/languages/disable-user-login-cs_CZ.mo (added)
-
tags/1.3.2/languages/disable-user-login-cs_CZ.po (added)
-
tags/1.3.2/languages/disable-user-login.pot (modified) (4 diffs)
-
tags/1.3.2/readme.txt (modified) (2 diffs)
-
trunk/disable-user-login.php (modified) (2 diffs)
-
trunk/includes/class-ss-disable-user-login-plugin.php (modified) (8 diffs)
-
trunk/languages/disable-user-login-cs_CZ.mo (added)
-
trunk/languages/disable-user-login-cs_CZ.po (added)
-
trunk/languages/disable-user-login.pot (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
disable-user-login/tags/1.3.2/disable-user-login.php
r2511724 r2624596 4 4 * Plugin URI: http://wordpress.org/plugins/disable-user-login 5 5 * Description: Provides the ability to disable user accounts and prevent them from logging in. 6 * Version: 1.3. 17 * 6 * Version: 1.3.2 7 * 8 8 * Author: Saint Systems 9 9 * Author URI: https://www.saintsystems.com … … 11 11 * Domain Path: languages 12 12 * 13 * Copyright: �2019 Saint Systems13 * Copyright: © 2019 Saint Systems 14 14 * License: GNU General Public License v3.0 15 15 * License URI: http://www.gnu.org/licenses/gpl-3.0.html -
disable-user-login/tags/1.3.2/includes/class-ss-disable-user-login-plugin.php
r2511724 r2624596 16 16 * @var string 17 17 */ 18 private static $version = '1.3. 1';18 private static $version = '1.3.2'; 19 19 20 20 /** … … 39 39 public static function version() { 40 40 return self::$version; 41 } 42 43 /** 44 * Returns the user meta key 45 * 46 * @return string 47 */ 48 public static function user_meta_key() { 49 return self::$user_meta_key; 41 50 } 42 51 … … 79 88 add_action( 'personal_options_update', array( $this, 'save_disabled_field' ) ); 80 89 add_action( 'edit_user_profile_update', array( $this, 'save_disabled_field' ) ); 81 add_ action( 'manage_users_custom_column', array( $this, 'manage_users_column_content' ), 10, 3 );90 add_filter( 'manage_users_custom_column', array( $this, 'manage_users_column_content' ), 10, 3 ); 82 91 add_action( 'admin_footer-users.php', array( $this, 'manage_users_css' ) ); 83 92 add_action( 'admin_notices', array( $this, 'bulk_disable_user_notices' ) ); 84 93 85 94 // Disabled hook 86 95 add_action( 'disable_user_login.user_disabled', array( $this, 'force_logout' ), 10, 1 ); … … 127 136 $mofile = sprintf( '%1$s-%2$s.mo', 'disable-user-login', $locale ); 128 137 129 // Look for wp-content/languages/ woocommerce-mailchimp/woocommerce-mailchimp-{lang}_{country}.mo138 // Look for wp-content/languages/disable-user-login/disable-user-login-{lang}_{country}.mo 130 139 $mofile_global1 = WP_LANG_DIR . '/disable-user-login/' . $mofile; 131 140 132 // Look in wp-content/languages/plugins/ woocommerce-mailchimp141 // Look in wp-content/languages/plugins/disable-user-login 133 142 $mofile_global2 = WP_LANG_DIR . '/plugins/disable-user-login/' . $mofile; 134 143 … … 166 175 <tr> 167 176 <th> 168 <label for="disable_user_login"><?php _e(' Disable User Account', 'disable_user_login' ); ?></label>177 <label for="disable_user_login"><?php _e('Disable User Account', 'disable-user-login' ); ?></label> 169 178 </th> 170 179 <td> 171 180 <input type="checkbox" name="disable_user_login" id="disable_user_login" value="1" <?php checked( 1, get_the_author_meta( self::$user_meta_key, $user->ID ) ); ?> /> 172 <span class="description"><?php _e( 'If checked, the user cannot login with this account.' , 'disable_user_login' ); ?></span>181 <label for="disable_user_login"><span class="description"><?php _e( 'If checked, the user cannot login with this account.' , 'disable-user-login' ); ?></span></label> 173 182 </td> 174 183 </tr> … … 250 259 do_action( 'disable_user_login.disabled_login_attempt', $user ); 251 260 252 return new WP_Error( 'disable_user_login_user_disabled', apply_filters( 'disable_user_login.disabled_message', __( '<strong>ERROR</strong>: Account disabled.', 'disable _user_login' ) ) );261 return new WP_Error( 'disable_user_login_user_disabled', apply_filters( 'disable_user_login.disabled_message', __( '<strong>ERROR</strong>: Account disabled.', 'disable-user-login' ) ) ); 253 262 } 254 263 } … … 274 283 * Set content of disabled users column 275 284 * 276 * @since 1. 0.0277 * @param empty $ empty285 * @since 1.3.2 286 * @param empty $output 278 287 * @param string $column_name 279 * @param int $user_ ID288 * @param int $user_id 280 289 * @return string 281 290 */ 282 public function manage_users_column_content( $ empty, $column_name, $user_ID) {291 public function manage_users_column_content( $output, $column_name, $user_id ) { 283 292 284 293 if ( $column_name == 'disable_user_login' ) { 285 if ( get_the_author_meta( self::$user_meta_key, $user_ ID) == 1 ) {294 if ( get_the_author_meta( self::$user_meta_key, $user_id ) == 1 ) { 286 295 return __( 'Disabled', 'disable-user-login' ); 287 296 } 288 297 } 289 } 290 291 /** 292 * Specifiy the width of our custom column 298 299 return $output; // always return, otherwise we overwrite stuff from other plugins. 300 } 301 302 /** 303 * Specify the width of our custom column 293 304 * 294 305 * @since 1.0.0 … … 418 429 } 419 430 /** 420 * Trigger an action when a user's account is enabled431 * Trigger an action when an enabled user's account is disabled 421 432 * 422 433 * @since 1.2.0 -
disable-user-login/tags/1.3.2/languages/disable-user-login.pot
r2139618 r2624596 4 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 5 "Project-Id-Version: Disable User Login\n" 6 "POT-Creation-Date: 2019-08-14 11:03-0500\n" 7 "PO-Revision-Date: 2019-08-14 11:03-0500\n" 6 "POT-Creation-Date: 2021-06-25 14:37-0500\n" 7 "PO-Revision-Date: 2021-06-25 14:37-0500\n" 8 "Last-Translator: \n" 9 "Language-Team: \n" 8 10 "MIME-Version: 1.0\n" 9 11 "Content-Type: text/plain; charset=UTF-8\n" 10 12 "Content-Transfer-Encoding: 8bit\n" 11 "X-Generator: Poedit 1.8.12\n"13 "X-Generator: Poedit 3.0\n" 12 14 "X-Poedit-Basepath: ..\n" 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 13 16 "X-Poedit-WPHeader: disable-user-login.php\n" 14 17 "X-Poedit-SourceCharset: UTF-8\n" … … 17 20 "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 18 21 "X-Poedit-SearchPath-0: .\n" 19 "X-Poedit-SearchPathExcluded-0: *. js\n"22 "X-Poedit-SearchPathExcluded-0: *.min.js\n" 20 23 21 #: includes/class-ss-disable-user-login-plugin.php:16 522 msgid " Disable User Account"24 #: includes/class-ss-disable-user-login-plugin.php:168 25 msgid "Disable User Account" 23 26 msgstr "" 24 27 25 #: includes/class-ss-disable-user-login-plugin.php:1 6928 #: includes/class-ss-disable-user-login-plugin.php:172 26 29 msgid "If checked, the user cannot login with this account." 27 30 msgstr "" 28 31 29 #: includes/class-ss-disable-user-login-plugin.php:2 3132 #: includes/class-ss-disable-user-login-plugin.php:252 30 33 msgid "<strong>ERROR</strong>: Account disabled." 31 34 msgstr "" 32 35 33 #: includes/class-ss-disable-user-login-plugin.php:2 4834 #: includes/class-ss-disable-user-login-plugin.php:2 6536 #: includes/class-ss-disable-user-login-plugin.php:269 37 #: includes/class-ss-disable-user-login-plugin.php:286 35 38 msgid "Disabled" 36 39 msgstr "" 37 40 38 #: includes/class-ss-disable-user-login-plugin.php: 28441 #: includes/class-ss-disable-user-login-plugin.php:307 39 42 msgid "Enable" 40 43 msgstr "" 41 44 42 #: includes/class-ss-disable-user-login-plugin.php: 28545 #: includes/class-ss-disable-user-login-plugin.php:308 43 46 msgid "Disable" 44 47 msgstr "" 45 48 46 #: includes/class-ss-disable-user-login-plugin.php:3 2749 #: includes/class-ss-disable-user-login-plugin.php:359 47 50 #, php-format 48 51 msgid "Enabled %s user." … … 51 54 msgstr[1] "" 52 55 53 #: includes/class-ss-disable-user-login-plugin.php:3 3756 #: includes/class-ss-disable-user-login-plugin.php:369 54 57 #, php-format 55 58 msgid "Disabled %s user." … … 57 60 msgstr[0] "" 58 61 msgstr[1] "" 62 63 #. Plugin Name of the plugin/theme 64 msgid "Disable User Login" 65 msgstr "" 66 67 #. Plugin URI of the plugin/theme 68 msgid "http://wordpress.org/plugins/disable-user-login" 69 msgstr "" 70 71 #. Description of the plugin/theme 72 msgid "" 73 "Provides the ability to disable user accounts and prevent them from logging " 74 "in." 75 msgstr "" 76 77 #. Author of the plugin/theme 78 msgid "Saint Systems" 79 msgstr "" 80 81 #. Author URI of the plugin/theme 82 msgid "https://www.saintsystems.com" 83 msgstr "" -
disable-user-login/tags/1.3.2/readme.txt
r2511724 r2624596 1 1 === Disable User Login === 2 2 Contributors: saintsystems, anderly 3 Donate link: http ://ssms.us/hVdk3 Donate link: https://ssms.us/donate 4 4 Tags: users, user, login, account, disable 5 5 Requires at least: 4.7.0 6 Tested up to: 5.7 .06 Tested up to: 5.7 7 7 Requires PHP: 5.6 8 Stable tag: 1.3. 18 Stable tag: 1.3.2 9 9 License: GPLv3 10 10 … … 49 49 == Changelog == 50 50 51 = 1.3.2 = 52 * Static method to return user meta key 53 * Fix some comments 54 51 55 = 1.3.1 = 52 56 * Update to prevent disabling super admins on bulk disable. -
disable-user-login/trunk/disable-user-login.php
r2511724 r2624596 4 4 * Plugin URI: http://wordpress.org/plugins/disable-user-login 5 5 * Description: Provides the ability to disable user accounts and prevent them from logging in. 6 * Version: 1.3. 17 * 6 * Version: 1.3.2 7 * 8 8 * Author: Saint Systems 9 9 * Author URI: https://www.saintsystems.com … … 11 11 * Domain Path: languages 12 12 * 13 * Copyright: �2019 Saint Systems13 * Copyright: © 2019 Saint Systems 14 14 * License: GNU General Public License v3.0 15 15 * License URI: http://www.gnu.org/licenses/gpl-3.0.html -
disable-user-login/trunk/includes/class-ss-disable-user-login-plugin.php
r2511724 r2624596 16 16 * @var string 17 17 */ 18 private static $version = '1.3. 1';18 private static $version = '1.3.2'; 19 19 20 20 /** … … 39 39 public static function version() { 40 40 return self::$version; 41 } 42 43 /** 44 * Returns the user meta key 45 * 46 * @return string 47 */ 48 public static function user_meta_key() { 49 return self::$user_meta_key; 41 50 } 42 51 … … 79 88 add_action( 'personal_options_update', array( $this, 'save_disabled_field' ) ); 80 89 add_action( 'edit_user_profile_update', array( $this, 'save_disabled_field' ) ); 81 add_ action( 'manage_users_custom_column', array( $this, 'manage_users_column_content' ), 10, 3 );90 add_filter( 'manage_users_custom_column', array( $this, 'manage_users_column_content' ), 10, 3 ); 82 91 add_action( 'admin_footer-users.php', array( $this, 'manage_users_css' ) ); 83 92 add_action( 'admin_notices', array( $this, 'bulk_disable_user_notices' ) ); 84 93 85 94 // Disabled hook 86 95 add_action( 'disable_user_login.user_disabled', array( $this, 'force_logout' ), 10, 1 ); … … 127 136 $mofile = sprintf( '%1$s-%2$s.mo', 'disable-user-login', $locale ); 128 137 129 // Look for wp-content/languages/ woocommerce-mailchimp/woocommerce-mailchimp-{lang}_{country}.mo138 // Look for wp-content/languages/disable-user-login/disable-user-login-{lang}_{country}.mo 130 139 $mofile_global1 = WP_LANG_DIR . '/disable-user-login/' . $mofile; 131 140 132 // Look in wp-content/languages/plugins/ woocommerce-mailchimp141 // Look in wp-content/languages/plugins/disable-user-login 133 142 $mofile_global2 = WP_LANG_DIR . '/plugins/disable-user-login/' . $mofile; 134 143 … … 166 175 <tr> 167 176 <th> 168 <label for="disable_user_login"><?php _e(' Disable User Account', 'disable_user_login' ); ?></label>177 <label for="disable_user_login"><?php _e('Disable User Account', 'disable-user-login' ); ?></label> 169 178 </th> 170 179 <td> 171 180 <input type="checkbox" name="disable_user_login" id="disable_user_login" value="1" <?php checked( 1, get_the_author_meta( self::$user_meta_key, $user->ID ) ); ?> /> 172 <span class="description"><?php _e( 'If checked, the user cannot login with this account.' , 'disable_user_login' ); ?></span>181 <label for="disable_user_login"><span class="description"><?php _e( 'If checked, the user cannot login with this account.' , 'disable-user-login' ); ?></span></label> 173 182 </td> 174 183 </tr> … … 250 259 do_action( 'disable_user_login.disabled_login_attempt', $user ); 251 260 252 return new WP_Error( 'disable_user_login_user_disabled', apply_filters( 'disable_user_login.disabled_message', __( '<strong>ERROR</strong>: Account disabled.', 'disable _user_login' ) ) );261 return new WP_Error( 'disable_user_login_user_disabled', apply_filters( 'disable_user_login.disabled_message', __( '<strong>ERROR</strong>: Account disabled.', 'disable-user-login' ) ) ); 253 262 } 254 263 } … … 274 283 * Set content of disabled users column 275 284 * 276 * @since 1. 0.0277 * @param empty $ empty285 * @since 1.3.2 286 * @param empty $output 278 287 * @param string $column_name 279 * @param int $user_ ID288 * @param int $user_id 280 289 * @return string 281 290 */ 282 public function manage_users_column_content( $ empty, $column_name, $user_ID) {291 public function manage_users_column_content( $output, $column_name, $user_id ) { 283 292 284 293 if ( $column_name == 'disable_user_login' ) { 285 if ( get_the_author_meta( self::$user_meta_key, $user_ ID) == 1 ) {294 if ( get_the_author_meta( self::$user_meta_key, $user_id ) == 1 ) { 286 295 return __( 'Disabled', 'disable-user-login' ); 287 296 } 288 297 } 289 } 290 291 /** 292 * Specifiy the width of our custom column 298 299 return $output; // always return, otherwise we overwrite stuff from other plugins. 300 } 301 302 /** 303 * Specify the width of our custom column 293 304 * 294 305 * @since 1.0.0 … … 418 429 } 419 430 /** 420 * Trigger an action when a user's account is enabled431 * Trigger an action when an enabled user's account is disabled 421 432 * 422 433 * @since 1.2.0 -
disable-user-login/trunk/languages/disable-user-login.pot
r2139618 r2624596 4 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 5 "Project-Id-Version: Disable User Login\n" 6 "POT-Creation-Date: 2019-08-14 11:03-0500\n" 7 "PO-Revision-Date: 2019-08-14 11:03-0500\n" 6 "POT-Creation-Date: 2021-06-25 14:37-0500\n" 7 "PO-Revision-Date: 2021-06-25 14:37-0500\n" 8 "Last-Translator: \n" 9 "Language-Team: \n" 8 10 "MIME-Version: 1.0\n" 9 11 "Content-Type: text/plain; charset=UTF-8\n" 10 12 "Content-Transfer-Encoding: 8bit\n" 11 "X-Generator: Poedit 1.8.12\n"13 "X-Generator: Poedit 3.0\n" 12 14 "X-Poedit-Basepath: ..\n" 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" 13 16 "X-Poedit-WPHeader: disable-user-login.php\n" 14 17 "X-Poedit-SourceCharset: UTF-8\n" … … 17 20 "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 18 21 "X-Poedit-SearchPath-0: .\n" 19 "X-Poedit-SearchPathExcluded-0: *. js\n"22 "X-Poedit-SearchPathExcluded-0: *.min.js\n" 20 23 21 #: includes/class-ss-disable-user-login-plugin.php:16 522 msgid " Disable User Account"24 #: includes/class-ss-disable-user-login-plugin.php:168 25 msgid "Disable User Account" 23 26 msgstr "" 24 27 25 #: includes/class-ss-disable-user-login-plugin.php:1 6928 #: includes/class-ss-disable-user-login-plugin.php:172 26 29 msgid "If checked, the user cannot login with this account." 27 30 msgstr "" 28 31 29 #: includes/class-ss-disable-user-login-plugin.php:2 3132 #: includes/class-ss-disable-user-login-plugin.php:252 30 33 msgid "<strong>ERROR</strong>: Account disabled." 31 34 msgstr "" 32 35 33 #: includes/class-ss-disable-user-login-plugin.php:2 4834 #: includes/class-ss-disable-user-login-plugin.php:2 6536 #: includes/class-ss-disable-user-login-plugin.php:269 37 #: includes/class-ss-disable-user-login-plugin.php:286 35 38 msgid "Disabled" 36 39 msgstr "" 37 40 38 #: includes/class-ss-disable-user-login-plugin.php: 28441 #: includes/class-ss-disable-user-login-plugin.php:307 39 42 msgid "Enable" 40 43 msgstr "" 41 44 42 #: includes/class-ss-disable-user-login-plugin.php: 28545 #: includes/class-ss-disable-user-login-plugin.php:308 43 46 msgid "Disable" 44 47 msgstr "" 45 48 46 #: includes/class-ss-disable-user-login-plugin.php:3 2749 #: includes/class-ss-disable-user-login-plugin.php:359 47 50 #, php-format 48 51 msgid "Enabled %s user." … … 51 54 msgstr[1] "" 52 55 53 #: includes/class-ss-disable-user-login-plugin.php:3 3756 #: includes/class-ss-disable-user-login-plugin.php:369 54 57 #, php-format 55 58 msgid "Disabled %s user." … … 57 60 msgstr[0] "" 58 61 msgstr[1] "" 62 63 #. Plugin Name of the plugin/theme 64 msgid "Disable User Login" 65 msgstr "" 66 67 #. Plugin URI of the plugin/theme 68 msgid "http://wordpress.org/plugins/disable-user-login" 69 msgstr "" 70 71 #. Description of the plugin/theme 72 msgid "" 73 "Provides the ability to disable user accounts and prevent them from logging " 74 "in." 75 msgstr "" 76 77 #. Author of the plugin/theme 78 msgid "Saint Systems" 79 msgstr "" 80 81 #. Author URI of the plugin/theme 82 msgid "https://www.saintsystems.com" 83 msgstr "" -
disable-user-login/trunk/readme.txt
r2511724 r2624596 1 1 === Disable User Login === 2 2 Contributors: saintsystems, anderly 3 Donate link: http ://ssms.us/hVdk3 Donate link: https://ssms.us/donate 4 4 Tags: users, user, login, account, disable 5 5 Requires at least: 4.7.0 6 Tested up to: 5.7 .06 Tested up to: 5.7 7 7 Requires PHP: 5.6 8 Stable tag: 1.3. 18 Stable tag: 1.3.2 9 9 License: GPLv3 10 10 … … 49 49 == Changelog == 50 50 51 = 1.3.2 = 52 * Static method to return user meta key 53 * Fix some comments 54 51 55 = 1.3.1 = 52 56 * Update to prevent disabling super admins on bulk disable.
Note: See TracChangeset
for help on using the changeset viewer.