Jump to content

Antonio Garcia

♥Ambassador
  • Content count

    118
  • Joined

  • Last visited


Reputation Activity

  1. Like
    Antonio Garcia got a reaction from Mac2256 in Email subject with non ASCII char gives 550 Subject contains invalid characters (in hotmail)   
    As it seems that nobody report this issue, may be it's only a bug in my code/config, but I would like to ask if someone detect this issue:
    I my case, I checked in: EDGE and into an old 2.2M site but NOT in PHOENIX the following:
    PHP: 5.6
    Hosting in linux servers
    Detected at least in admin/email.php (sending email from admin)
    I detected that, in spanish sites when the subject comes with not ASCII chars, the emails:
    - Are received by gmail.com recipients.
    - Not reaches in xxx@hotmail.com. In my case, the sender email (XXX@gmail.com) receives a 'Mail delivery failed: returning message to sender' with the following error:
    xxxl@hotmail.com
     host outbound.mailspamprotection.com [184.154.136.82]
     SMTP error from remote mail server after end of data:
     550 Subject contains invalid characters.
    EDGE and 2.2m shares the same email.php class.
    Tried to change:
    $this->build_params['text_encoding'] = '7bit';
    to
    $this->build_params['text_encoding'] = 'base64';
    with no success...
    Anybody has the same issue?
  2. Like
    Antonio Garcia reacted to YePix in SMTP Authentication and OSCommerce   
    For those who want or need to send their emails with smtp through authentication.
    Email not suitable for gmail accounts !!!
    ****************************************************
    Step 1.
    BACKUP ALL FILES BEFORE CHANGE !!!
    ****************************************************
    Step 2.
    Download:
    www.pl-systeme.de/free_download/PHPMailer.zip
    transferred to:
    catalog/ext/modules/PHPMailer
    ****************************************************
    Step 3.
    change class files:
    catalog/includes/classes.php
    <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce */ require_once 'ext/modules/PHPMailer/class.phpmailer.php'; $phpMail = new PHPMailer(); class email { var $html; var $text; var $html_text; var $lf; var $debug = 0; var $debug_output = 'error_log'; function email($headers = '') { global $phpMail; $phpMail->XMailer = 'osCommerce ' . tep_get_version(); $phpMail->SMTPDebug = $this->debug; $phpMail->Debugoutput = $this->debug_output; $phpMail->CharSet = CHARSET; $phpMail->WordWrap = 998; if (EMAIL_LINEFEED == 'CRLF') { $this->lf = "\r\n"; } else { $this->lf = "\n"; } } function add_text($text = '') { global $phpMail; $phpMail->IsHTML(false); $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); } function add_html($html, $text = NULL, $images_dir = NULL) { global $phpMail; $phpMail->IsHTML(true); $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br />', $html); $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); if (isset($images_dir)) $this->html = $phpMail->msgHTML($this->html, $images_dir); } function add_attachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') { global $phpMail; $phpMail->AddAttachment($path, $name, $encoding, $type, $disposition); } function build_message() { //out of work function } function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $reply_to = false) { global $phpMail; if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) { return false; } if ((strstr($to_addr, "\n") != false) || (strstr($to_addr, "\r") != false)) { return false; } if ((strstr($subject, "\n") != false) || (strstr($subject, "\r") != false)) { return false; } if ((strstr($from_name, "\n") != false) || (strstr($from_name, "\r") != false)) { return false; } if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) { return false; } $phpMail->From = $from_addr; $phpMail->FromName = $from_name; $phpMail->AddAddress($to_addr, $to_name); if ($reply_to) { $phpMail->AddReplyTo(EMAIL_SMTP_REPLYTO, STORE_NAME); } else { $phpMail->AddReplyTo($from_addr, $from_name); } $phpMail->Subject = $subject; if (!empty($this->html)) { $phpMail->Body = $this->html; $phpMail->AltBody = $this->html_text; } else { $phpMail->Body = $this->text; } if (EMAIL_TRANSPORT == 'smtp' || EMAIL_TRANSPORT == 'gmail') { $phpMail->IsSMTP(); $phpMail->Host = EMAIL_SMTP_HOSTS; $phpMail->SMTPAuth = EMAIL_SMTP_AUTHENTICATION; $phpMail->Username = EMAIL_SMTP_USER; $phpMail->Password = EMAIL_SMTP_PASSWORD; if (EMAIL_TRANSPORT == 'gmail') { $phpMail->Port = 465; $phpMail->SMTPSecure = 'ssl'; } } else { $phpMail->isSendmail(); } if (!$phpMail->Send()) { return false; } return true; } } /* ** Altered for Mail Manager ** */ // eliminate line feeds as <br> class emailMailManager extends email { function add_html($html, $text = NULL, $images_dir = NULL) { $this->html = $html; //tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html); $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); if (isset($images_dir)) $this->find_html_images($images_dir); } } /* ** EOF alterations for Mail Manager ** */ ?> catalog/admin/includes/classes.php
    <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ require_once '../ext/modules/PHPMailer/class.phpmailer.php'; $phpMail = new PHPMailer(); class email { var $html; var $text; var $html_text; var $lf; var $debug = 0; var $debug_output = 'error_log'; function email($headers = '') { global $phpMail; $phpMail->XMailer = 'osCommerce ' . tep_get_version(); $phpMail->SMTPDebug = $this->debug; $phpMail->Debugoutput = $this->debug_output; $phpMail->CharSet = CHARSET; $phpMail->WordWrap = 998; if (EMAIL_LINEFEED == 'CRLF') { $this->lf = "\r\n"; } else { $this->lf = "\n"; } } function add_text($text = '') { global $phpMail; $phpMail->IsHTML(false); $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); } function add_html($html, $text = NULL, $images_dir = NULL) { global $phpMail; $phpMail->IsHTML(true); $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br />', $html); $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); if (isset($images_dir)) $this->html = $phpMail->msgHTML($this->html, $images_dir); } function add_attachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') { global $phpMail; $phpMail->AddAttachment($path, $name, $encoding, $type, $disposition); } function build_message() { //out of work function } function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $reply_to = false) { global $phpMail; if ((strstr($to_name, "\n") != false) || (strstr($to_name, "\r") != false)) { return false; } if ((strstr($to_addr, "\n") != false) || (strstr($to_addr, "\r") != false)) { return false; } if ((strstr($subject, "\n") != false) || (strstr($subject, "\r") != false)) { return false; } if ((strstr($from_name, "\n") != false) || (strstr($from_name, "\r") != false)) { return false; } if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) { return false; } $phpMail->From = $from_addr; $phpMail->FromName = $from_name; $phpMail->AddAddress($to_addr, $to_name); if ($reply_to) { $phpMail->AddReplyTo(EMAIL_SMTP_REPLYTO, STORE_NAME); } else { $phpMail->AddReplyTo($from_addr, $from_name); } $phpMail->Subject = $subject; if (!empty($this->html)) { $phpMail->Body = $this->html; $phpMail->AltBody = $this->html_text; } else { $phpMail->Body = $this->text; } if (EMAIL_TRANSPORT == 'smtp' || EMAIL_TRANSPORT == 'gmail') { $phpMail->IsSMTP(); $phpMail->Host = EMAIL_SMTP_HOSTS; $phpMail->SMTPAuth = EMAIL_SMTP_AUTHENTICATION; $phpMail->Username = EMAIL_SMTP_USER; $phpMail->Password = EMAIL_SMTP_PASSWORD; if (EMAIL_TRANSPORT == 'gmail') { $phpMail->Port = 465; $phpMail->SMTPSecure = 'ssl'; } } else { $phpMail->isSendmail(); } if (!$phpMail->Send()) { return false; } return true; } } /* ** Altered for Mail Manager ** */ // eliminate line feeds as <br> class emailMailManager extends email { function add_html($html, $text = NULL, $images_dir = NULL) { $this->html = $html; //tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html); $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text); if (isset($images_dir)) $this->find_html_images($images_dir); } } /* ** EOF alterations for Mail Manager ** */ ?> ****************************************************
    Step 4.
    catalog/admin/functions/general.php
    find:
    //// // Sets the status of a product   function tep_set_product_status($products_id, $status) {     if ($status == '1') {       return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '1', products_last_modified = now() where products_id = '" . (int)$products_id . "'");     } elseif ($status == '0') {       return tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0', products_last_modified = now() where products_id = '" . (int)$products_id . "'");     } else {       return -1;     }   } add below:
    //// // Sets the password function for db function tep_cfg_password($password) { return preg_replace("|.|", "*", $password); } function tep_cfg_input_password($password) { return tep_draw_password_field('configuration_value', $password); } ****************************************************
    Step 5.
    Import sql:
    INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('SMTP hosts', 'EMAIL_SMTP_HOSTS', '', 'Assign SMTP host senders', '12', '6', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('SMTP authentication', 'EMAIL_SMTP_AUTHENTICATION', 'true', 'Do you want authenticated SMTP server?', '12', '7', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('SMTP Password', 'EMAIL_SMTP_PASSWORD', '', 'Add SMTP Password for SMTP protocol', '12', '8', 'tep_cfg_password', 'tep_cfg_input_password(', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('SMTP User', 'EMAIL_SMTP_USER', '', 'Add SMTP user for SMTP protocol', '12', '9', now()); INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('SMTP Reply To', 'EMAIL_SMTP_REPLYTO', '', 'Add SMTP reply to address', '12', '10', now()); ****************************************************
    Step 6.
    go to:
    http://www.yourDomain.com/admin/configuration.php?gID=12
    change the new SMTP email settings and set the email transport method to smtp
    ****************************************************
    Step 7.
    finished.
  3. Like
    Antonio Garcia reacted to burt in Bootstrap 4 in 2.3.4.1   
    Bootstrap 3 will be around for years - no point overthinking that, so forget it. 
    The main "problem" will be upgrade php. Some people say php7.2 is working fine, others report it is not working fine.
    At the end of the 28d, dependant on support thereof, I hope to have gotten enough time in hand to get the following done and complete;
    make sure shop and admin are ready for 7.2 (at the very least, possibly 7.3 if I can swing it)
    -> no warnings and no errors product class
    -> rework relevant modules to use it But as with all things, one step at a time, and right now that step is trying to get some time in hand to actually do "stuff".
  4. Like
    Antonio Garcia reacted to Jack_mcs in Article Manager v1.0   
    To those that interested, there is a planned update, probably within the next few weeks.
  5. Thanks
    Antonio Garcia reacted to piernas in Shipping table is now a real table :)   
    Today I decided I got angry for the last time updating a table rate based module. Afer several tryouts to change the shipping rates just to see I had a typo in the values string  -damned colons- and having to manually calculate the net prices for each row from the gross that came from the table provided by the courier... I had enough and modified the table rate module to show a real table where you can see what you're doing. Uses some javascript to update net/gross, add or remove rows and do some basic checks.
    It can be adapted to any other module that uses the same system.
    Note: The net pice is caclulated based on the tax class from the module. It will apply only to the countries in the module's zone and it's not savet to database but calculated on the fly. For this column to work you need to set up the tax rate first, save and enter the module configuration again.
    Here is the file: https://apps.oscommerce.com/wyYLv&sgipping-table-module-update
    @burt you can replace the stock one if you consider it fits the community project.

  6. Like
    Antonio Garcia reacted to Jack_mcs in Generic Infobox   
    This module allows one infobox module to be installed that can contain any number of template files. In effect, it is an infobox container. This could be accomplished by creating many individual modules but this provides a better way in certain situations.
    With this module,
    - Add a new section by adding just one more file, instead of the normal three files.
    - Easily enable and disable the modules via the main module in admin.
    - Sort the modules via the setting in the file.
    - One css class controls the whole appearance of the infobox, allowing more design choices for the shop.
    Currently only available for the Responsive version, though it should work in some later 2.3.4 versions.
  7. Like
    Antonio Garcia reacted to tgely in Who in the EU has heard of GDPR and will it affect you   
    Consent Cookies Managment are testing now so this could be used later in the official core. I have tried as close as possible to oscTemplate class and later this could be pull into oscTemplate.

    What core changes need?
    Cookie sensitive modules need a built in public array variable where defined the cookie consent group and apply the settings from oscConsent cookie and module have to use cookie managment logic oscTemplate class rebuild for cookie managments (next step now I use cooki_consent separated class) The best would be one footer modal module for user settings or cookie consent managment user page. Introduce oscConsent cookie  
    All modules could listing on consent setting page as Strict, Functional and 3.parties when cookie consent group variable is declared in self class body

    Functional cookies in generally from javascripts or 3. parties cookies deleted automatically when user switch off them so this will be GDPR complaint.
    If you have non cookie consent logic follow modules then you could change it later as developer implements this logic but this is not a big work.

    I will push cookie consent introduce commit at this weekend and we will be able to discuss oscTemplate implementations on next week.
  8. Like
    Antonio Garcia reacted to Jack_mcs in Upgrading to the latest version   
    It seems like every other question posted nowadays is about how to upgrade an older version of oscommerce and the op usually references the official version. This post is meant to provide a quick reference for how to convert an older shop to the current, recommended, one.
     
    First, the version that should be used is commonly called the Bootstrap, BS or Responsive version. It can be located here. One should not use the official version. The official version can be installed via the hosts control panel so it is easy to think that is the one to use - it is not.
     
    Since the BS version is not directly compatible with other versions, the following steps will be needed:
    Install the BS version into a new location Convert the database. See this thread for help with that. Install whatever addons the site needs. You need to be sure the addon will work with the BS version. This thread mentions specific ones but there are many others that will work. If in doubt, ask in the support thread for the addon in question. If you intend to use paypal, then install the Paypal App. At this point you should have a working shop. Test it thoroughly, especially the payment and shipping modules, before going live with it.
     
    When you are ready to go live,
    Mark your current shop as down for maintenance ( a simple index.html file is fine for this purpose ). Make a backup of the current shops database and files. Convert the database to the BS version. Replace all of the files with the new shops files. Edit the configure files so they work as the live shop. Remove the blocking page. If everything has gone correctly, the conversion should be complete.
     
  9. Like
    Antonio Garcia got a reaction from raiwa in Addon installer concept   
    Yes, I saw these scripts and also I think that they should be a good starting point.
    All these functions packed in a generic class plus another zip class that handles read/copy, etc may do the work.
    (Guau! How easy is make code whitout write it!)
    In the other hand, I'm a 2.3 hooligan, so in the next osC football match competition I like play with the 2.3 team, with the number 4...
  10. Like
    Antonio Garcia reacted to JcMagpie in Who in the EU has heard of GDPR and will it affect you   
    Wow looks like you have had to do a lot of work to try and comply with this EU GDPR!!! Luckily only 12 months to go for us in the UK :)
    No sorry to be serious its not that different to the UK data protection act. Forgetting all the legal bull* in the document, most in Article 3 of the GDPR, which can be read here:https://gdpr-info.eu/art-3-gdpr/
    For most honest store owners it will make very little difference, All it is asking you to do is be respectful with your customers data! Don't abuses it. Don't spam or email without consent, don't sell on your customers details with out consent, basically don't be sneaky in you business with customers data. Finally if customer asks you to delete any data you hold on them do it.
    Unfortunately the EU has again made a total mess of communicating the intent for this legislation and confusion is the result. Another round of snake oil selling will ensue as consultants and experts tell everyone involved in e-commerce that they need there service or product in order to comply!
    I look forward to the EU trying to take the first US company to court for selling a product to a EU customer and not complying with it :) good luck with that.
  11. Like
    Antonio Garcia reacted to tgely in Who in the EU has heard of GDPR and will it affect you   
    I keep my promise. First is v2.4
    https://github.com/osCommerce/oscommerce2/commit/ad48280d799f1a5fe61928b65dd0b6991d2d7c6f
  12. Like
    Antonio Garcia reacted to Jack_mcs in Addon installer concept   
    piernas - I think this is a good idea if you can figure out a way to get it to reliably work. It's too bad one or two of the posters gave you such a hard time and were so negative about it. There's just no reason for that. 
    I see two main issues with the project:
    1 - Someone referred to an auto-installer addon written a few years ago. I had written one several years before that but it became too difficult to maintain due to all of the possible variations. I told the same thing to the programmer of that addon and, if you read the thread, he ended up having the same problem. Maybe you have figured out a way to make changes to core files when needed from the script but I have my doubts.
    2 - I think for it to work, there would have to be some sort of structure for the addon, like all new files it has are to be in a directory in the addon package named new_files. That is a simple thing but many addon contributors don't do this so for their addons to work with your script, they would have to change their package and upload again. This is the main problem, I think, because creating extra work for developers will probably not accomplish what is needed.
    But for addons that are strictly new module files, this would be a good start. There would have to be a way to mark the addons as modules only, maybe just a simple statement in the package. Your script could then download the addon, search for that text or file and, if found, extract the files and install. Of course, the files would have to be in a defined directory so the script could find them. This would still require the developers to make a change to their addons but it would be a relatively simple change so I think they would be more likely to do it. Many addons require file changes but there are also quite a few that are just uploads and your project would work with those quite well. I think that, over time, the number of addons that are just module uploads will increase so having a basic install for those already in place would help the project.
    If I were coding it, I would create a cron job to read in the addons and create a list of ones ready to install. Then the shop owner would just need to click a download and install button for any he want to install.
    I wish you good luck with it and think you should proceed.  I don't have a lot of time to get involved with coding but I will certainly help if I can.
  13. Like
    Antonio Garcia reacted to piernas in Addon installer concept   
    Now that oscommerce community version allows more an more addons with no core code changes I feel an uploader/installer would make things simpler and also help a lot those newcomers that does not have the knowledge to ftp files.
    We don't have a repository adapted to it, but we could ideate a simple system that allows to upload a zip file by browser, uncomprees it, do some preliminar checks like if the addon is currently installed and is compatible with the system and with copying files/making registry entries when user press "install".
    Been playing with the idea of something like the paypal app updater and came up with this:

    Would like to get feedback from developers about it. It would need, of course, that developers agree with packaging the addons with a certain structure and provide with a file that performs the tasks.
    Do you consider interesting to make a similar system?
     
  14. Like
    Antonio Garcia reacted to Jack_mcs in Minifier - Improve page load times   
    This addon minifies the shops css file. If multiple files are selected, it will combine them all into one file. This can reduce the time
    it takes for the shop to load. Depending upon the size of the css file and how many there are, the page load speed can be reduced by several seconds.
    It works in any oscommerce shop. For the 2.3.4 shops (both official and Responsive versions), the installation just involves uploading files. For older shops, one change may be needed.
  15. Thanks
    Antonio Garcia reacted to piernas in Admin responsive sidebar with bootstrap   
    This is a admin sidebar that replaces the stock menu. It can be expanded or condensed on a column of icons. It also adds bootstrap framework to admin. Hope you enjoy it.
    Please comment here if you have any improvements or find any problem.
    Download: https://apps.oscommerce.com/ebjVY&admin-responsive-sidebar-with-bootstrap


×