Crazy Bone - Version 0.5.2

Version Description

Download this release

Release Info

Developer wokamoto
Plugin Icon wp plugin Crazy Bone
Version 0.5.2
Comparing to
See all releases

Code changes from version 0.5.1 to 0.5.2

Files changed (2) hide show
  1. plugin.php +15 -3
  2. readme.txt +5 -2
plugin.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Crazy Bone
4
  Plugin URI: https://github.com/wokamoto/crazy-bone
5
  Description: Tracks user name, time of login, IP address and browser user agent.
6
  Author: wokamoto
7
- Version: 0.5.1
8
  Author URI: http://dogmap.jp/
9
  Text Domain: user-login-log
10
  Domain Path: /languages/
@@ -78,6 +78,8 @@ class crazy_bone {
78
  add_action('wp_login', array($this, 'user_login_log'), 10, 2);
79
  add_action('wp_authenticate', array($this, 'wp_authenticate_log'), 10, 2);
80
  add_action('login_form_logout', array($this, 'user_logout_log'));
 
 
81
 
82
  add_action('admin_enqueue_scripts', array($this,'enqueue_scripts'));
83
  add_action('wp_enqueue_scripts', array($this,'enqueue_scripts'));
@@ -216,6 +218,16 @@ CREATE TABLE `{$this->ull_table}` (
216
  $this->logging($user->ID, 'login');
217
  }
218
 
 
 
 
 
 
 
 
 
 
 
219
  function wp_authenticate_log($user_login, $user_password) {
220
  if (empty($user_login))
221
  return;
@@ -857,7 +869,7 @@ if ($errors != 'invalid_username')
857
  if (!empty($status))
858
  $sql .= $wpdb->prepare(" AND `activity_status` = %s", $status);
859
  $sql .= " GROUP BY `user_id`, `user_login`, `activity_status`, `activity_errors`";
860
- $sql .= " ORDER BY `user_login`, `user_id`";
861
  $total = intval($wpdb->get_var("SELECT count(*) from ({$sql}) as log"));
862
 
863
  // Pagination
@@ -866,7 +878,7 @@ if ($errors != 'invalid_username')
866
  $page_links_text = $this->get_pagenation($total, self::LIST_PER_PAGE, $page, $start);
867
 
868
  // get login log summary
869
- $ull_summary = $wpdb->get_results($wpdb->prepare("{$sql} ORDER BY `count` DESC LIMIT %d,%d", $start, self::LIST_PER_PAGE));
870
 
871
  $row_num = 0;
872
  ?>
4
  Plugin URI: https://github.com/wokamoto/crazy-bone
5
  Description: Tracks user name, time of login, IP address and browser user agent.
6
  Author: wokamoto
7
+ Version: 0.5.2
8
  Author URI: http://dogmap.jp/
9
  Text Domain: user-login-log
10
  Domain Path: /languages/
78
  add_action('wp_login', array($this, 'user_login_log'), 10, 2);
79
  add_action('wp_authenticate', array($this, 'wp_authenticate_log'), 10, 2);
80
  add_action('login_form_logout', array($this, 'user_logout_log'));
81
+ add_action('auth_cookie_expired', array($this, 'cookie_expired_log'), 10, 2);
82
+ add_action('auth_cookie_bad_hash', array($this, 'cookie_bad_hash_log'), 10, 2);
83
 
84
  add_action('admin_enqueue_scripts', array($this,'enqueue_scripts'));
85
  add_action('wp_enqueue_scripts', array($this,'enqueue_scripts'));
218
  $this->logging($user->ID, 'login');
219
  }
220
 
221
+ public function cookie_expired_log($cookie_elements) {
222
+ $user = get_userdatabylogin($cookie_elements['username']);
223
+ $this->logging($user->ID, 'cookie_expired');
224
+ }
225
+
226
+ public function cookie_bad_hash_log($cookie_elements) {
227
+ $user = get_userdatabylogin($cookie_elements['username']);
228
+ $this->logging($user->ID, 'cookie_bad_hash');
229
+ }
230
+
231
  function wp_authenticate_log($user_login, $user_password) {
232
  if (empty($user_login))
233
  return;
869
  if (!empty($status))
870
  $sql .= $wpdb->prepare(" AND `activity_status` = %s", $status);
871
  $sql .= " GROUP BY `user_id`, `user_login`, `activity_status`, `activity_errors`";
872
+ $sql .= " ORDER BY `count` DESC, `user_login`, `user_id`";
873
  $total = intval($wpdb->get_var("SELECT count(*) from ({$sql}) as log"));
874
 
875
  // Pagination
878
  $page_links_text = $this->get_pagenation($total, self::LIST_PER_PAGE, $page, $start);
879
 
880
  // get login log summary
881
+ $ull_summary = $wpdb->get_results($wpdb->prepare("{$sql} LIMIT %d,%d", $start, self::LIST_PER_PAGE));
882
 
883
  $row_num = 0;
884
  ?>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wokamoto, megumithemes
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: log, login, users
5
  Requires at least: 3.5
6
- Tested up to: 3.6
7
- Stable tag: 0.5.1
8
 
9
  Tracks user name, time of login, IP address and browser user agent.
10
 
@@ -34,6 +34,9 @@ none
34
 
35
  == Changelog ==
36
 
 
 
 
37
  **0.5.1 - Sep. 9, 2013**
38
 
39
  Multisite support.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJCY7XB8F4&lc=JP&item_name=WordPress%20Plugins&item_number=wp%2dplugins&currency_code=JPY&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: log, login, users
5
  Requires at least: 3.5
6
+ Tested up to: 3.6.1
7
+ Stable tag: 0.5.2
8
 
9
  Tracks user name, time of login, IP address and browser user agent.
10
 
34
 
35
  == Changelog ==
36
 
37
+ **0.5.2 - Oct. 23, 2013**
38
+ action hook fix, sql syntax fix
39
+
40
  **0.5.1 - Sep. 9, 2013**
41
 
42
  Multisite support.