Forums / All Other Contributions/Addons / Admin Activity Report [support thread]

Admin Activity Report [support thread]

Locked

Views: 5,992

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
6 Jun 2008, 8:14 PM
#1
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Admin Activity Report [support thread]

This is the support thread for the Admin Activity Report contribution.

Whenever you visit a page in admin, an activity is logged in a database table.

Such data can prove useful when trying to determine who has been altering what, as well as making sure that your admin area hasn't been compromised.

Until now, any lookup had to be done directly from the database using a utility like phpMyAdmin. With this contribution, you can quickly and easily view this data within your admin area, in a nicely presented format.

Features include:

  1. Ability to empty the database table's data
  2. Highlights any visits to the login page from an unknown IP address.

Installation is simple with only 8 new files. No database modification.
No overwriting or overriding of files.

This mod can be found in the Downloads section:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=1030

26 Jun 2008, 7:29 AM
#2
ccembd avatar

ccembd

New Zenner

Join Date:
Apr 2008
Location:
Calif
Posts:
86
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

Thank you so much for this. All works except the reset function. But it is still very useful to see what who is doing what and where.

Thanks again for this useful contribution.

28 Jun 2008, 4:33 PM
#4
ccembd avatar

ccembd

New Zenner

Join Date:
Apr 2008
Location:
Calif
Posts:
86
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

When I used the reset button actually nothing happened. It didn't reset. It successfully reset when I used the reset button in Tools: Store Manager. I verfied this by going back and opening the Admin Activity Log which I now have thanks to you. :smile:

Hope this helps,
Cat

28 Jun 2008, 5:50 PM
#5
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Admin Activity Report [support thread]

Yep it does help :smile: It's an interesting issue because the reset function has worked for others. I'm wondering whether it could be a database prefix problem. Anyway I'll have a proper look and see if I can figure out what might be wrong.

28 Jun 2008, 7:09 PM
#6
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Admin Activity Report [support thread]

Okay I think this might work.

In the following file:
admin/stats_admin_activity.php

Find:

$db->Execute("delete from " . TABLE_ADMIN_ACTIVITY_LOG);
$db->Execute("optimize table " . TABLE_ADMIN_ACTIVITY_LOG);

Change to:

$db->Execute("delete from " . TABLE_ADMIN_ACTIVITY);
$db->Execute("optimize table " . TABLE_ADMIN_ACTIVITY);

If it does work, you'll need to make the same change to:
admin/stats_admin_activity_all.php

Either way, let me know.

12 Jul 2008, 10:26 AM
#7
jinson avatar

jinson

New Zenner

Join Date:
Feb 2008
Posts:
4
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

I also had problems getting reset to work, here's how i fixed mine ->

-- Files --
admin/stats_admin_activity.php
admin/stats_admin_activity_all.php

Replaced the top part just after the include of application_top.php

// added by Jinson on 12th July 2008. Because this script was
// originally written expecting register globals to be on
$action = $_GET['action'];

switch($action) {

// clean out the admin_activity_log
    case 'clean_admin_activity_log':
      $db->Execute("delete from " . TABLE_ADMIN_ACTIVITY);
      $db->Execute("optimize table " . TABLE_ADMIN_ACTIVITY);
      $messageStack->add_session(SUCCESS_CLEAN_ADMIN_ACTIVITY_LOG, 'success');
      unset($_SESSION['reset_admin_activity_log']);
      zen_redirect(zen_href_link(stats_admin_activity));
    break;
    } // eof: action
unset($action);
14 Jul 2008, 9:18 AM
#10
ccembd avatar

ccembd

New Zenner

Join Date:
Apr 2008
Location:
Calif
Posts:
86
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

Thanks you to the both of you. I am sorry I have not gotten to this yet, I have been overwhelmed with other changes needing to be done to my site and did a bit of damage in the process. I figured I had till the next reset time to do these changes.

Thanks again for all your help, I will go make the changes now. Cat

2 Aug 2008, 3:49 PM
#11
nguyenkhv avatar

nguyenkhv

New Zenner

Join Date:
Feb 2008
Posts:
35
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

Hi Steven,
I have questions on the activity report.

1 Why some recrods are hihg lighted RED?
2. sometimes, the Admin ID is 0?
Thanks,

3 Aug 2008, 10:29 PM
#12
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Admin Activity Report [support thread]

nguyenkhv:

Hi Steven,
I have questions on the activity report.

1 Why some recrods are hihg lighted RED?
2. sometimes, the Admin ID is 0?
Thanks,

Hi. I think I'll start by answering your second question first.

If a record has an admin ID of 0, it basically means Zen Cart isn't sure who you are. This will happen on the login page for example. Once logged in and Zen Cart knows who you are, the appropriate ID (usually 1) will be assigned. So.. it's very normal that some records will be 0.

