Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2014
    Posts
    4
    Plugin Contributions
    0

    bug [NOT A BUG] SSL in function zen_draw_form wrong code

    Current, function zen_draw_form in zencart from version begin to 1.51 :

    PHP Code:
    function zen_draw_form($name$action$parameters ''$method 'post'$params ''$usessl 'false') { 
        
    $form '<form name="' zen_output_string($name) . '" action="'
        if (
    zen_not_null($parameters)) { 
          if (
    $usessl) { 
            
    $form .= zen_href_link($action$parameters'NONSSL'); 
          } else { 
            
    $form .= zen_href_link($action$parameters'NONSSL'); 
          } 
        } else { 
          if (
    $usessl) { 
            
    $form .= zen_href_link($action'''NONSSL'); 
          } else { 
            
    $form .= zen_href_link($action'''NONSSL'); 
          } 
              ........... 
      } 
    so need change code to :

    PHP Code:
    function zen_draw_form($name$action$parameters ''$method 'post'$params ''$usessl 'false') { 
        
    $form '<form name="' zen_output_string($name) . '" action="'
        if (
    zen_not_null($parameters)) { 
          if (
    $usessl) { 
            
    $form .= zen_href_link($action$parameters'SSL'); 
          } else { 
            
    $form .= zen_href_link($action$parameters'NONSSL'); 
          } 
        } else { 
          if (
    $usessl) { 
            
    $form .= zen_href_link($action'''SSL'); 
          } else { 
            
    $form .= zen_href_link($action'''NONSSL'); 
          } 
              ........... 
      } 
    Hope this will be update at new version.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: SSL in function zen_draw_form wrong code, a big bug in zencart so need updrade co

    I don't know where you got your version of zen_draw_form, but the function in v1.5.1 is
    Code:
    /*
     *  Output a form
     */
      function zen_draw_form($name, $action, $method = 'post', $parameters = '') {
        $form = '<form name="' . zen_output_string($name) . '" action="' . zen_output_string($action) . '" method="' . zen_output_string($method) . '"';
    
        if (zen_not_null($parameters)) $form .= ' ' . $parameters;
    
        $form .= '>';
        if (strtolower($method) == 'post') $form .= '<input type="hidden" name="securityToken" value="' . $_SESSION['securityToken'] . '" />';
        return $form;
      }
    No such parameter as $usessl. I looked back to v1.3.8a and ... no such parameter as $usessl.

    It might help if you posted the top-most comment line from your version of /includes/functions/html_output.php; here's what's in the v1.5.1 version:
    Code:
    <?php
    /**
     * html_output.php
     * HTML-generating functions used throughout the core
     *
     * @package functions
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: html_output.php 19355 2011-08-21 21:12:09Z drbyte $
     */

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: SSL in function zen_draw_form wrong code, a big bug in zencart so need updrade co

    truonghoang's bug report is not well described.

    In fact, the code quoted comes from the ADMIN section, where SSL vs NONSSL is not as simple as his proposed fix implies.

    In the Admin, SSL is implemented in a way that is admittedly sub-optimal, but was necessary because of a design limitation. This is being worked on for future versions, but the fix is NOT as simple as proposed by truonghoang.

    Instead, if you want SSL on ALL admin pages, you simply edit your admin configure.php HTTP_SERVER define to have an https://whatever URL. NO CORE CODE CHANGES REQUIRED.


    Thus, this is not being classified as a bug.
    .

    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.

  4. #4
    Join Date
    Mar 2014
    Posts
    4
    Plugin Contributions
    0

    Default Re: SSL in function zen_draw_form wrong code, a big bug in zencart so need updrade co

    Yes, this is in admin selection.

    You said "if you want SSL on ALL admin pages, you simply edit your admin configure.php HTTP_SERVER define " . Yes, I know about it.

    But

    I had lost time for found and fixed this issue. That is cannot take $POST from form in zen_draw_form function by wrong ssl .

    Ex :
    PHP Code:
     zen_draw_form('batch_print'FILENAME_SUPER_BATCH_FORMS'action=batch_forms''post''target="_blank"'ENABLE_SSL_ADMIN
    if you don't pass ENABLE_SSL_ADMIN , zen_draw_form function will get $usessl = "false" default. => zen_href_link is NONSSL

    if you pass ENABLE_SSL_ADMIN and zen_draw_form function not fixed , always as NONSSL.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: SSL in function zen_draw_form wrong code, a big bug in zencart so need updrade co

    No, you misunderstand the PHP code.

    The $usessl='false' is ONLY a default, in case you the programmer don't pass an SSL preference to the form.

    So, fix your custom code (or your addon code) to pass true for the SSL parameter.

    This is NOT a bug in Zen Cart. It's a bug in your custom code.
    .

    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.

  6. #6
    Join Date
    Mar 2014
    Posts
    4
    Plugin Contributions
    0

    Default Re: SSL in function zen_draw_form wrong code, a big bug in zencart so need updrade co

    my config for define('ENABLE_SSL_ADMIN', 'true' );

    The $usessl='false' is ONLY a default, in case you the programmer don't pass an SSL preference to the form.
    same if you don't pass ENABLE_SSL_ADMIN , zen_draw_form function will get $usessl = "false" default. => zen_href_link is NONSSL

    PHP Code:
    if ($usessl) {  
            
    $form .= zen_href_link($action$parameters'NONSSL');  
          } else {  
            
    $form .= zen_href_link($action$parameters'NONSSL');  
          } 
    and please look function zen_href_link , maybe you will understand what I say

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: SSL in function zen_draw_form wrong code, a big bug in zencart so need updrade co

    I already answered this in a previous post, above.

    There is NOT a bug in zen_draw_form. The "bug" is actually a deeper core design flaw inherited from years back. The design flaw will be fixed in a future version.

    The CORRECT solution for NOW is to use an https URL in HTTP_SERVER: define('HTTP_SERVER', 'https://your_domain.com');
    .

    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.

 

 

Similar Threads

  1. v151 Creating a Jump Menu using the zen_draw_form function
    By DivaVocals in forum General Questions
    Replies: 14
    Last Post: 9 Oct 2013, 03:36 AM
  2. Replies: 3
    Last Post: 26 Nov 2011, 04:47 AM
  3. [Not a Bug] Bug in zen_truncate_paragraph function
    By SilverZulu in forum Bug Reports
    Replies: 3
    Last Post: 21 Dec 2007, 01:11 AM
  4. [NOT A BUG] Product price displays wrong
    By ozetrade in forum Bug Reports
    Replies: 10
    Last Post: 30 Nov 2007, 12:59 AM
  5. Where does zen_draw_form function definition reside?
    By MaxPowers in forum General Questions
    Replies: 1
    Last Post: 23 May 2007, 12:34 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