Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2008
    Posts
    4
    Plugin Contributions
    0

    Default What are the drawbacks of hard-coding the SUPERUSER_PROFILE?

    I've been in the process the last couple of days fending off errors updating one of our zen cart installations from 1.3.9h to 1.5.0. It has been an entirely manual process, not an upgrade script. It is a self-hosted store, currently on a CentOS 6.2 install with all the current patches.

    The front-end of our store has worked just fine so far (not done testing yet), but the admin side has had error after error. Most have had a satisfyingly simple solution (Oh, I forgot to merge this file... Oh, for some reason this file didn't upload...) Up until I encountered this one:

    Code:
    WARNING: An Error occurred, please refresh the page and try again.
    Following this error log in the cache directory...

    Code:
    PHP Fatal error: 1054:Unknown column 'SUPERUSER_PROFILE' in 'where clause' :: SELECT admin_id from admin
              WHERE admin_id = 2
              AND admin_profile = SUPERUSER_PROFILE in /var/www/sites/pocketdoorproducts/includes/classes/db/mysql/query_factory.php on line 101
    ...I wound up at line 53 of /admin/includes/functions/admin_access.php, specifically staring that SUPERUSER_PROFILE in the face. For some odd reason the SQL query is receiving the string quite literally as SUPERUSER_PROFILE instead of substituting it for the number 1 as defined in /admin/includes/init_includes/init_admin_auth.php.

    What's got me, though, is it's receiving the value for ADMIN_TABLE just fine. I hard-code in the value of 1 in place of SUPERUSER_PROFILE and it loads right up.

    My question then is: What are the drawbacks to just leaving that? I'm not real keen on the idea, but the boss is getting antsy. Would I just be committing sacrilege or will this break some functionality that I'm not seeing?

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

    Default Re: What are the drawbacks of hard-coding the SUPERUSER_PROFILE?

    Is your init_admin_auth.php actually loading?
    Or do you have one in the subfolder named overrides which is taking precedence, which you've not upgraded with the new content?
    .

    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.

  3. #3
    Join Date
    Sep 2008
    Posts
    4
    Plugin Contributions
    0

    Default Re: What are the drawbacks of hard-coding the SUPERUSER_PROFILE?

    Thanks, DrByte. That not only solved the issue, it also gave me the admin rename warning I was expecting but never saw. I really need a new job... lol - All this rush rush pressure and I'm skipping over the obvious.

    Thanks, again.

  4. #4
    Join Date
    Apr 2008
    Posts
    283
    Plugin Contributions
    0

    Default Re: What are the drawbacks of hard-coding the SUPERUSER_PROFILE?

    I am receiving this error which is resulting in a blank page when I log into the admin side. Any ideas on how to fix it. It occurred whenever I upgraded my site from 1.38a to 1.54

    [01-Jan-2015 18:26:48 America/Chicago] PHP Fatal error: 1054:Unknown column 'SUPERUSER_PROFILE' in 'where clause' ... ==> (as called by) /home/stxmill/public_html/testzen/admin/includes/functions/admin_access.php on line 69 <== in /home/stxmill/public_html/testzen/includes/classes/db/mysql/query_factory.php on line 155

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

    Default Re: What are the drawbacks of hard-coding the SUPERUSER_PROFILE?

    Quote Originally Posted by welchyboy View Post
    I am receiving this error which is resulting in a blank page when I log into the admin side. Any ideas on how to fix it. It occurred whenever I upgraded my site from 1.38a to 1.54

    [01-Jan-2015 18:26:48 America/Chicago] PHP Fatal error: 1054:Unknown column 'SUPERUSER_PROFILE' in 'where clause' ... ==> (as called by) /home/stxmill/public_html/testzen/admin/includes/functions/admin_access.php on line 69 <== in /home/stxmill/public_html/testzen/includes/classes/db/mysql/query_factory.php on line 155
    Same resolution as given to the person whom you replied to above.
    .

    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. v139h What are the changes in the USPS RateV4 Intl RateV2 Jan 26, 2014 module?
    By Danielle in forum Addon Shipping Modules
    Replies: 5
    Last Post: 31 Jan 2014, 10:25 PM
  2. what are the meaning of the fields in Attributes Controller
    By linjuming in forum General Questions
    Replies: 1
    Last Post: 17 Sep 2012, 02:08 AM
  3. Hard coding STORE_NAME setting
    By joyjoy in forum Customization from the Admin
    Replies: 2
    Last Post: 17 May 2012, 02:08 AM
  4. what are the database fields in the Zen cart
    By hsappleton in forum Basic Configuration
    Replies: 1
    Last Post: 17 Jan 2007, 03:35 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