Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 50
  1. #11
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default Re: Admin Page Registration for 3rd Party Modules

    Is there any documentation yet on how to properly add 3-party plug-ins?

    I'd like to be able to add a plug-in to the tools menu, and then an option under the configuration menu for settings.

    I have used Conor's method (above) to get the main plug-in script to show under the tools menu, but am scratching my head on how to get the configuration settings page to show.

    I can do it manually with the Admin Page Registration with these values:

    Page Key: Easy Populate 4
    Page Name: BOX_TOOLS_EASYPOPULATE_4
    Page Filename: FILENAME_CONFIGURATION
    Page Parameters: gID=32 (I look this up in phpMyAdmin)
    Menu: Configuration
    display: checked
    sort order: 99

    Any advice on how to do this automatically would be great.
    Thanks!

    PS: Hey Dr. Byte! Any chance you could update your Backup MYSQL Plugin to be 1.5 compatible?

  2. #12
    Join Date
    Aug 2004
    Location
    Belfast, Northern Ireland
    Posts
    2,480
    Plugin Contributions
    14

    Default Re: Admin Page Registration for 3rd Party Modules

    Hi Chadd,

    Hope all is well!

    Quote Originally Posted by chadderuski View Post
    how to get the configuration settings page to show.

    I can do it manually with the Admin Page Registration with these values:

    Page Key: Easy Populate 4
    Page Name: BOX_TOOLS_EASYPOPULATE_4
    Page Filename: FILENAME_CONFIGURATION
    Page Parameters: gID=32 (I look this up in phpMyAdmin)
    Menu: Configuration
    display: checked
    sort order: 99

    Any advice on how to do this automatically would be great.
    In Ceon URI Mapping I implement the following code:

    PHP Code:
    // Make sure configuration group can be displayed in admin menu
                    
    if (function_exists('zen_register_admin_page')) {
                            if (!
    zen_page_key_exists('ceon_uri_mapping_config_group')) {
                                    
    // Add the link to the Ceon URI Mapping Config Utility to the admin menu
                                    
    zen_register_admin_page('ceon_uri_mapping_config_group',
                                            
    'BOX_CEON_URI_MAPPING_CONFIG_GROUP''FILENAME_CONFIGURATION',
                                            
    'gID=' $configuration_group_id'configuration''Y',
                                            
    $configuration_group_id);
                                    
                                    
    $messageStack->add('Configuration group added to admin menu.''success');
                            }
                    } 
    The value for the $configuration_group_id variable is either generated or looked up right before this call.

    Adjusting that for your settings would result in the following code:

    PHP Code:
    // Make sure configuration group can be displayed in admin menu
                    
    if (function_exists('zen_register_admin_page')) {
                            if (!
    zen_page_key_exists('easy_populate_4')) {
                                    
    // Add the link to the Easy Populate 4 to the admin menu
                                    
    zen_register_admin_page('easy_populate_4',
                                            
    'BOX_TOOLS_EASYPOPULATE_4''FILENAME_CONFIGURATION',
                                            
    'gID=' $configuration_group_id'configuration''Y',
                                            
    $configuration_group_id);
                                    
                                    
    $messageStack->add('Configuration group added to admin menu.''success');
                            }
                    } 
    You'd have to look up the configuration group beforehand and the messageStack notification is obviously optional but I've left it in here as I think that kind of feedback's nice for the user.

    Example code for looking up configuration group ID:

    PHP Code:
    $check_config_group_exists_sql "
                            SELECT
                                    configuration_group_id
                            FROM
                                    " 
    TABLE_CONFIGURATION_GROUP "
                            WHERE
                                    configuration_group_title = 'Ceon URI Mapping (SEO)';"
    ;
                    
                    
    $check_config_group_exists_result $db->Execute($check_config_group_exists_sql);
                    
                    if (!
    $check_config_group_exists_result->EOF) {
                            
    $configuration_group_id =
                                    
    $check_config_group_exists_result->fields['configuration_group_id'];
                    } 
    Hope that helps!

    All the best...

    Conor
    ceon

  3. #13
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Admin Page Registration for 3rd Party Modules

    It's not entirely clear what you're wanting here. If it's a way to take older add-ons that know nothing about the new security features and somehow have then automatically integrated with it, then that's not going to happen.

    Responsibility for integrating add-ons into the Admin rests with the add-on's author. Most will probably add a line to the SQL executed in sql patch facility. A smaller number, such as Conor, may offer automated php-based installation using the new page registration function. The specific steps needed should be explained by each mod's installation instructions.

    Older, unsupported mods present a different problem. For this the page registration page has been supplied. Explanation as to how to use it is displayed on the page itself and it seem that you've done a fine job of using it. But this is just a fallback, and you will still need to ensure that the older mod's you're using don't reintroduce the sorts of vulnerabilities that the Zen Cart have gone to great lengths to close for version 1.5.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  4. #14
    Join Date
    Apr 2006
    Location
    Dark Side of the Moon
    Posts
    987
    Plugin Contributions
    1

    Default Re: Admin Page Registration for 3rd Party Modules

    Hi Conor!

    Thanks for the additional info and code! I'll dig into it and we'll see how successful I am at implementing it! I'm sure other developers will also find this useful.

    Hey Kuroi! --->> BTW, really like the Avatar! Very Cool! Is that new?

    No, I'm not just trying to patch 'incompatible' code to work with 1.5. I have been working on an update to the Easy Populate mod for some time. It currently self detects if the configuration variables are installed and allows the user to install from within the script. You can also uninstall from within the script rather than running sql patches. Of course, this may change, and I still need to review the code to ensure it meets all the new requirements. But at this point I want to ensure the mod is easy to install for myself and others.

    I have looked, but have not found any documentation on 3rd-party integration of modules. If there is, please link...

    A smaller number, such as Conor, may offer automated php-based installation using the new page registration function.
    From Conor's work and Dr. Byte's statement above, I figured automated installation with the page registration function would become more the standard than just running sql patches. As it was stated in an earlier thread, this function may be removed from the admin, so I assume it would only then be available programmatically.

    I'm sure the whole issue of 3rd party mods will bloom into more than just "compatible" (i.e. it works) vs being verified as secure and following all the proper guidelines for just that. Much excitement still ahead!

    -cj

  5. #15
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,221
    Plugin Contributions
    1

    Default Re: Admin Page Registration for 3rd Party Modules

    From what I can gather, the ability in v1.5, to install a 3rd party add-on through an SQL patch AND have the mod display in Admin>Configuration will be addressed in the final release.

    Is there a way to 'simply' edit an existing .sql file to do this in the interim? I'm developing a 1.50 RC2 site and cannot get mods to show in Admin>Config..., although can navigate to them by gID

  6. #16
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    785
    Plugin Contributions
    7

    Default Re: Admin Page Registration for 3rd Party Modules

    Quote Originally Posted by simon1066 View Post
    From what I can gather, the ability in v1.5, to install a 3rd party add-on through an SQL patch AND have the mod display in Admin>Configuration will be addressed in the final release.

    Is there a way to 'simply' edit an existing .sql file to do this in the interim? I'm developing a 1.50 RC2 site and cannot get mods to show in Admin>Config..., although can navigate to them by gID
    I have just used DrByte's http://www.zen-cart.com/forum/showpo...8&postcount=10 and conor's init_includes example on my update to Monthly Sales Tax Summary v1.4 and it works fine.

    Skip
    • 446F63746F722057686F •

  7. #17
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,221
    Plugin Contributions
    1

    Default Re: Admin Page Registration for 3rd Party Modules

    Thanks, Skip. I'll check this out

    Cheers

    Simon

  8. #18
    Join Date
    Feb 2009
    Location
    UK
    Posts
    1,221
    Plugin Contributions
    1

    Default Re: Admin Page Registration for 3rd Party Modules

    With Skip's post having prompted me to re-read the previous posts in this thread, I now understand a bit more. I'll have to delve a bit deeper before installing SQL patches of older mods that might not be as secure as v1.50 requires.

  9. #19
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Admin Page Registration for 3rd Party Modules

    Like many, I guess, this seems a bit of a round about way to install some database changes but those are the hoops PCI makes you jump through :-)

    What about having a separate directory for the install files that was cleaned out after every run. What I am thinking of is a almost clone of the init_includes system but at the end of the process the directory is always cleared of files. So that any file placed in that folder would only be executed the one time.



    (Or perhaps it would be better to have a directory for install files. Then create an 'available installs' admin page that scanned that folder and presented any available files along with an 'install' button. Then the user could choose to install and the file would be deleted at the end of the process. All the module developer would need to do is put a file in the install directory and it would appear in the 'Available Installs' page. )

    I just think that it would at least standardise the installation process. Anyone have any thoughts?

    Security risks in having a directory that contains files that are executed in this way?

    ------------------------

    Of course, once I am thinking about that I start thinking that:
    -- a module's files should be uploaded in a separate directory at root level, say /module-image-handler/
    -- a file should be uploaded to the new init_install directory when it is run it moves the files from /module-image-handler/ to their correct positions copying any overwritten files back to /module-image-handler/overridden/ using a nice set of functions supplied by the core.
    -- it then runs any sql statements
    -- it then zips /module-image-handler/ as a recoverable record of the installation
    -- it then writes data to a new table in the database with install details (and perhaps details of all over-written files so that in future a new mod could check them for compatibility)

    ------------------------

    Of course, if there are big changes planned for Zen 2.0 then this is not worth the time. However it might be worth creating a init_install functionality to step around the chicken and egg situation that exists at the moment?

    As I say just thoughts.

  10. #20
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin Page Registration for 3rd Party Modules

    Quote Originally Posted by niccol View Post
    Of course, if there are big changes planned for Zen 2.0 then this is not worth the time.
    Indeed there are big changes planned - a complete plugin architecture is in the works.
    But that's an entirely separate topic.
    .

    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.

 

 
Page 2 of 5 FirstFirst 1234 ... LastLast

Similar Threads

  1. v151 3rd party software access using XML-RPC for PHP
    By torvista in forum Contribution-Writing Guidelines
    Replies: 7
    Last Post: 24 Oct 2012, 10:39 PM
  2. Integrate api code from 3rd party for m commerce
    By ronaldlb in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 5 Apr 2011, 04:05 PM
  3. looking for product_id to implement 3rd party tool in my site
    By Greywacke in forum General Questions
    Replies: 1
    Last Post: 2 Feb 2010, 01:02 PM
  4. 3rd party SSL Certificate Admin and Customer Login don't work
    By gws76 in forum Installing on a Linux/Unix Server
    Replies: 6
    Last Post: 9 Feb 2009, 10:44 AM
  5. 3rd Party PayPal Website Payments Pro Modules
    By webrob in forum Addon Payment Modules
    Replies: 4
    Last Post: 27 Jun 2007, 04:46 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