Changeset 1607026
- Timestamp:
- 03/03/2017 08:09:36 AM (9 years ago)
- Location:
- mpoperationlogs/trunk
- Files:
-
- 3 edited
-
lib/MpLogs.class.php (modified) (1 diff)
-
mpOperationLogs.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mpoperationlogs/trunk/lib/MpLogs.class.php
r1569115 r1607026 95 95 96 96 97 if(($post && $post->post_type == 'post') )97 if(($post && $post->post_type == 'post') && $post->post_status != 'auto-draft') 98 98 { 99 99 $userInfo = wp_cache_get($post->post_author,'users'); 100 100 $postTitle = $post->post_title; 101 101 $uid = $userInfo->ID; 102 $ip = mpoplogs_getUserIp(); 103 $ipObj = new MpIpLogs(); 104 $ips = $ipObj->checkoutUseIp($uid,$ip); 105 $ipId = 0; 106 if($ips) 107 $ipId = $ips->id; 108 else 109 $ipId = $ipObj ->addUserIp($uid,$ip); 110 $logs = new self(); 111 $data = array( 112 'class' => 'post', 113 'op_uid' => $uid, 114 'op_data_id' => (int)$postId, 115 'data_name' => $postTitle, 116 'op_time' => time(), 117 'op_ip_id' => $ipId, 118 'other_info' => '', 119 'op_user_name' => $userInfo->user_login, 120 ); 121 if(!$isDelete) 102 if($uid) 122 103 { 123 if($post->post_date == $post->post_modified) 124 $logs->action('create'); 104 $ip = mpoplogs_getUserIp(); 105 $ipObj = new MpIpLogs(); 106 $ips = $ipObj->checkoutUseIp($uid,$ip); 107 $ipId = 0; 108 if($ips) 109 $ipId = $ips->id; 125 110 else 126 $logs->action('update'); 111 $ipId = $ipObj ->addUserIp($uid,$ip); 112 $logs = new self(); 113 $data = array( 114 'class' => 'post', 115 'op_uid' => $uid, 116 'op_data_id' => (int)$postId, 117 'data_name' => $postTitle, 118 'op_time' => time(), 119 'op_ip_id' => $ipId, 120 'other_info' => '', 121 'op_user_name' => $userInfo->user_login, 122 ); 123 if(!$isDelete) 124 { 125 if($post->post_date == $post->post_modified) 126 $logs->action('create'); 127 else 128 $logs->action('update'); 129 } 130 else 131 { 132 $logs->action('delete'); 133 } 134 $logs->data($data)->insert(); 127 135 } 128 else 129 { 130 $logs->action('delete'); 131 } 132 $logs->data($data)->insert(); 136 133 137 } 134 138 } -
mpoperationlogs/trunk/mpOperationLogs.php
r1569223 r1607026 4 4 Plugin URI: https://wordpress.org/plugins/mpoperationlogs/ 5 5 Description: 后台管理员操作日志、后台登陆IP记录插件(administrator operation logs and IP record Plugin). 6 Version: 1.0. 06 Version: 1.0.1 7 7 Author: Mrpeng 8 8 Author URI: http://www.ipy8.com/ -
mpoperationlogs/trunk/readme.txt
r1569126 r1607026 34 34 = 1.0.0 = 35 35 * just getting started 36 37 = 1.0.1 = 38 * 取消记录自动删除‘自动草稿’日志记录
Note: See TracChangeset
for help on using the changeset viewer.