Zen Cart Logo
Forums / All Other Contributions/Addons / User tracking mod

User tracking mod

Views: 183,767

Results 721 to 740 of 861
24 Mar 2017, 9:15 AM
#721
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

User tracking mod

Yeah, realized after posting that suggestion that the line requested to be changed actually is there because of previous installs may not have put the configuration options under the configuration menu dropdown and instead are reflected in the older tools->User Tracking config area.

So, it more seems like it needs to be identified if the installer file(s) are even getting accessed.

What if any error logs are being generated?

Again, in the includes/init_includes/init_user_tracking.php file, please add the following somewhere after the opening <?php and not within a commented out portion of text, try entering:

trigger_error('in this file', E_USER_WARNING);

Access one admin related page, then remove that line of code from the file. Check your logs directory to see if the file is loading. If it is, then in a way, want to place that line of code in different locations of the file (could do so all at once), and again access the admin by one page change, review the logs to see where in the code processing "stopped".

24 Mar 2017, 10:45 AM
#722
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

Another question: what files do you have in admin/includes/auto_loaders and when looking in each of those, what is the number within each of the square parentheses? It may be that the one for the user_tracking_install file needs to be a smaller number suggested to be no less that 180. (instead of 999)

24 Mar 2017, 3:39 PM
#723
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: User tracking mod

Thanks for your help, none of your solutions worked, what I did it since i was coming from a really old version I downloaded one version in between then upgraded to that one and then to the latest, it seems like it worked but here:
Attachment 17000
Am i supposed to see the cart data?

Also i still get this message:
Attachment 17001

24 Mar 2017, 3:47 PM
#724
shopville avatar

shopville

Zen Follower

Join Date:
Aug 2012
Posts:
331
Plugin Contributions:
0

Re: User tracking mod

ShopVille:

Thanks for your help, none of your solutions worked, what I did it since i was coming from a really old version I downloaded one version in between then upgraded to that one and then to the latest, it seems like it worked but here:
Attachment 17000
Am i supposed to see the cart data?

Also i still get this message:
Attachment 17001

Also, when clicking [view session] it shows a grey bar and does not expand the session

24 Mar 2017, 4:06 PM
#725
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

ShopVille:

Thanks for your help, none of your solutions worked, what I did it since i was coming from a really old version I downloaded one version in between then upgraded to that one and then to the latest, it seems like it worked but here:
Attachment 17000
Am i supposed to see the cart data?

Also i still get this message:
Attachment 17001

For some reason the second attachment doesn't appear to be "visible" for viewing, but is included in the above quoted text. I'm hoping that it will appear in this response. So until that is made clear, I can't respond.

In relation to the first image about the "shopping cart", what you are seeing is that when tracking admin action using User Tracking, there is no cart really associated, but there is still at least some level of information about the individual. In this case, instead of leaving the field blank, the concept considered was to identify what "authority" the individual being tracked while logged into the admin panel had. That is the information that you are seeing/describe.

24 Mar 2017, 4:09 PM
#726
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

ShopVille:

Also, when clicking [view session] it shows a grey bar and does not expand the session

What version of ZC is being used, how many "visits" we're reported for that user, and what type of user was being clicked on to view session data (store or admin)?

8 Jun 2017, 3:44 AM
#727
jaydamuss avatar

jaydamuss

New Zenner

Join Date:
Mar 2011
Posts:
11
Plugin Contributions:
0

Re: User tracking mod

hi there, i have been using plugin and works perfect but i cant get rid of the information from the install at the top of admin screen, its been there for weeks, im using zen cart 1.5.5.e cheers
Attachment 17083

8 Jun 2017, 5:44 AM
#728
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

jaydamuss:

hi there, i have been using plugin and works perfect but i cant get rid of the information from the install at the top of admin screen, its been there for weeks, im using zen cart 1.5.5.e cheers
Attachment 17083
Pretty obvious that something about the installer needs to be modified. Could you identify your (recent) history of use of User Tracking? Ie. Is this the first time it has ever been installed or could you identify from what version it was updated?

Where I have more recently used that installer "method" I've added in a little more direct control of the sequence of files rather than expecting them to have already been sorted in one way or another.

