| @@ -15,14 +15,14 @@ | ||
| 15 | 15 | * |
| 16 | 16 | * @return void |
| 17 | 17 | */ |
| 18 | 18 | public function __construct() { |
| 19 | - add_action( 'wp_login', array( &$this, 'login' ), 10, 2 ); | |
| 20 | - add_action( 'delete_user', array( &$this, 'deleteUser' ) ); | |
| 21 | - add_action( 'user_register', array( &$this, 'register' ) ); | |
| 22 | - add_action( 'profile_update', array( &$this, 'profileUpdate' ) ); | |
| 23 | - add_action( 'validate_password_reset', array( &$this, 'resetPassword' ), 10, 2 ); | |
| 24 | - add_filter( 'wp_login_failed', array( &$this, 'wrongPassword' ) ); | |
| 19 | + add_action( 'wp_login', [ &$this, 'login' ], 10, 2 ); | |
| 20 | + add_action( 'delete_user', [ &$this, 'deleteUser' ] ); | |
| 21 | + add_action( 'user_register', [ &$this, 'register' ] ); | |
| 22 | + add_action( 'profile_update', [ &$this, 'profileUpdate' ] ); | |
| 23 | + add_action( 'validate_password_reset', [ &$this, 'resetPassword' ], 10, 2 ); | |
| 24 | + add_filter( 'wp_login_failed', [ &$this, 'wrongPassword' ] ); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * When a user is logging in. |
| @@ -32,14 +32,14 @@ | ||
| 32 | 32 | * @return void |
| 33 | 33 | */ |
| 34 | 34 | public function login( $user_login, $user ) { |
| 35 | 35 | $this->insert( |
| 36 | - array( | |
| 36 | + [ | |
| 37 | 37 | 'action' => 'logged in', |
| 38 | 38 | 'object' => 'user', |
| 39 | 39 | 'object_id' => $user->ID, |
| 40 | 40 | 'object_name' => esc_html( $user->user_nicename ), |
| 41 | - ) | |
| 41 | + ] | |
| 42 | 42 | ); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
| @@ -50,14 +50,14 @@ | ||
| 50 | 50 | */ |
| 51 | 51 | public function register( $user_id ) { |
| 52 | 52 | $user = get_user_by( 'id', $user_id ); |
| 53 | 53 | $this->insert( |
| 54 | - array( | |
| 54 | + [ | |
| 55 | 55 | 'action' => 'registered', |
| 56 | 56 | 'object' => 'user', |
| 57 | 57 | 'object_id' => $user->ID, |
| 58 | 58 | 'object_name' => esc_html( $user->user_nicename ), |
| 59 | - ) | |
| 59 | + ] | |
| 60 | 60 | ); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
| @@ -68,14 +68,14 @@ | ||
| 68 | 68 | */ |
| 69 | 69 | public function deleteUser( $user_id ) { |
| 70 | 70 | $user = get_user_by( 'id', $user_id ); |
| 71 | 71 | $this->insert( |
| 72 | - array( | |
| 72 | + [ | |
| 73 | 73 | 'action' => 'deleted', |
| 74 | 74 | 'object' => 'user', |
| 75 | 75 | 'object_id' => $user->ID, |
| 76 | 76 | 'object_name' => esc_html( $user->user_nicename ), |
| 77 | - ) | |
| 77 | + ] | |
| 78 | 78 | ); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
| @@ -86,14 +86,14 @@ | ||
| 86 | 86 | */ |
| 87 | 87 | public function profileUpdate( $user_id ) { |
| 88 | 88 | $user = get_user_by( 'id', $user_id ); |
| 89 | 89 | $this->insert( |
| 90 | - array( | |
| 90 | + [ | |
| 91 | 91 | 'action' => 'updated', |
| 92 | 92 | 'object' => 'user', |
| 93 | 93 | 'object_id' => $user->ID, |
| 94 | 94 | 'object_name' => esc_html( $user->user_nicename ), |
| 95 | - ) | |
| 95 | + ] | |
| 96 | 96 | ); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
| @@ -103,14 +103,14 @@ | ||
| 103 | 103 | * @return void |
| 104 | 104 | */ |
| 105 | 105 | public function wrongPassword( $username ) { |
| 106 | 106 | $this->insert( |
| 107 | - array( | |
| 107 | + [ | |
| 108 | 108 | 'action' => 'failed login', |
| 109 | 109 | 'object' => 'user', |
| 110 | 110 | 'object_id' => 0, |
| 111 | 111 | 'object_name' => esc_html( $username ), |
| 112 | - ) | |
| 112 | + ] | |
| 113 | 113 | ); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| @@ -122,14 +122,14 @@ | ||
| 122 | 122 | */ |
| 123 | 123 | public function resetPassword( $errors, $user ) { |
| 124 | 124 | if ( is_a( $user, 'WP_User' ) ) { |
| 125 | 125 | $this->insert( |
| 126 | - array( | |
| 126 | + [ | |
| 127 | 127 | 'action' => 'password reset', |
| 128 | 128 | 'object' => 'user', |
| 129 | 129 | 'object_id' => 0, |
| 130 | 130 | 'object_name' => esc_html( $user->user_login ), |
| 131 | - ) | |
| 131 | + ] | |
| 132 | 132 | ); |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | } |