}
+ /**
+ * Log the User Actions
+ */
public function logUserActions()
{
+ if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] == 'glm-members-admin-menu-logs' ) {
+ return;
+ }
$user_id = get_current_user_id();
if ( !empty( $user_id ) ) {
- // $logFile = WP_CONTENT_DIR . '/user.log';
$logFile = GLM_MEMBERS_PLUGIN_MEDIA_PATH . '/' . date('Y-m-d') . '-user.log';
$timeZone = get_option( 'timezone_string' );
$cTimezone = date_default_timezone_get();
$errorLogTime = date( 'j-M-Y H:i:s e' );
- if ( !empty( $_POST ) ) {
- $type = 'POST';
- $typeData = $_POST;
+ if ( !empty( $_POST['option'] ) ) {
+ $_GET['option'] = $_POST['option'];
}
- if ( !empty( $_GET ) ) {
- $type = 'GET';
- $typeData = $_GET;
+ if ( !empty( $_POST['glm_action'] ) ) {
+ $_GET['glm_action'] = $_POST['glm_action'];
}
- error_log( "[{$errorLogTime}]\tIP: {$_SERVER['REMOTE_ADDR']}\tUSER: {$user_id}\t{$type}: " . serialize( $typeData ) . "\n", 3, $logFile );
+ error_log( "[{$errorLogTime}]\tIP: {$_SERVER['REMOTE_ADDR']}\tUSER: {$user_id}\tGET: " . serialize( $_GET ) . "\n", 3, $logFile );
}
date_default_timezone_set( $cTimezone );
}