8 Jun 2017, 6:31 AM
#729
jaydamuss avatar

jaydamuss

New Zenner

Join Date:
Mar 2011
Posts:
11
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

Pretty obvious that something about the installer needs to be modified. Could you identify your (recent) history of use of User Tracking? Ie. Is this the first time it has ever been installed or could you identify from what version it was updated?

Where I have more recently used that installer "method" I've added in a little more direct control of the sequence of files rather than expecting them to have already been sorted in one way or another.

thanks for your reply, this is a new install not updated on the new site, it happend the first time i installed it but i have left it for a couple of weeks as everything seems to be woring fine, hope this helps

8 Jun 2017, 10:20 AM
#730
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

jaydamuss:

thanks for your reply, this is a new install not updated on the new site, it happend the first time i installed it but i have left it for a couple of weeks as everything seems to be woring fine, hope this helps
And to be sure about the "new install" part, the database contents are brand spanking new, not copied over, imported or otherwise left over from any previous ZC install nor has ever been exposed to the User Tracking plugin? (While I still believe the issue is at least in part related to the file sequence, I can't yet rule out that there might be something missed in the logic of handling the database in an upgrade condition from some "ancient" version that doesn't fit into the mold I believe should work.) I'll try to prep a little code change for the admin/includes/init_includes file and would appreciate if the change could be incorporated and validated to prevent the continuous notification that it has been installed. And if that works maybe I should submit an update to the installer from which that is based or at least talk with the author.

8 Jun 2017, 2:59 PM
#731
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

Here is my proposal for the issue described, though I haven't been able to reproduce the issue on a clean nor upgraded site. Would appreciate feedback.

in admin/includes/init_includes/init_user_tracking.php

Locate this portion of the code:

$installers = scandir($module_installer_directory, 1);

$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));

while (substr($installers[0], strrpos($installers[0], '.')) != $file_extension || preg_match('~^[^\._].*\.php$~i', $installers[0]) <= 0 || $installers[0] == 'empty.txt') {
  unset($installers[0]);
  if (sizeof($installers) == 0) {
    break;
  }
  $installers = array_values($installers);
}


if (sizeof($installers) > 0) {
    $newest_version = $installers[0];
    $newest_version = substr($newest_version, 0, -4);

    sort($installers);
    if (version_compare($newest_version, $current_version) > 0) {
        foreach ($installers as $installer) {
            if (substr($installer, strrpos($installer, '.')) == $file_extension && (preg_match('~^[^\._].*\.php$~i', $installer) > 0 || $installer != 'empty.txt')) {
                if (version_compare($newest_version, substr($installer, 0, -4)) >= 0 && version_compare($current_version, substr($installer, 0, -4)) < 0) {
                    include($module_installer_directory . '/' . $installer);
                    $current_version = str_replace("_", ".", substr($installer, 0, -4));
                    $db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '" . $current_version . "', set_function = 'zen_cfg_select_option(array(\'" . $current_version . "\'),' WHERE configuration_key = 'CONFIG_" . $module_constant . "_VERSION' LIMIT 1;");
                    $messageStack->add("Installed " . $module_name . " v" . $current_version, 'success');
                }
            }
        }
    }
}

And modify/replace to like the below (with code that causes a difference highlighted in red):

// Obtain a list of files in the installer directory.
if (is_dir($module_installer_directory)) {
  $installers = scandir($module_installer_directory, 1);
  // Determine the extension of this file to be used for comparison on the others.
  $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
  $file_extension_len = strlen($file_extension);
  // sequence the installer files to support stepping through them.
  if (sizeof($installers) > 0) {
    sort($installers);
  }
  // Step through each installer file to establish the first file that matches the search criteria.
  $newest_version = $installers[0];
  $newest_version = substr($newest_version, 0, -1 * $file_extension_len);
  while (substr($installers[0], strrpos($installers[0], '.')) != $file_extension || preg_match('~^[^\._].*\.php$~i', $installers[0]) <= 0 || $installers[0] == 'empty.txt' || version_compare($newest_version, $current_version) <= 0) {
    unset($installers[0]);
    if (sizeof($installers) == 0) {
      break;
    }
    $installers = array_values($installers);
    $newest_version = $installers[0];
    $newest_version = substr($newest_version, 0, -1 * $file_extension_len);
  }
  // If there are still installer files to process, then do so.
  if (sizeof($installers) > 0) {
      $newest_version = $installers[0];
      $newest_version = substr($newest_version, 0, -1 * $file_extension_len);
      if (version_compare($newest_version, $current_version) > 0) {
          foreach ($installers as $installer) {
              if (substr($installer, strrpos($installer, '.')) == $file_extension && (preg_match('~^[^\._].*\.php$~i', $installer) > 0 || $installer != 'empty.txt')) {
                  if (version_compare($newest_version, substr($installer, 0, -1 * $file_extension_len)) >= 0 && version_compare($current_version, substr($installer, 0, -1 * $file_extension_len)) < 0) {
                      include($module_installer_directory . '/' . $installer);
                      $current_version = str_replace("_", ".", substr($installer, 0, -1 * $file_extension_len));
                      $db->Execute("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value = '" . $current_version . "', set_function = 'zen_cfg_select_option(array(\'" . $current_version . "\'),' WHERE configuration_key = '" . $module_constant . "_VERSION' LIMIT 1;");
                      $messageStack->add("Installed " . $module_name . " v" . $current_version, 'success');
                  }
              }
          }
      }
  }
}
8 Jun 2017, 9:52 PM
#732
jaydamuss avatar

jaydamuss

New Zenner

Join Date:
Mar 2011
Posts:
11
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

And to be sure about the "new install" part, the database contents are brand spanking new, not copied over, imported or otherwise left over from any previous ZC install nor has ever been exposed to the User Tracking plugin? (While I still believe the issue is at least in part related to the file sequence, I can't yet rule out that there might be something missed in the logic of handling the database in an upgrade condition from some "ancient" version that doesn't fit into the mold I believe should work.) I'll try to prep a little code change for the admin/includes/init_includes file and would appreciate if the change could be incorporated and validated to prevent the continuous notification that it has been installed. And if that works maybe I should submit an update to the installer from which that is based or at least talk with the author.

yes the database and site was new a couple months ago and not transfered cheers

8 Jun 2017, 10:00 PM
#733
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

jaydamuss:

yes the database and site was new a couple months ago and not transfered cheers

Thanks for the clarification. Able to test the above code modification and post result?

8 Jun 2017, 10:03 PM
#734
jaydamuss avatar

jaydamuss

New Zenner

Join Date:
Mar 2011
Posts:
11
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

Thanks for the clarification. Able to test the above code modification and post result?

yes i just copied your second code between lines 49-79 and the info is still there cheers

8 Jun 2017, 10:27 PM
#735
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

jaydamuss:

yes i just copied your second code between lines 49-79 and the info is still there cheers

I didn't catch the line numbers on my side, to be able to confirm those are the correct lines, but I suspect that they are. To also further confirm have you since tried to log out and back in to see if the message goes away.

If you are also willing I'd like to insert some testing code to see what is going on with this and why/how the install is basically repetitively occurring (somewhat of and how). Are there any log errors generated in the logs directory? (if posting 2 things, 1) obscure your admin folder name, 2) please press the # button in the message box toolbar before pasting the code from the mydebug log(s)).

This is the second reported occurrence of this issue and I have even installed it on at least three different vanilla installs as well as systems that had previous versions, uninstalled installed fresh again and even installed an older version and then this one... So anything that can help identify why this is occurring would be welcome.

8 Jun 2017, 10:35 PM
#736
jaydamuss avatar

jaydamuss

New Zenner

Join Date:
Mar 2011
Posts:
11
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

I didn't catch the line numbers on my side, to be able to confirm those are the correct lines, but I suspect that they are. To also further confirm have you since tried to log out and back in to see if the message goes away.

If you are also willing I'd like to insert some testing code to see what is going on with this and why/how the install is basically repetitively occurring (somewhat of and how). Are there any log errors generated in the logs directory? (if posting 2 things, 1) obscure your admin folder name, 2) please press the # button in the message box toolbar before pasting the code from the mydebug log(s)).

