osCmax v2.5 User Manual
Results 1 to 8 of 8

oscMax Admin reports configure.php as writeable when it is not

This is a discussion on oscMax Admin reports configure.php as writeable when it is not within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Hi I did a fresh install of v2.5beta3 and found when I was in the Admin Home page that it ...

      
  1. #1
    New Member
    Join Date
    Mar 2011
    Location
    Croydon (Melbourne), Victoria, Australia
    Posts
    26
    Rep Power
    0


    Default oscMax Admin reports configure.php as writeable when it is not

    Hi

    I did a fresh install of v2.5beta3 and found when I was in the Admin Home page that it was reporting the configure.php file as being writeable when I knew that I had set permissions correctly.

    I found that the admin page was not differentiating between the catalog configure and the admin configure files.

    I wrote a blog on it and included the code changes that I made at

    Tonys Tech Blog » Blog Archive » oscMax Admin page reports configure.php as writeable when it is not

    But my Wordpress site is not setup to handle 'code' politely and is messing with the formatting. So I've copied the changes here.

    Two files need changing:

    admin/includes/languages/english/index.php
    modify the setting at line 115

    Code:
    define('WARNING_CONFIG_FILE_WRITEABLE', 'Error: I am able to write to the catalog configuration file: ' . (DIR_FS_CATALOG) . 'includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
    :: only change is to add the word ‘catalog’ in the text.

    Then add a new constant setting at line 116
    Code:
    define('WARNING_ADMIN_CONFIG_FILE_WRITEABLE', 'Error: I am able to write to the admin configuration file: ' . (DIR_FS_ADMIN) . 'includes/configure.php. This is a potential security risk - please set the right user permissions on this file.');
    :: the main changes here highlight that its the admin configure file that is the issue.

    Then update the system.php file that calls the above messages:
    :: the main changes are copying the config check to test the catalog configure, the nesting of the dirname function to get the parent directory for the catalog, and the change to the code comments to differentiate between the two checks.

    admin/includes/modules/dashboard/system.php
    at around line 117 to replace the section referring to the configure file with the following code:

    Code:
    <!-- Start check for catalog configure file -->
      <?php
    	if ( (file_exists(dirname(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME'])) . '/includes/configure.php')) && (is_writeable(dirname(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME'])) . '/includes/configure.php')) ) { $system_permission_errors++; ?>
      <tr>
        <td class="messageStackError"><?php echo tep_image(DIR_WS_ICONS . 'error.gif') . ' ' . WARNING_CONFIG_FILE_WRITEABLE; ?></td>
      </tr>
      <?php } ?>
      <!-- End check for catalog configure file -->
    
      <!-- Start check for admin configure file -->
      <?php
        if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $system_permission_errors++; ?>
      <tr>
        <td class="messageStackError"><?php echo tep_image(DIR_WS_ICONS . 'error.gif') . ' ' . WARNING_ADMIN_CONFIG_FILE_WRITEABLE; ?></td>
      </tr>
      <?php } ?>
      <!-- End check for admin configure file -->
    Save your files and test by changing the permissions on each configure.php file to being writeable. Change the permissions back and in future the Admin screen will highlight if you have unwanted changes to the permissions.

    cheers
    Tony

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default Re: oscMax Admin reports configure.php as writeable when it is not

    This was already fixed for the upcoming RC release - nice work though, even if you are a little late to the dance!

    It was fixed a while back:
    0000583: System info shows incorrect path when admin configure.php is writable causing confusion. - osCmax Bug Tracking System
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    osCMax Development Team met00's Avatar
    Join Date
    Oct 2005
    Location
    wherever I happen to be at the moment
    Posts
    854
    Blog Entries
    2
    Rep Power
    26


    Default Re: oscMax Admin reports configure.php as writeable when it is not

    Tony, just a heads up when working in 2.5 Beta or even RC1.

    Always check the bugtracker first. The fix you are looking for may already exist.

    In addition, if you are making any changes to a beta (or even an RC), take copious notes. For example...

    Code:
    added distributors.php to admin
    added distributors.php to admin/includes/languages/english
    added distributors defines to admin/includes/languages/english/core.php
    added distributors table to admin/includes/database_tables.php
    added distributors to admin/include/filenames.php
    added distributors to admin/includes/boxes/catalog.php 
    mods to products table
    - added products_cost
    - ALTER  TABLE  `products`  ADD  `products_cost` DECIMAL( 15, 4  )  NOT  NULL  COMMENT  'product cost' AFTER  `products_msrp` ; 
    - added distributors_id
    - ALTER  TABLE  `products`  ADD  `distributors_id` INT( 11  )  NOT  NULL  COMMENT  'distributor id' AFTER  `manufacturers_id` ; 
    - added products_oversized
    - ALTER  TABLE  `products`  ADD  `products_oversized` INT( 1 )  NOT  NULL  COMMENT  'product special order' AFTER  `products_min_order_qty` ; 
    - added products_specialorder
    - ALTER  TABLE  `products`  ADD  `products_specialorder` INT( 1 )  NOT  NULL  COMMENT  'product special order' AFTER  `products_oversized` ; 
    orders_products table
    - added products_cost
    - ALTER  TABLE  `orders_products`  ADD  `products_cost` DECIMAL( 15, 4  )  NOT  NULL  COMMENT  'product cost' AFTER  `products_price` ; 
    added products_cost to: catalog/checkout_process.php
    added products_cost to: catalog/includes/classes/shopping_cart.php
    added products_cost to: catalog/includes/classes/order.php
    In line code should look like

    Code:
    //BOF: cost
       $cost_query = tep_db_query("select products_cost from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
       $cost_value = tep_db_fetch_array($cost_query);
    // EOF: cost
    This is time consuming, but the upside is that when you get the next Beta, or the RC you can replace/update files not touched quickly and apply any changes to the files you did touch with much less time spent wondering what was touched and what was not. The inclusion of the SQL to update the database makes it easy to get your database back to where it was in your development environment.
    so endith the lesson
    <think>sometimes I just sit's and thinks</think>
    "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB

  4. #4
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: oscMax Admin reports configure.php as writeable when it is not

    Hi again Tony,

    Having had a browse through your blog I would suggest that you test out osCmax using the SVN version of osCmax ... the development has been quite rapid recently and I wouldn't want you duplicating work unnecessarily.

    I would also be interested in hearing what you think of osCmax (being a potential convert from osCommerce and CRE) ... anything missing that should go into v2.6?

    Regards,
    pgmarshall
    _______________________________

  5. #5
    New Member
    Join Date
    Mar 2011
    Location
    Croydon (Melbourne), Victoria, Australia
    Posts
    26
    Rep Power
    0


    Default Re: oscMax Admin reports configure.php as writeable when it is not

    Quote Originally Posted by met00 View Post
    Tony, just a heads up when working in 2.5 Beta or even RC1.

    Always check the bugtracker first. The fix you are looking for may already exist.
    Doh!

    I must have had a 'little boy look' as I did not find it.......

  6. #6
    New Member
    Join Date
    Jun 2011
    Posts
    23
    Rep Power
    0


    Default Re: oscMax Admin reports configure.php as writeable when it is not

    if there had been a fix, how come it is happening to my admin. how can i change it?

  7. #7
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: oscMax Admin reports configure.php as writeable when it is not

    Because you are using RC1 ... the current work is being done on RC2 ... You can change it by looking in the Google Code link in the header marked "Developers" ... find the fix linked above and hand code the changes ...

    Regards,
    pgmarshall
    _______________________________

  8. #8
    New Member
    Join Date
    Jun 2011
    Posts
    23
    Rep Power
    0


    Default Re: oscMax Admin reports configure.php as writeable when it is not

    that's a little bit complicated for me...i might as well wait for the RC2. thanks again.

Similar Threads

  1. Admin Reports Count Reset
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 11-07-2009, 05:51 AM
  2. Admin Reports Count Reset
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 09-10-2009, 06:02 PM
  3. SSL Setup for (admin) catalog/admin/includes/configure.php?
    By sushiboiiii in forum osCmax v2 Installation issues
    Replies: 0
    Last Post: 05-13-2009, 03:35 PM
  4. Admin Reports Count Reset
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 08-06-2008, 08:00 PM
  5. MainPage Not Writeable In Admin Area
    By jmdesign in forum osCMax v2 Features Discussion
    Replies: 3
    Last Post: 04-19-2007, 07:42 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
  •