Jump to content

bsmither

Member
  • Posts

    18,012
  • Joined

  • Last visited

  • Days Won

    605

Posts posted by bsmither

  1. A CubeCart upgrade is a "whole-cloth" replacement of the core code and the Foundation skin. Whatever is in the database stays (more or less) untouched.

    The thing is, the exact cause of the problem is not known.

    If there is a polluted file, the upgrade will replace it.

    If there are foreign files, they will remain, but since it is unknown how these files might be interfering, there is no answer as to whether they will continue to interfere - if they do exist.

    CC6.5.1 will certainly work better with PHP 7.4 as opposed to CC6.0.12 -- if that's the fatal issue. There hasn't been any error log entry found to explain the situation.

    Is it possible that the hosting environment, now at PHP 7.4, was at a version of PHP older than PHP 7.4 - perhaps 7.1 - when CubeCart last produced a storefront page?

    What extensions are installed and enabled?

     

  2. The change made to the store setting regarding the "Default RSS URL for Admin Dashboard" is needed, but there is another edit to make:

    In the admin folder /sources/dashboard.index.inc.php, lines 270-273:

    From:
        $request->cache(true);
        $request->skiplog(true);
        $request->setMethod('post');
        $request->setData('Null');
    
    To:
        $request->setSSL();
        $request->cache(true);
        $request->skiplog(true);
        $request->setMethod('get');
        $request->setData('Null');

    This is because the source of the data this request is making has changed how it is accessed between CC6012 and now.

    I installed CC6012 under PHP 7.4.3 and other than many messages of things being deprecated, nothing crashed.

    To confirm, there are no code snippets that look suspicious?

  3. Most of these error messages were generated while in admin. One specific error that needs correcting is this:

    Admin, Store Settings, Layout tab, "Default RSS URL for Admin Dashboard", should be:
    https://forums.cubecart.com/forum/1-news-announcements.xml

    Another edit to make is:

    /public_html/classes/seo.class.php on line 592
    Remove the 'e' modifier
    See:
    https://github.com/cubecart/v6/commit/b54b241d2445d927c24682feb35aa7375e01c1a7
    but disregard that the line numbers are different.

    Neither of these edits should fix the problem.

    Please state the exact version of CubeCart that is experiencing the problem of no storefront being shown.

  4. If there is no obvious log entry (other than Deprecated) in System Error Log, then we should try to look at PHP's error_log file.

    https://forums.cubecart.com/topic/51550-how-to-create-the-error-log/

    Also, in admin, Manage Hooks, Code Snippets tab, examine the list of snippets to determine if any seem unfamiliar to you - especially if any are missing a description.

    Please save the docx to a pdf if possible.

  5. Your copy of index.php seems to be of a version earlier than CC6410. But I recognize that your version is correct for those earlier versions.

    It is only the bzwnhkbski.php file and biennvenidosloadsanta folder that needs investigating. (The others you mentioned above, I added more insights to my earlier post. You will need to reload this forum page to see them.)

  6. Yeah, you have some work ahead of you.

    The snapshot of the System Error Log has harmless 'Deprecated' messages. But this pic shows only one specific point in time. We need to find a message that could have been logged at the time you tried accessing the homepage.

    But first, make sure the file index.php has no differences to a stock file that you can compare at:

    https://github.com/cubecart/v6/blob/v6.4.10/index.php

    This: sucuriquarantine, seems to be your web security program - sucuri.net. Sucuri says, "During our cleanup, a 'quarantine' folder is created and that is where all infected files are kept. They are encrypted and will not harm your site in any way."

    This: _wildcard_.champcoclothing.com.au, might be legit, depending if it contains any data regarding SSL certificates.

    This: bzwnhkbski.php, would be interested to know what this file contains (do not post the whole file!).

     

  7. The latest version(s) of CubeCart uses the date/time placeholders of PHP's date() function. PHP 8.1 has deprecated the function strftime() and its placeholders.

    In admin, Store Settings, Advanced tab, Time & Date section, change the formats to:

    Fuzzy Time Format: H:i
    Date & Time Format: d M Y, H:i
    Dispatch Date Format: M d Y
    
    See:
    https://www.php.net/manual/en/datetime.format.php

    You may wish to view PHP's documentation on the %-style of placeholders, and compare them to the equivalent placeholder codes for the non-%-style.

     

  8. Did I read you right when you said that some files were changed, but no one knows which ones?

    If you believe some files are still not original (either changed by the malware or by your own customizations), then re-installing that same version (6.0.12?) will overwrite all stock files - but leave any files added (such as skins other than Foundation, extensions, images, etc) as they are.

    Should you choose to upgrade to CC651, be aware that you must be running PHP 8.1 to do so.

     

  9. Please examine the file .htaccess in CubeCart's main folder.

    Near the bottom there should be a statement that says to send the /index.php file for all 404 responses.

    As of CubeCart 6, using search engine friendly URLs is the only way to access CubeCart's pages.

    However, using these kinds of URLs requires the cooperation of the web server.

    Take note of these directives:

    ### Rewrite rules for SEO functionality ###
    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^(.*)?$ index.php?seo_path=$1 [L,QSA]
    </IfModule>

    These rewrite rules will only happen if the mod_rewrite extension for the web server is installed, and if the web server's configuration file allow for .htaccess directives to overrule the established/default directives the web server would otherwise follow.

    So, verify with GoDaddy if the web server serving your pages allows for overruling directives, and then that the mod_rewrite extension for the web server is installed and activated.

  10. Being able to bulk delete customers is a feature new to CubeCart version 6.4.5.

    Junk registrations is hard to kill. If you note a pattern to the name field (last two letters capitalized, for example), code can be written to test for this to immediately have PHP stop.

     

  11. First, be aware that the implementation of HOOK_TAB_CONTENT and PLUGIN_TABS is not consistent (yet). See:

    https://github.com/cubecart/v6/issues/3254

    Working specifically with the Store Settings in admin, the skin template 'settings.index.php' has only the HOOK_TAB_CONTENT capability. That means additional content is brought in using separate template HTML files (Smarty code is allowed), by specifying the filepath, that are located elsewhere - typically in a 'plugin' extension folder, but can be located anywhere PHP can access.

    Note that HOOK_TAB_CONTENT typically contains the content of sections of the page (inclusive of the <div> tags), all sections being hidden except for the 'active' section. But, for Store Settings, the place in that template where the 'element.hook_form_content.php' sub-template gets included (in turn, includes HOOK_TAB_CONTENT) means additional HTML can be inserted into the template that is visible at all times, that is, not a hidden <div class="tab_content"> block. In the admin /source/ file 'settings.index.inc.php',  at the end, is the statement that sends the array of filepaths to the template structure.

    Adding a new hidden section of content will then need an admin tab to control its visibility. Together, that is accomplished by:

    For a simple example:
    
    In your custom code:
    $GLOBALS['smarty']->assign('FOO_TAB_CONTENT_TITLE',"Foo!");
    $GLOBALS['main']->addTabControl("Foo", "tab_content's id attribute: foo");
    // Can be located anywhere PHP can access, but needs the 'file:' prefix
    $GLOBALS['hook_tab_content']=array_push('file:'.CC_ROOT_DIR.'/modules/plugins/My_Plugin/skin/div_sections/section_foo.tpl');
    
    In the file 'section_foo.tpl':
    <div id="foo" class="tab_content">
      <h3>{$FOO_TAB_CONTENT_TITLE}</h3>
      <fieldset>
        <div><span><textarea name="config[foo_data]" id="foo_content" class="textbox">{$CONFIG.foo_data}</textarea></span></div>
      </fieldset>
    </div>

    These PHP statements will be part of the PHP code that creates the tab content's computed data to show. The PHP code that creates and assigns this data to the associated template generally is executed via a triggered hook (code snippet).

    Note: there are no hookloaders directly associated with Store Settings. However, all form elements having the name 'config[]' in Store Settings are saved in the overall 'config' array.

     

  12. The General Query Log on my server has Date/Time when the connection to the client is made. So, I would look at the entries about that time, scanning for UPDATE `CubeCart_option_matrix`or ALTER TABLE `CubeCart_option_matrix`. Why ALTER TABLE? Mostly inconceivable that the column 'product_code' would be removed, then re-added, but I've seen weirder things.

    Having that data in the whole column go missing without the database logging it in the General Query Log, is beyond belief.

  13. Load the Foundation skin templates 'content.product.php' and 'element.product.call_to_action.php' into a programmer's text editor.

    In content.index.php, near lines 31-33, comment those statements:

    {*       {if !empty($PRODUCT.discounts)}
             <dd><a href="#quantity_discounts">{$LANG.catalogue.quantity_discounts}</a></dd>
             {/if}   *}

    Near lines 104-129, copy those statements to element.product.call_to_action.php, replacing lines 20-22:

    From:
    
    {if !empty($PRODUCT.discounts)}
    <p>(<a href="#quantity_discounts">{$LANG.catalogue.bulk_discount}</a>)</p>
    {/if}
    
    To:
    
             {if isset($PRODUCT.discounts)}
             <div class="content" id="quantity_discounts">
                <p>{$LANG.catalogue.quantity_discounts_explained}</p>
                <br>
                <table>
                   <thead>
                      <tr>
                         <th>{$LANG.common.quantity}</th>
                         <th>{$LANG.catalogue.price_per_unit}</th>
                      </tr>
                   </thead>
                   <tbody>
                      <tr>
                         <td class="text-center">1</td>
                         <td class="text-center">{if $PRODUCT.ctrl_sale}{$PRODUCT.sale_price}{else}{$PRODUCT.price}{/if}</td>
                      </tr>
                      {foreach from=$PRODUCT.discounts item=discount}
                      <tr>
                         <td class="text-center">{$discount.quantity}+</td>
                         <td class="text-center">{$discount.price}</td>
                      </tr>
                      {/foreach}
                   </tbody>
                </table>
             </div>
             {/if}

    Then comment those lines in content.product.php:

    {*       {if isset($PRODUCT.discounts)}
             <div class="content" id="quantity_discounts">
                <p>{$LANG.catalogue.quantity_discounts_explained}</p>
                <br>
                <table>
                   <thead>
                      <tr>
                         <th>{$LANG.common.quantity}</th>
                         <th>{$LANG.catalogue.price_per_unit}</th>
                      </tr>
                   </thead>
                   <tbody>
                      <tr>
                         <td class="text-center">1</td>
                         <td class="text-center">{if $PRODUCT.ctrl_sale}{$PRODUCT.sale_price}{else}{$PRODUCT.price}{/if}</td>
                      </tr>
                      {foreach from=$PRODUCT.discounts item=discount}
                      <tr>
                         <td class="text-center">{$discount.quantity}+</td>
                         <td class="text-center">{$discount.price}</td>
                      </tr>
                      {/foreach}
                   </tbody>
                </table>
             </div>
             {/if}       *}

     

  14. So you are fairly confident the dev people has rightfully denied responsibility. But you seem to be saying that this plugin does write things to the CubeCart database. That begs the question, does the plugin use CubeCart's collection of database functions (the 'Database' class), or does it access the database using it's own connections.

    The following pages are from the MariaDB database server - a drop-in replacement for Oracle's MySQL database server.

    This page discusses how to enable the database Binary Log. This log only has queries that actually change the data or database schema. It is more complicated to enable, rotate, and read. It is used primarily to get subordinate servers to stay current with the Main server.

    https://mariadb.com/kb/en/binary-log/

    The General Query Log logs everything. It is easy to enable, rotate, and read.

    https://mariadb.com/kb/en/general-query-log/

    Check the configuration file to see if any log files are enabled (possibly at /etc/mysql/my.cnf).

     

  15. Is your hosting environment open to you? That is, if needed, are you able to configure the database server to maintain a query log?

    It's too late now, but if so, and if you have a lingering fear of whether this might happen again, getting the database server to make daily or weekly (depending how busy your site is) log rotation might be something to consider.

    Ask your dev if their plugin sends a resolution message to ACP->adminLog().

  16. Please verify that the data in the database has or has not changed. Using an external database utility (such as phpMyAdmin), look directly at the Cubecart_option_matrix table. Do all rows have the generic format for 'product_code'? Or, for your 'pen' example, is there still the custom codes, but only when showing this data in admin is it the generic format?

  17. in /classes/user.class.php:

    Near lines 719-721, from:
    
                $agent = strtolower($_SERVER['HTTP_USER_AGENT']);
                foreach ($this->_bot_sigs as $signature) {
                    if (strpos($agent, $signature) !== false) {
    
    To:
    
                $agent = strtolower($_SERVER['HTTP_USER_AGENT'] ?? "");
                foreach ($this->_bot_sigs as $signature) {
                    if (empty($agent) || (strpos($agent, $signature) !== false)) {

    This change will use an empty string if a User-Agent-String was not provided. Then, not having provided a User-Agent-String, it will be assumed that this is not a real customer.

×
×
  • Create New...