This is the second reported occurrence of this issue and I have even installed it on at least three different vanilla installs as well as systems that had previous versions, uninstalled installed fresh again and even installed an older version and then this one... So anything that can help identify why this is occurring would be welcome.

no worries, have logged in and out still the same, will get a log soon just taking son to school :)

8 Jun 2017, 10:56 PM
#737
jaydamuss avatar

jaydamuss

New Zenner

Join Date:
Mar 2011
Posts:
11
Plugin Contributions:
0

Re: User tracking mod

jaydamuss:

no worries, have logged in and out still the same, will get a log soon just taking son to school :)

here is the current log from yesterday cheers

[08-Jun-2017 18:06:52 America/New_York] Request URI: /###########/currencies.php, IP address: ########
#1  require() called at [/home/eneripek/public_html/includes/autoload_func.php:48]
#2  require(/home/eneripek/public_html/includes/autoload_func.php) called at [/home/eneripek/public_html/########/includes/application_top.php:171]
#3  require(/home/eneripek/public_html/#########/includes/application_top.php) called at [/home/eneripek/public_html/#######/currencies.php:10]

[08-Jun-2017 18:06:52 America/New_York] PHP Warning:  require(includes/init_includes/init_user_tracking.php): failed to open stream: No such file or directory in /home/eneripek/public_html/includes/autoload_func.php on line 48
[08-Jun-2017 18:06:52 America/New_York] Request URI: /#############/currencies.php, IP address: ###########
#1  require() called at [/home/eneripek/public_html/includes/autoload_func.php:48]
#2  require(/home/eneripek/public_html/includes/autoload_func.php) called at [/home/eneripek/public_html/##########/includes/application_top.php:171]
#3  require(/home/eneripek/public_html/##########/includes/application_top.php) called at [/home/eneripek/public_html/#########/currencies.php:10]

[08-Jun-2017 18:06:52 America/New_York] PHP Warning:  require(includes/init_includes/init_user_tracking.php): failed to open stream: No such file or directory in /home/eneripek/public_html/includes/autoload_func.php on line 48
[08-Jun-2017 18:06:52 America/New_York] PHP Fatal error:  require(): Failed opening required 'includes/init_includes/init_user_tracking.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eneripek/public_html/includes/autoload_func.php on line 48
8 Jun 2017, 11:29 PM
#738
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

Ahhh... Another case of incorrect installation (file placement)...

There is no file on the store side that is expected to call the init_includes folder. Meaning the incorrect includes/auto_loaders/ file is placed in the store/catalog side... config.user_tracking_install.php should not be in the catalog directory it should only be in the admin directory.

All files and folders in YOUR_ADMIN directory should be placed only in the directory that is your secret admin. All files in the base includes directory should be in the catalog's includes directory. None of the files/folders found in the YOUR_ADMIN directory should be copied to the store's directory.

Guess I'll have to do with this installer like I did with another plugin which is to prevent operation of the auto_loader when installed into the catalog side, generate a message or delete the file, etc... to prevent the issue that is being seen.

8 Jun 2017, 11:47 PM
#739
jaydamuss avatar

jaydamuss

New Zenner

Join Date:
Mar 2011
Posts:
11
Plugin Contributions:
0

Re: User tracking mod

mc12345678:

Ahhh... Another case of incorrect installation (file placement)...

There is no file on the store side that is expected to call the init_includes folder. Meaning the incorrect includes/auto_loaders/ file is placed in the store/catalog side... config.user_tracking_install.php should not be in the catalog directory it should only be in the admin directory.

All files and folders in YOUR_ADMIN directory should be placed only in the directory that is your secret admin. All files in the base includes directory should be in the catalog's includes directory. None of the files/folders found in the YOUR_ADMIN directory should be copied to the store's directory.

Guess I'll have to do with this installer like I did with another plugin which is to prevent operation of the auto_loader when installed into the catalog side, generate a message or delete the file, etc... to prevent the issue that is being seen.

im not sure what you mean, all admin files were only put in my admin folder and the seperate includes folder went into the store side

9 Jun 2017, 2:05 PM
#740
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: User tracking mod

