From e1e89b7933b510dbe4c7c16a7c672d8fb3b1e974 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 6 Sep 2019 16:44:13 -0400 Subject: [PATCH] update to log only get request post may have newlines and that messes things up a bit. --- controllers/admin.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/controllers/admin.php b/controllers/admin.php index 2a484042..cfccabaf 100755 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -1122,11 +1122,16 @@ class glmMembersAdmin extends GlmPluginSupport } + /** + * 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(); @@ -1134,16 +1139,14 @@ class glmMembersAdmin extends GlmPluginSupport $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 ); } -- 2.17.1