Some of the records may have a red background. This is a feature I built in which highlights visits to the login page from an unknown. This can be useful for detecting any hack attempts. I'll explain how this works. The IP address of the very most recent admin activity record (which will always be the activity of you just clicking the Admin Activity Report link) is temporarily stored. This IP address is then compared with the IP addresses of all the other records. If any of these other IP addresses don't match and their admin ID is 0 (login page), then they will be highlighted red. Admittedly it's not a perfect method for several reasons:

  • Your own IP address may change now and again meaning your own records will be highlighted. In which case, just clear the log.
  • If multiple users have been granted access to the admin side of your site, these legitimate users will be highlighted.

.. but I thought some may find it useful; I certainly do. If you would rather not have this feature, let me know and I'll tell you how to remove it.

If there's demand, I may add things such as this as optional settings in a future version.

8 Jan 2009, 10:24 PM
#13
kissedbypix avatar

kissedbypix

New Zenner

Join Date:
Jan 2009
Posts:
9
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

1.3.8 new version not upgrade.

I am completely new to the admin side of zen and would like to install this mod myself. (everything else was done for me)

If someone can walk me through installing this mod I would be forever grateful. :hug:

Steven, you could make a mint writing a zen for dummies book...lol
thank you for being completely ZENned

8 Jan 2009, 10:51 PM
#14
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Re: Admin Activity Report [support thread]

KissedbyPix:

Steven, you could make a mint writing a zen for dummies book...lol

Well it's a nice idea but I don't think I could handle the number of refunds :smile:

Okay first thing to do is to make sure you have a good ftp program such as FileZilla to upload the mod's files.

Next you will want to make a backup of your site. This is always good practice to do before installing any mod. Backup all of your site's files, and your database as well.

You should have at some point changed your site's admin folder to something different for security purposes. If not, then you don't need to follow this next step. In the mod's files, change the name of the admin folder to match the name of the admin folder on your site.

Now you can upload all the mod's files. With FileZilla you can do this all in one go, as opposed to one file at a time. In the ftp program, connect to your site and navigate to the site's root directory where you should see your admin folder. Then in your ftp program, navigate to and upload the admin folder from the mod to your site's root directory. All the files should transfer across in their correct places.

Finally in your actual admin panel, go to Reports->Admin Activity and the admin activity report should be displayed. You might need to hit the refresh button before the new menu option shows up.

Sorry if some of my instructions are too simple, but I don't know what level you are at.

12 Jan 2009, 10:27 AM
#15
kissedbypix avatar

kissedbypix

New Zenner

Join Date:
Jan 2009
Posts:
9
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

Got it! :clap: thank you so much!

:cool:

31 Jul 2009, 7:52 PM
#16
shartlesville avatar

shartlesville

New Zenner

Join Date:
Jul 2009
Location:
Roswell, NM, USA
Posts:
103
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

Is there any way to not have it record "my" activity?

I don't need to know what I'm doing, I just want to know if anyone else is messing around in there. It slows the admin side way down after a day or two if I am running the enhanced who's online because it auto refreshes and counts each refresh as 'activity'.

Thank you for any help you can provide with this. :smile:

Blessings,
Krisann

I donate to the Zen Team do you?
My current project: BestSewingDeals.com;

31 Jul 2009, 8:16 PM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Admin Activity Report [support thread]

The log records everyone's activity because if someone guessed your password they could still go in and do stuff ... and ... then the logs would reveal what was done, and when, and from what IP address, etc. It's for your own protection. If you don't have any other admin users defined, then there's nobody else's activity to track, so limiting it just to "you" defeats the whole purpose.

I don't think I'll ever understand why people sit and constantly watch whos-online page refreshes hoping someone will put something in their cart. If you did that in a retail store your customers would be creeped out and leave!

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

31 Jul 2009, 8:32 PM
#18
shartlesville avatar

shartlesville

New Zenner

Join Date:
Jul 2009
Location:
Roswell, NM, USA
Posts:
103
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

Lol, I think you misunderstand.

I do not want to track "my" IP address only anyone elses. Why bother tracking 'my' activity, if it is my IP it is me (and if it wasn't actually me, I would probably assume it was and ignore it anyway).

The reason I am "watching the who's online" is because I just launched it live a few days ago. Several people have been having issues with PayPal and gift certificates so I am looking for patterns. :smile: In the meantime the db is filling up rather quickly with 'activity' and the admin noticeably slows down after a day or two if I don't reset it.

Thank you!

Blessings,
Krisann

I donate to the Zen Team do you?
My current project: BestSewingDeals.com;

31 Jul 2009, 9:11 PM
#20
shartlesville avatar

shartlesville

New Zenner

Join Date:
Jul 2009
Location:
Roswell, NM, USA
Posts:
103
Plugin Contributions:
0

Re: Admin Activity Report [support thread]

Ahh, ok, so there wouldn't be a way to block out just one IP address.

Thank you! I'll just reset it each night until I am satisfied with the checkout problems being resolved and no longer need to keep an eye on the WO. :smile:

Blessings,
Krisann

I donate to the Zen Team do you?
My current project: BestSewingDeals.com;