Page 74 of 86 FirstFirst ... 2464727374757684 ... LastLast
Results 731 to 740 of 858
  1. #731
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default 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:
    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):

    Code:
    // 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');
                      }
                  }
              }
          }
      }
    }
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  2. #732
    Join Date
    Mar 2011
    Posts
    11
    Plugin Contributions
    0

    Default Re: User tracking mod

    Quote Originally Posted by mc12345678 View Post
    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

  3. #733
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: User tracking mod

    Quote Originally Posted by jaydamuss View Post
    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?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  4. #734
    Join Date
    Mar 2011
    Posts
    11
    Plugin Contributions
    0

    Default Re: User tracking mod

    Quote Originally Posted by mc12345678 View Post
    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

  5. #735
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: User tracking mod

    Quote Originally Posted by jaydamuss View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #736
    Join Date
    Mar 2011
    Posts
    11
    Plugin Contributions
    0

    Default Re: User tracking mod

    Quote Originally Posted by mc12345678 View Post
    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 :)

  7. #737
    Join Date
    Mar 2011
    Posts
    11
    Plugin Contributions
    0

    Default Re: User tracking mod

    Quote Originally Posted by jaydamuss View Post
    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

    Code:
    [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. #738
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default 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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #739
    Join Date
    Mar 2011
    Posts
    11
    Plugin Contributions
    0

    Default Re: User tracking mod

    Quote Originally Posted by mc12345678 View Post
    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

  10. #740
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: User tracking mod

    Quote Originally Posted by jaydamuss View Post
    here is the current log from yesterday cheers

    Code:
    [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
    Quote Originally Posted by jaydamuss View Post
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 74 of 86 FirstFirst ... 2464727374757684 ... LastLast

Similar Threads

  1. User Tracking Mod only shows the Admin Session
    By Griff1324 in forum General Questions
    Replies: 6
    Last Post: 29 May 2008, 10:56 PM
  2. User Tracking Mod issue: repeated Logins: Admin: View Sessions
    By dharma in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 20 Feb 2008, 04:48 AM
  3. Search log mod vs. user tracking
    By ashton0603 in forum General Questions
    Replies: 4
    Last Post: 30 Jan 2008, 08:43 AM
  4. Google Analytics vs User Tracking mod
    By miles in forum General Questions
    Replies: 1
    Last Post: 15 Jun 2007, 10:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR