Crazy Bone - Version 0.4.2

Version Description

Download this release

Release Info

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

Code changes from version 0.4.1 to 0.4.2

Files changed (2) hide show
  1. plugin.php +21 -6
  2. readme.txt +1 -1
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.4.1
8
  Author URI: http://dogmap.jp/
9
  Text Domain: user-login-log
10
  Domain Path: /languages/
@@ -195,17 +195,16 @@ CREATE TABLE `{$this->ull_table}` (
195
  if (!is_wp_error($user))
196
  return;
197
  $errors = $user->errors;
 
198
  if (array_key_exists('invalid_username', $errors)) {
199
  $user_id = 0;
 
 
200
  } else {
201
  $user = get_user_by('login', $user_login);
202
  $user_id = isset($user->ID) ? $user->ID : 0;
203
  }
204
- $this->logging($user_id, 'login_error', array(
205
- 'errors' => $errors,
206
- 'user_login' => $user_login,
207
- 'user_password' => $user_password,
208
- ));
209
  }
210
 
211
  public function user_logout_log() {
@@ -737,7 +736,9 @@ jQuery(function(){setTimeout('get_ull_info()', 10000);});
737
  <th scope="col" class="manage-column column-ip"><?php _e('IP', self::TEXT_DOMAIN); ?></th>
738
  <th scope="col" class="manage-column column-agent"><?php _e('User Agent', self::TEXT_DOMAIN); ?></th>
739
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
 
740
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
 
741
  </tr>
742
  </thead>
743
  <tfoot>
@@ -750,7 +751,9 @@ jQuery(function(){setTimeout('get_ull_info()', 10000);});
750
  <th scope="col" class="manage-column column-ip"><?php _e('IP', self::TEXT_DOMAIN); ?></th>
751
  <th scope="col" class="manage-column column-agent"><?php _e('User Agent', self::TEXT_DOMAIN); ?></th>
752
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
 
753
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
 
754
  </tr>
755
  </tfoot>
756
 
@@ -775,6 +778,8 @@ $errors =
775
  (is_array($errors) && isset($errors['errors']))
776
  ? implode(', ', array_keys($errors['errors']))
777
  : '';
 
 
778
  ?>
779
  <tr id="log-<?php echo $row_num ?>">
780
  <?php if ($user_id <= 0) { ?>
@@ -785,7 +790,9 @@ $errors =
785
  <td class="ip column-ip"><?php echo trim(self::get_country_flag($row->activity_IP, '', true) . '<br>' . $row->activity_IP); ?></td>
786
  <td class="agent column-agent"><?php echo trim(self::get_browser_icon($row->activity_agent) . '<br>' . $ua); ?></td>
787
  <td class="errors column-errors"><?php echo $errors; ?></td>
 
788
  <td class="password column-errors"><?php echo $password; ?></td>
 
789
  </tr>
790
  <?php $row_num++; }?>
791
  </tbody>
@@ -875,7 +882,9 @@ $errors =
875
  <th scope="col" class="manage-column column-username"><?php _e('User Name', self::TEXT_DOMAIN); ?></th>
876
  <th scope="col" class="manage-column column-status"><?php _e('Status', self::TEXT_DOMAIN); ?></th>
877
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
 
878
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
 
879
  <th scope="col" class="manage-column column-errors" style="text-align:right;"><?php _e('Count', self::TEXT_DOMAIN); ?></th>
880
  </tr>
881
  </thead>
@@ -884,7 +893,9 @@ $errors =
884
  <th scope="col" class="manage-column column-username"><?php _e('User Name', self::TEXT_DOMAIN); ?></th>
885
  <th scope="col" class="manage-column column-status"><?php _e('Status', self::TEXT_DOMAIN); ?></th>
886
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
 
887
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
 
888
  <th scope="col" class="manage-column column-errors" style="text-align:right;"><?php _e('Count', self::TEXT_DOMAIN); ?></th>
889
  </tr>
890
  </tfoot>
@@ -905,12 +916,16 @@ $errors =
905
  (is_array($errors) && isset($errors['errors']))
906
  ? implode(', ', array_keys($errors['errors']))
907
  : '';
 
 
908
  ?>
909
  <tr id="log-<?php echo $row_num ?>">
910
  <td class="username column-username"><?php echo $user_login; ?></td>
911
  <td class="status column-status"><?php echo $row->activity_status; ?></td>
912
  <td class="errors column-errors"><?php echo $errors; ?></td>
 
913
  <td class="password column-errors"><?php echo $password; ?></td>
 
914
  <td class="count column-errors" style="text-align:right;"><?php echo $row->count; ?></td>
915
  </tr>
916
  <?php $row_num++; }?>
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.4.2
8
  Author URI: http://dogmap.jp/
9
  Text Domain: user-login-log
10
  Domain Path: /languages/
195
  if (!is_wp_error($user))
196
  return;
197
  $errors = $user->errors;
198
+ $args = array('errors' => $errors);
199
  if (array_key_exists('invalid_username', $errors)) {
200
  $user_id = 0;
201
+ $args['user_login'] = $user_login;
202
+ $args['user_password'] = $user_password;
203
  } else {
204
  $user = get_user_by('login', $user_login);
205
  $user_id = isset($user->ID) ? $user->ID : 0;
206
  }
207
+ $this->logging($user_id, 'login_error', $args);
 
 
 
 
208
  }
209
 
210
  public function user_logout_log() {
736
  <th scope="col" class="manage-column column-ip"><?php _e('IP', self::TEXT_DOMAIN); ?></th>
737
  <th scope="col" class="manage-column column-agent"><?php _e('User Agent', self::TEXT_DOMAIN); ?></th>
738
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
739
+ <?php if ($user_id == 0) { ?>
740
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
741
+ <?php } ?>
742
  </tr>
743
  </thead>
744
  <tfoot>
751
  <th scope="col" class="manage-column column-ip"><?php _e('IP', self::TEXT_DOMAIN); ?></th>
752
  <th scope="col" class="manage-column column-agent"><?php _e('User Agent', self::TEXT_DOMAIN); ?></th>
753
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
754
+ <?php if ($user_id == 0) { ?>
755
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
756
+ <?php } ?>
757
  </tr>
758
  </tfoot>
759
 
778
  (is_array($errors) && isset($errors['errors']))
779
  ? implode(', ', array_keys($errors['errors']))
780
  : '';
781
+ if ($errors != 'invalid_username')
782
+ $password = '';
783
  ?>
784
  <tr id="log-<?php echo $row_num ?>">
785
  <?php if ($user_id <= 0) { ?>
790
  <td class="ip column-ip"><?php echo trim(self::get_country_flag($row->activity_IP, '', true) . '<br>' . $row->activity_IP); ?></td>
791
  <td class="agent column-agent"><?php echo trim(self::get_browser_icon($row->activity_agent) . '<br>' . $ua); ?></td>
792
  <td class="errors column-errors"><?php echo $errors; ?></td>
793
+ <?php if ($user_id == 0) { ?>
794
  <td class="password column-errors"><?php echo $password; ?></td>
795
+ <?php } ?>
796
  </tr>
797
  <?php $row_num++; }?>
798
  </tbody>
882
  <th scope="col" class="manage-column column-username"><?php _e('User Name', self::TEXT_DOMAIN); ?></th>
883
  <th scope="col" class="manage-column column-status"><?php _e('Status', self::TEXT_DOMAIN); ?></th>
884
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
885
+ <?php if ($user_id == 0) { ?>
886
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
887
+ <?php } ?>
888
  <th scope="col" class="manage-column column-errors" style="text-align:right;"><?php _e('Count', self::TEXT_DOMAIN); ?></th>
889
  </tr>
890
  </thead>
893
  <th scope="col" class="manage-column column-username"><?php _e('User Name', self::TEXT_DOMAIN); ?></th>
894
  <th scope="col" class="manage-column column-status"><?php _e('Status', self::TEXT_DOMAIN); ?></th>
895
  <th scope="col" class="manage-column column-errors"><?php _e('Errors', self::TEXT_DOMAIN); ?></th>
896
+ <?php if ($user_id == 0) { ?>
897
  <th scope="col" class="manage-column column-errors"><?php _e('Invalid User Name / Password', self::TEXT_DOMAIN); ?></th>
898
+ <?php } ?>
899
  <th scope="col" class="manage-column column-errors" style="text-align:right;"><?php _e('Count', self::TEXT_DOMAIN); ?></th>
900
  </tr>
901
  </tfoot>
916
  (is_array($errors) && isset($errors['errors']))
917
  ? implode(', ', array_keys($errors['errors']))
918
  : '';
919
+ if ($errors != 'invalid_username')
920
+ $password = '';
921
  ?>
922
  <tr id="log-<?php echo $row_num ?>">
923
  <td class="username column-username"><?php echo $user_login; ?></td>
924
  <td class="status column-status"><?php echo $row->activity_status; ?></td>
925
  <td class="errors column-errors"><?php echo $errors; ?></td>
926
+ <?php if ($user_id == 0) { ?>
927
  <td class="password column-errors"><?php echo $password; ?></td>
928
+ <?php } ?>
929
  <td class="count column-errors" style="text-align:right;"><?php echo $row->count; ?></td>
930
  </tr>
931
  <?php $row_num++; }?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=9S8AJ
4
  Tags: log, login, users
5
  Requires at least: 3.5
6
  Tested up to: 3.5.1
7
- Stable tag: 0.4.1
8
 
9
  Tracks user name, time of login, IP address and browser user agent.
10
 
4
  Tags: log, login, users
5
  Requires at least: 3.5
6
  Tested up to: 3.5.1
7
+ Stable tag: 0.4.2
8
 
9
  Tracks user name, time of login, IP address and browser user agent.
10