Submit
Path:
~
/
home
/
getwphos
/
www
/
deerguard
/
wp-content
/
plugins
/
wp-security-audit-log
/
classes
/
WPSensors
/
File Content:
class-wp-register-sensor.php
<?php /** * Sensor: Register * * Register sensor class file. * * @since 4.6.0 * @package wsal * @subpackage sensors */ declare(strict_types=1); namespace WSAL\WP_Sensors; use WSAL\Helpers\WP_Helper; use WSAL\Helpers\Settings_Helper; use WSAL\Controllers\Alert_Manager; // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( ! class_exists( '\WSAL\WP_Sensors\WP_Register_Sensor' ) ) { /** * User registration sensor. * * 4000 New user was created on WordPress * * @package wsal * @subpackage sensors */ class WP_Register_Sensor { /** * Is that a login sensor or not? * Sensors doesn't need to have this property, except where they explicitly not to set that value. * * @var boolean * * @since 4.5.0 */ private static $login_sensor = true; /** * Inits the main hooks * * @return void * * @since 4.5.0 */ public static function init() { /* * Default WordPress registration utilizes action 'register_new_user', but we cannot rely on it to detect * a front-end registration implemented by a third party. We hook into the action 'user_register' because it is * part of the function 'wp_insert_user' that definitely runs. */ \add_action( 'user_register', array( __CLASS__, 'event_user_register' ), 10, 1 ); } /** * Is that a front end sensor? The sensors doesn't need to have that method implemented, except if they want to specifically set that value. * * @return boolean * * @since 4.5.0 */ public static function is_login_sensor() { return self::$login_sensor; } /** * That needs to be registered as a frontend sensor, when the admin sets the plugin to monitor the login from 3rd parties. * * @return boolean * * @since 4.5.1 */ public static function is_frontend_sensor(): bool { $frontend_events = Settings_Helper::get_frontend_events(); $should_load = ! empty( $frontend_events['register'] ) || ! empty( $frontend_events['login'] ) || ! empty( $frontend_events['woocommerce'] ); if ( $should_load ) { return true; } return false; } /** * When a user registers, action 'user_register' is fired because it is part of the function 'wp_insert_user'. We * can assume event 4000 if the current session is not logged in. * * @param int $user_id - User ID of the registered user. * * @since 4.5.0 */ public static function event_user_register( $user_id ) { if ( is_user_logged_in() ) { // We bail if the user is logged in. That is no longer user registration, but user creation. return; } $user = get_userdata( $user_id ); if ( ! $user instanceof \WP_User ) { // Bail if the user is not valid for some reason. return; } $new_user_data = array( 'Username' => $user->user_login, 'Email' => $user->user_email, 'FirstName' => ( $user->user_firstname ) ?? '', 'LastName' => ( $user->user_lastname ) ?? '', 'Roles' => is_array( $user->roles ) ? implode( ', ', $user->roles ) : $user->roles, ); $event_data = array( 'NewUserID' => $user_id, 'NewUserData' => (object) $new_user_data, 'EditUserLink' => \add_query_arg( 'user_id', $user_id, \network_admin_url( 'user-edit.php' ) ), ); if ( function_exists( 'get_current_user_id' ) ) { $event_data['Username'] = 'System'; } if ( WP_Helper::is_multisite() ) { // Registration should not be logged on multisite if event 4024 is fired. Alert_Manager::trigger_event_if( 4000, $event_data, /** * Don't log if event 4024 is fired. */ function () { return ! Alert_Manager::will_trigger( 4013 ); } ); } else { Alert_Manager::trigger_event( 4000, $event_data, true ); } } } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
Alerts
---
0755
Helpers
---
0755
.DS_Store
6148 bytes
0644
class-acf-meta-sensor.php
5398 bytes
0644
class-acf-sensor.php
18555 bytes
0644
class-bbpress-sensor.php
27193 bytes
0644
class-bbpress-system-sensor.php
3777 bytes
0644
class-bbpress-user-sensor.php
11135 bytes
0644
class-gravity-forms-sensor.php
49475 bytes
0644
class-main-wp-sensor.php
14131 bytes
0644
class-mainwp-server-sensor.php
26058 bytes
0644
class-memberpress-sensor.php
52670 bytes
0644
class-multisite-sign-up-sensor.php
3722 bytes
0644
class-rank-math-sensor.php
11911 bytes
0644
class-redirection-sensor.php
14254 bytes
0644
class-tablepress-sensor.php
17655 bytes
0644
class-termly-sensor.php
9341 bytes
0644
class-woocommerce-public-sensor.php
24098 bytes
0644
class-woocommerce-sensor-helper-second.php
103733 bytes
0644
class-woocommerce-sensor-helper-third.php
4406 bytes
0644
class-woocommerce-sensor-helper.php
98594 bytes
0644
class-woocommerce-sensor.php
48936 bytes
0644
class-wp-2fa-sensor.php
11628 bytes
0644
class-wp-comments-sensor.php
7104 bytes
0644
class-wp-content-sensor.php
58785 bytes
0644
class-wp-database-sensor.php
17912 bytes
0644
class-wp-files-sensor.php
4531 bytes
0644
class-wp-log-in-out-sensor.php
20101 bytes
0644
class-wp-menus-sensor.php
24986 bytes
0644
class-wp-metadata-sensor.php
23063 bytes
0644
class-wp-multisite-sensor.php
13562 bytes
0644
class-wp-plugins-themes-sensor.php
37203 bytes
0644
class-wp-register-sensor.php
3808 bytes
0644
class-wp-request-sensor.php
3390 bytes
0644
class-wp-system-sensor.php
45784 bytes
0644
class-wp-user-profile-sensor.php
21796 bytes
0644
class-wp-widgets-sensor.php
10878 bytes
0644
class-wpforms-sensor.php
52009 bytes
0644
class-yoast-seo-sensor.php
71603 bytes
0644
index.php
58 bytes
0644
N4ST4R_ID | Naxtarrr