Zen Cart Logo
Forums / Addon Admin Tools / Changed Files

Changed Files

Views: 10,889

Results 1 to 20 of 39
5 Mar 2018, 4:17 PM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Changed Files

The Zen Cart changed files contribution lists all of the files in your installation in the (descending) order of change date. This can be useful in debugging or detecting malicious activity.

It's available in the download section here: https://www.zen-cart.com/downloads.php?do=file&id=2193

7 Mar 2018, 8:55 AM
#2
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
730
Plugin Contributions:
0

Re: Changed Files

Thanks for this module. Do I have to have any certain php settings enabled also with server? Running php 7 but I get a blank page so far, but I am fairly sure it is my new php setup.

7 Mar 2018, 10:26 AM
#3
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Changed Files

Did you check your debug files (logs folder)?

7 Mar 2018, 10:36 AM
#4
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
730
Plugin Contributions:
0

Re: Changed Files

Design75:

Did you check your debug files (logs folder)?

Thanks for your reply. Debug files have suddenly stopped, apart from Paypal and image handler. I will try and check the php.ini file and see what has been altered. I have had trouble with log files in general for a long time.

7 Mar 2018, 11:48 AM
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Changed Files

Please post the debug log when you get it.

7 Mar 2018, 6:45 PM
#6
lordzoabar avatar

lordzoabar

New Zenner

Join Date:
Nov 2017
Location:
Athens, Georgia, USA
Posts:
104
Plugin Contributions:
0

Re: Changed Files

Similar issue to HeathenMagic, except I've got it working fine on my PHP 7 test shop (ZC 1.5.5f), but it isn't working on my live site, (which is still ZC 1.5.5d and PHP 5.6). Same also with the debug files not populating for it.

From what I HAVE seen, it is both a beautiful and terrifying plugin. And I am almost afraid of what will come up when it does start working on our live shop... lol

7 Mar 2018, 9:07 PM
#7
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Changed Files

For the folks who are having trouble: please go to the Version link at the top right of your admin and look at what it says under the SPL heading.

This shows you what parts of the Standard PHP Library are available.
http://php.net/manual/en/book.spl.php

If you don't have RecursiveDirectoryIterator and/or RecursiveIteratorIterator, this mod will not work for you.

8 Mar 2018, 1:56 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: Changed Files

swguy:

For the folks who are having trouble: please go to the Version link at the top right of your admin and look at what it says under the SPL heading.

This shows you what parts of the Standard PHP Library are available.
http://php.net/manual/en/book.spl.php

