Changeset 2578321
- Timestamp:
- 08/04/2021 07:05:36 PM (5 years ago)
- Location:
- secured-wp
- Files:
-
- 1 deleted
- 12 edited
- 1 copied
-
tags/1.4 (deleted)
-
tags/1.5 (copied) (copied from secured-wp/trunk)
-
tags/1.5/classes/Controllers/User.php (modified) (2 diffs)
-
tags/1.5/classes/Views/LoginForms.php (modified) (3 diffs)
-
tags/1.5/classes/Views/UsersList.php (modified) (3 diffs)
-
tags/1.5/constants.php (modified) (1 diff)
-
tags/1.5/readme.txt (modified) (1 diff)
-
tags/1.5/secured-wp.php (modified) (1 diff)
-
trunk/classes/Controllers/User.php (modified) (2 diffs)
-
trunk/classes/Views/LoginForms.php (modified) (3 diffs)
-
trunk/classes/Views/UsersList.php (modified) (3 diffs)
-
trunk/constants.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/secured-wp.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
secured-wp/tags/1.5/classes/Controllers/User.php
r2577925 r2578321 260 260 self::setUser( $user ); 261 261 262 return false !== \get_transient( self::$transientPrefix . self::$user-> user_login) ? true : false;262 return false !== \get_transient( self::$transientPrefix . self::$user->ID ) ? true : false; 263 263 } 264 264 … … 288 288 289 289 \set_transient( 290 self::getLockedTransientPrefix() . self::$user-> user_login,290 self::getLockedTransientPrefix() . self::$user->ID, 291 291 self::$user->user_login, 292 292 60 * LoginAttempts::getLockTimeMins() -
secured-wp/tags/1.5/classes/Views/LoginForms.php
r2576070 r2578321 48 48 * @return void 49 49 * 50 * SuppressWarnings(PHPMD.superglobals) 50 * @SuppressWarnings(PHPMD.ExitExpression) 51 * @SuppressWarnings(PHPMD.Superglobals) 51 52 */ 52 53 public static function loginTotp( $error = '', $user = null ) { … … 156 157 * @return void 157 158 * 159 * @SuppressWarnings(PHPMD.ExitExpression) 158 160 * @SuppressWarnings(PHPMD.Superglobals) 159 161 */ … … 285 287 </div> 286 288 <script> 287 jQuery( document ).on( 'click', '#send-oob-mail', function ( e ) { 288 e.preventDefault(); 289 jQuery.ajax({ 290 type : "GET", 291 dataType : "json", 292 url : "<?php echo \esc_url( \admin_url( 'admin-ajax.php' ) ); ?>", 293 data : {action: "send_oob", userId: "<?php echo \esc_attr( $userID ); ?>", redirectTo: "<?php echo \esc_attr( $redirectTo ); ?>"}, 294 success: function( response ) { 295 296 jQuery('#wsc-oob-wrapper').html( response['message'] ) 297 } 298 }); 299 }); 300 289 var element = document.getElementById('send-oob-mail'); 290 element.addEventListener("click", function(e) { 291 e.preventDefault(); 292 var request = new XMLHttpRequest(); 293 294 request.open('GET', '<?php echo \esc_url( \admin_url( 'admin-ajax.php' ) ); ?>?action=send_oob&userId=<?php echo \esc_attr( $userID ); ?>&redirectTo=<?php echo \esc_attr( $redirectTo ); ?>', true); 295 request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;'); 296 request.responseType = 'json'; 297 request.onload = function () { 298 if (this.status >= 200 && this.status < 400) { 299 document.getElementById('wsc-oob-wrapper').innerHTML = this.response['message']; 300 } else { 301 // If fail 302 console.log(this.response); 303 } 304 }; 305 request.onerror = function() { 306 console.log('Connection error'); 307 }; 308 request.send(); 309 }, false); 301 310 </script> 302 311 <?php -
secured-wp/tags/1.5/classes/Views/UsersList.php
r2577925 r2578321 106 106 */ 107 107 \add_filter( 'manage_users_columns', [ __CLASS__, 'addUsersLockedColumn' ] ); 108 \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumn ' ] );108 \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumnSort' ] ); 109 109 \add_filter( 'manage_users_custom_column', [ __CLASS__, 'lockedUserColumnData' ], 10, 3 ); 110 110 … … 171 171 172 172 /** 173 * Sets the user locked column 174 * 175 * @since 1.5 176 * 177 * @param array $columns - array with all user columns. 178 * 179 * @return array 180 */ 181 public static function addUsersLockedColumnSort( array $columns ): array { 182 $columns[ self::$lockedColumnName ] = self::$lockedColumnName; 183 return $columns; 184 } 185 186 /** 173 187 * Sets the locked user column data 174 188 * … … 280 294 281 295 if ( isset( $wPUserQuery->query_vars['orderby'] ) 282 && ( __( 'Locked status', 'secured-wp' )=== $wPUserQuery->query_vars['orderby'] )296 && ( self::$lockedColumnName === $wPUserQuery->query_vars['orderby'] ) 283 297 ) { 284 298 $wPUserQuery->query_orderby = " ORDER BY (SELECT wpo.option_value FROM {$wpdb->options} as wpo -
secured-wp/tags/1.5/constants.php
r2576070 r2578321 16 16 define( 'WPSEC_REQUIRED_PHP_VERSION', '7.2' ); 17 17 define( 'WPSEC_REQUIRED_WP_VERSION', '5.0' ); 18 define( 'WPSEC_PLUGIN_SECURED_VERSION', '1. 0.0' );18 define( 'WPSEC_PLUGIN_SECURED_VERSION', '1.5' ); 19 19 define( 'WPSEC_PLUGIN_SECURED_NAME', 'Secured WP' ); 20 20 define( 'WPSEC_PLUGIN_SECURED_SLUG', 'secured-wp' ); -
secured-wp/tags/1.5/readme.txt
r2577922 r2578321 5 5 Tested up to: 5.8 6 6 Requires PHP: 7.2 7 Stable tag: 1. 47 Stable tag: 1.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
secured-wp/tags/1.5/secured-wp.php
r2577925 r2578321 16 16 * Plugin URI: https://wp-secured.com 17 17 * Description: Provides Security for WP sites. 2FA, login attempts, hardens WP login process 18 <<<<<<< HEAD 19 * Version: 1.4 20 ======= 21 * Version: 1.3 22 >>>>>>> 2f789104d0138048ccdce57a31ec7ac6d526f8ba 18 * Version: 1.5 23 19 * Author: wp-secured 24 20 * Author URI: https://wp-secured.com -
secured-wp/trunk/classes/Controllers/User.php
r2577925 r2578321 260 260 self::setUser( $user ); 261 261 262 return false !== \get_transient( self::$transientPrefix . self::$user-> user_login) ? true : false;262 return false !== \get_transient( self::$transientPrefix . self::$user->ID ) ? true : false; 263 263 } 264 264 … … 288 288 289 289 \set_transient( 290 self::getLockedTransientPrefix() . self::$user-> user_login,290 self::getLockedTransientPrefix() . self::$user->ID, 291 291 self::$user->user_login, 292 292 60 * LoginAttempts::getLockTimeMins() -
secured-wp/trunk/classes/Views/LoginForms.php
r2576070 r2578321 48 48 * @return void 49 49 * 50 * SuppressWarnings(PHPMD.superglobals) 50 * @SuppressWarnings(PHPMD.ExitExpression) 51 * @SuppressWarnings(PHPMD.Superglobals) 51 52 */ 52 53 public static function loginTotp( $error = '', $user = null ) { … … 156 157 * @return void 157 158 * 159 * @SuppressWarnings(PHPMD.ExitExpression) 158 160 * @SuppressWarnings(PHPMD.Superglobals) 159 161 */ … … 285 287 </div> 286 288 <script> 287 jQuery( document ).on( 'click', '#send-oob-mail', function ( e ) { 288 e.preventDefault(); 289 jQuery.ajax({ 290 type : "GET", 291 dataType : "json", 292 url : "<?php echo \esc_url( \admin_url( 'admin-ajax.php' ) ); ?>", 293 data : {action: "send_oob", userId: "<?php echo \esc_attr( $userID ); ?>", redirectTo: "<?php echo \esc_attr( $redirectTo ); ?>"}, 294 success: function( response ) { 295 296 jQuery('#wsc-oob-wrapper').html( response['message'] ) 297 } 298 }); 299 }); 300 289 var element = document.getElementById('send-oob-mail'); 290 element.addEventListener("click", function(e) { 291 e.preventDefault(); 292 var request = new XMLHttpRequest(); 293 294 request.open('GET', '<?php echo \esc_url( \admin_url( 'admin-ajax.php' ) ); ?>?action=send_oob&userId=<?php echo \esc_attr( $userID ); ?>&redirectTo=<?php echo \esc_attr( $redirectTo ); ?>', true); 295 request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;'); 296 request.responseType = 'json'; 297 request.onload = function () { 298 if (this.status >= 200 && this.status < 400) { 299 document.getElementById('wsc-oob-wrapper').innerHTML = this.response['message']; 300 } else { 301 // If fail 302 console.log(this.response); 303 } 304 }; 305 request.onerror = function() { 306 console.log('Connection error'); 307 }; 308 request.send(); 309 }, false); 301 310 </script> 302 311 <?php -
secured-wp/trunk/classes/Views/UsersList.php
r2577925 r2578321 106 106 */ 107 107 \add_filter( 'manage_users_columns', [ __CLASS__, 'addUsersLockedColumn' ] ); 108 \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumn ' ] );108 \add_filter( 'manage_users_sortable_columns', [ __CLASS__, 'addUsersLockedColumnSort' ] ); 109 109 \add_filter( 'manage_users_custom_column', [ __CLASS__, 'lockedUserColumnData' ], 10, 3 ); 110 110 … … 171 171 172 172 /** 173 * Sets the user locked column 174 * 175 * @since 1.5 176 * 177 * @param array $columns - array with all user columns. 178 * 179 * @return array 180 */ 181 public static function addUsersLockedColumnSort( array $columns ): array { 182 $columns[ self::$lockedColumnName ] = self::$lockedColumnName; 183 return $columns; 184 } 185 186 /** 173 187 * Sets the locked user column data 174 188 * … … 280 294 281 295 if ( isset( $wPUserQuery->query_vars['orderby'] ) 282 && ( __( 'Locked status', 'secured-wp' )=== $wPUserQuery->query_vars['orderby'] )296 && ( self::$lockedColumnName === $wPUserQuery->query_vars['orderby'] ) 283 297 ) { 284 298 $wPUserQuery->query_orderby = " ORDER BY (SELECT wpo.option_value FROM {$wpdb->options} as wpo -
secured-wp/trunk/constants.php
r2576070 r2578321 16 16 define( 'WPSEC_REQUIRED_PHP_VERSION', '7.2' ); 17 17 define( 'WPSEC_REQUIRED_WP_VERSION', '5.0' ); 18 define( 'WPSEC_PLUGIN_SECURED_VERSION', '1. 0.0' );18 define( 'WPSEC_PLUGIN_SECURED_VERSION', '1.5' ); 19 19 define( 'WPSEC_PLUGIN_SECURED_NAME', 'Secured WP' ); 20 20 define( 'WPSEC_PLUGIN_SECURED_SLUG', 'secured-wp' ); -
secured-wp/trunk/readme.txt
r2577922 r2578321 5 5 Tested up to: 5.8 6 6 Requires PHP: 7.2 7 Stable tag: 1. 47 Stable tag: 1.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
secured-wp/trunk/secured-wp.php
r2577925 r2578321 16 16 * Plugin URI: https://wp-secured.com 17 17 * Description: Provides Security for WP sites. 2FA, login attempts, hardens WP login process 18 <<<<<<< HEAD 19 * Version: 1.4 20 ======= 21 * Version: 1.3 22 >>>>>>> 2f789104d0138048ccdce57a31ec7ac6d526f8ba 18 * Version: 1.5 23 19 * Author: wp-secured 24 20 * Author URI: https://wp-secured.com
Note: See TracChangeset
for help on using the changeset viewer.