From: Steve Sutton Date: Fri, 6 Sep 2019 20:44:13 +0000 (-0400) Subject: update to log only get request X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=e1e89b7933b510dbe4c7c16a7c672d8fb3b1e974;p=WP-Plugins%2Fglm-member-db.git update to log only get request post may have newlines and that messes things up a bit. --- 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 ); }