If you don't have RecursiveDirectoryIterator and/or RecursiveIteratorIterator, this mod will not work for you.
The PHP documentation for that library (http://php.net/manual/en/spl.installation.php) indicates that, as of PHP 5.3.0, the extension cannot be disabled and is always available.

8 Mar 2018, 7:52 PM
#9
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Changed Files

I'm guessing it's something weird like safe mode making those extensions unavailable. Something unusual in the configuration.

8 Mar 2018, 8:41 PM
#10
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Changed Files

Hmm... I see a possible problem. At the end of the file admin/changed_files.php there's a blank line after the PHP close ?>
Please remove the blank line. (The close isn't required either.)

11 Mar 2018, 7:53 PM
#11
lordzoabar avatar

lordzoabar

New Zenner

Join Date:
Nov 2017
Location:
Athens, Georgia, USA
Posts:
104
Plugin Contributions:
0

Re: Changed Files

swguy:

Hmm... I see a possible problem. At the end of the file admin/changed_files.php there's a blank line after the PHP close ?>
Please remove the blank line. (The close isn't required either.)

Did as stated, no change. It still loads in as just a blank white page. That said, there are a LOT of plugins that we have on our site, and I'm still working through the list and adding to the test site, so there *MIGHT *be a mod incompatibility(?) Since this doesn't modify any core files, I wouldn't think so... It still isn't being registered in the debug logs, so I have no idea.

11 Mar 2018, 8:27 PM
#12
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Changed Files

Lordzoabar:

Did as stated, no change. It still loads in as just a blank white page. That said, there are a LOT of plugins that we have on our site, and I'm still working through the list and adding to the test site, so there *MIGHT *be a mod incompatibility(?) Since this doesn't modify any core files, I wouldn't think so... It still isn't being registered in the debug logs, so I have no idea.

If you do not get any debug-logs in Zen Cart, are you able/allowed to view your apache or php logs? Or else maybe you can ask your host to give you those files.

12 Mar 2018, 8:51 PM
#13
lordzoabar avatar

lordzoabar

New Zenner

Join Date:
Nov 2017
Location:
Athens, Georgia, USA
Posts:
104
Plugin Contributions:
0

Re: Changed Files

Design75:

If you do not get any debug-logs in Zen Cart, are you able/allowed to view your apache or php logs? Or else maybe you can ask your host to give you those files.

I do get debug-logs generally, it just isn't registering anything as being wrong with this module. I've gone and had the log file open in FTP on one monitor, while refreshing the Changed Files reports page, and had nothing register. (I've made edits to a few PHP files to force a known error to occur, and it catches that fine.) So again it could just be like HeathenMagic, and just be weird PHP.ini settings. shrugs

27 Mar 2018, 2:19 PM
#15
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Changed Files

So far I like this simple plugin.
I made some minor changes to admin/changed_files.php:

  • to the code to make the output more readable, the out put is shown in a table.
  • removed the include of the language file, as that is already done by Zen Cart
<?php
require('includes/application_top.php');
$start_dir = DIR_FS_CATALOG; 
$it = new RecursiveDirectoryIterator($start_dir);
$files = array(); 
foreach(new RecursiveIteratorIterator($it) as $file)
{
    if (!is_dir($file)) { 
        $files[] = array('name' => $file, 
                         'mtime' => filemtime($file)); 
    }
}
usort($files, "file_cmp");
?>
<!doctype html>
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta charset="<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" href="includes/stylesheet.css">
<link rel="stylesheet" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<link rel="stylesheet" href="includes/admin_access.css" />
<script src="includes/menu.js"></script>
<script src="includes/general.js"></script>
<script>
  function init()
  {
    cssjsmenu('navbar');
    if (document.getElementById)
    {
      var kill = document.getElementById('hoverJS');
      kill.disabled = true;
    }
  }
</script>
</head>
<body onload="init()">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->


<!-- body //-->
<div class="container">
  <h1><?php echo HEADING_TITLE ?></h1>
  <table class="table">
<?php 
foreach ($files as $file) {
   $name = str_replace(DIR_FS_CATALOG, "", $file['name']); 
   echo '<tr>';
   echo '<td>'.$name . '</td><td>' . date('Y-m-d H:i:s', $file['mtime']) . "</td>";
   echo '</tr>';
}
?>
</table>
</div>
<!-- body_eof //-->


<div class="bottom">
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</div>
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
<?php
function file_cmp($a, $b) {
   if ($a['mtime'] == $b['mtime'])
      return 0;
   if ($a['mtime'] < $b['mtime'])
      return 1;
   return -1;
}

It would be nice to be able to exclude some directories, like editors, or bmz_cache

27 Mar 2018, 3:06 PM
#16
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Changed Files

Thanks for posting this modification and suggestions.

14 Apr 2018, 8:37 PM
#17
gerrim avatar

gerrim

New Zenner

Join Date:
Jul 2013
Location:
Brisbane, Australia
Posts:
39
Plugin Contributions:
0

Re: Changed Files

Hi swguy. This plugin worked a treat! Thanks for your efforts.

I successfully loaded your original version (incl Post #10 edit). When I incorporated Design75's suggested modification (post #15), I received an error "Content Encoding Error. The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression..." Design75's point re the table format is also valid for me, but - with my programming skills not up to the task - I'll look at manipulating your output data in, say Excel, to split each path into its constituent directories/filename to allow sorting.

My system: Website in development so on WAMP+SSL; ZC1.5.5e + a swag of plugins; Template: Responsive Sheffield Blue 2.0 + recommended code changes from that thread e.g. for compatibility with ZC1.5.5.

Thanks again.

22 Apr 2018, 7:25 PM
#18
movieman61049 avatar

movieman61049

New Zenner

Join Date:
Jan 2014
Location:
Lindenwood, Illinois
Posts:
7
Plugin Contributions:
0

Re: Changed Files

The suggested updated by Design75 does not close properly. I tried it and also got the same error. Restoring th the original it work perfectly.

22 Apr 2018, 8:44 PM
#19
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Re: Changed Files

What do you mean by not closing properly? The only thing I changed is the layout, so I do not see how that affect any encoding problems.

movieman61049:

The suggested updated by Design75 does not close properly. I tried it and also got the same error. Restoring th the original it work perfectly.

25 Apr 2018, 2:25 PM
#20
tamya avatar

tamya

Zen Follower

Join Date:
Feb 2007
Posts:
336
Plugin Contributions:
0

Re: Changed Files

Design75:

It would be nice to be able to exclude some directories, like editors, or bmz_cache

The plugin works as expected on Zen Cart v1.5.4, I think this feature will make the plugin more valuable