jaydamuss:

here is the current log from yesterday cheers

[08-Jun-2017 18:06:52 America/New_York] Request URI: /###########/currencies.php, IP address: ########
#1 require() called at [/home/eneripek/public_html/includes/autoload_func.php:48]
#2 require(/home/eneripek/public_html/includes/autoload_func.php) called at [/home/eneripek/public_html/########/includes/application_top.php:171]
#3 require(/home/eneripek/public_html/#########/includes/application_top.php) called at [/home/eneripek/public_html/#######/currencies.php:10]

[08-Jun-2017 18:06:52 America/New_York] PHP Warning: require(includes/init_includes/init_user_tracking.php): failed to open stream: No such file or directory in /home/eneripek/public_html/includes/autoload_func.php on line 48
[08-Jun-2017 18:06:52 America/New_York] Request URI: /#############/currencies.php, IP address: ###########
#1 require() called at [/home/eneripek/public_html/includes/autoload_func.php:48]
#2 require(/home/eneripek/public_html/includes/autoload_func.php) called at [/home/eneripek/public_html/##########/includes/application_top.php:171]
#3 require(/home/eneripek/public_html/##########/includes/application_top.php) called at [/home/eneripek/public_html/#########/currencies.php:10]

[08-Jun-2017 18:06:52 America/New_York] PHP Warning: require(includes/init_includes/init_user_tracking.php): failed to open stream: No such file or directory in /home/eneripek/public_html/includes/autoload_func.php on line 48
[08-Jun-2017 18:06:52 America/New_York] PHP Fatal error: require(): Failed opening required 'includes/init_includes/init_user_tracking.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eneripek/public_html/includes/autoload_func.php on line 48


> **jaydamuss:**
>
> im not sure what you mean, all admin files were only put in my admin folder and the seperate includes folder went into the store side

Let me try to explain, though I doubt that I will do a good job at it because there is a bit of experience/observation from another module that has clued me into what is going on.

Little background: Saw the installer in another program when asked to perform some maintenance, it has some decent power to it if the plugin requires some form of SQL to be performed.  It offers the ability to place a version indicator somewhere in the database and offer notification of a new version of the plugin being offered from the ZC site, although typically this version information is within the applicable configuration window for the plugin. A few things were observed with its operation and expectancy of those using it (including store owners) so a few modifications were incorporated to minimize the files that would/could be involved with the process and to reduce the ease of inadvertently modifying the plugin version.  It is still possible, but requires more than a text box change. The installer/checker is placed in the admin folder structure to support admin operation.

So this installer has been used on a few plugins and out-of-the-box it works correctly and well when properly placed. Now comes the "experience/observation".  In an attempted install of another plugin that used the same style of installer, the owner observed that it seemed like the default install settings remained regardless of the change(s) made in the options of the associated configuration window.  Modify a setting to true (to activate the plugin) and on refresh the plugin was disabled as if the plugin (SQL) had been removed and then reinstalled. Come to find out, one or more of the admin/ files were copied into the catalog side of the store and effectively the plugin was repetitively installed followed by removed and immediately installed causing the default value(s) of the plugin to be restored/put into place.  

Something very similar to this is occurring here where the plugin is basically being reinstalled and that is where the notification comes in.  When the files are properly placed, the version information should appear one time with one line for each version that is "installed" or upgraded.

Now, what triggered this consideration? The above error message appears to have occurred while someone was in the admin looking at the currencies screen and possibly the files were being uploaded where the admin/includes/auto_loaders/config.user_tracking.php file was in place but the admin/includes/init_includes/init_user_tracking.php file was not yet present.

I haven't tested the system response of incorrectly loading the files to identify specifically which file(s) would need to be incorrectly placed for the response identified, but I know that the "error-checking" added to the other plugin is not yet incorporated into this one.  That error trapping was to remove the installation portion of the plugin if the wrong auto_loader file was found in the wrong side of the store.  So based on that and the previous experience it is my suggestion to not only verify that the files (not just by filename) are located where they should be, but that none of the provided files are placed where they should not be (filename recognition helps with this).

Unfortunately, this appears to be the only way that I can see that this repetitive "install" appears possible.