Oscommerce Online Merchant v2.3 PDF
Oscommerce Online Merchant v2.3 PDF
Oscommerce Online Merchant v2.3 PDF
4
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 New Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Pre-Installation Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 Installation Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.4 Post-Installation Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3 Catalog (Frontend) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3.1 Template Layout and Header Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.4 Administration Tool (Backend) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4.1 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4.1.1 Administrators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4.1.2 My Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4.1.3 Minimum Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.4.1.4 Maximum Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4.1.5 Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.4.1.6 Customer Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.4.1.7 Shipping & Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.4.1.8 Product Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.4.1.9 Stock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.4.1.10 Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.4.1.11 Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.4.1.12 Email Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
1.4.1.13 Download . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.4.1.14 GZIP Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.4.1.15 Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.4.2 Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.4.2.1 Categories & Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.4.2.2 Product Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.4.2.3 Manufacturers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
1.4.2.4 Reviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.4.2.5 Specials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
1.4.2.6 Products Expected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
1.4.3 Customer Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.4.3.1 Customers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
1.4.3.2 Orders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
1.4.4 Locations & Taxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
1.4.5 Localization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
1.4.5.1 Currencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
1.4.5.2 Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
1.4.5.3 Orders Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
1.4.6 Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
1.4.7 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
1.4.7.1 Database Backup Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
1.4.7.2 Banner Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
1.4.7.3 Cache Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
1.4.7.4 Define Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
1.4.7.5 File Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.4.7.6 Send Email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.4.7.7 Newsletter Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
1.4.7.8 Server Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.4.7.9 Who's Online . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.5 Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.5.1 Tips for Admin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.5.1.1 Tip * Change Product Model Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
1.5.1.2 Tip * Reset the Order ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.5.1.3 Tip * Search Engine Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
1.5.1.4 Tip * Upload Image to Own Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
1.5.2 Tips for Catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.5.2.1 Tip * Add Back Button to product_info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.5.2.2 Tip * Add Cart Contents to Each Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
1.5.2.3 Tip * Add Catagory Horizontal Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.6 Errors & Fixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
1.6.1 Error * 1016 errno 145 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
1.6.2 Error * Cannot Add Header Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
1.6.3 Error * Failed Opening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.6.4 Error * Fatal Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.6.5 Error * Internal Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.6.6 Error * Miss Argument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.6.7 Error * Multiple n Letters In Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
1.6.8 Error * MYI 1016 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
1.6.9 Error * Mysql Access Denied for User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
1.6.10 Error * Mysql Too Many Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
1.6.11 Error * Set Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
1.6.12 Error * SSL - This page contains secure and non secure items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
1.6.13 Error * Write to Config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
1.7 Add-Ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
1.7.1 Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
1.7.1.1 Yubico . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
1.7.1.1.1 YubiKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
1.7.2 Payment Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
1.7.2.1 2Checkout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
1.7.2.1.1 2Checkout Hosted Payment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
1.7.2.2 Authorize.net . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
1.7.2.2.1 Advanced Integration Method (AIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
1.7.2.2.2 Simple Integration Method (SIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
1.7.2.3 ChronoPay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
1.7.2.3.1 ChronoPay Hosted Payment Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
1.7.2.4 ClickandBuy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
1.7.2.4.1 ClickandBuy E-Payment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
1.7.2.5 ipayment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
1.7.2.5.1 ipayment Credit Card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
1.7.2.6 PayPal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
1.7.2.6.1 PayPal Express Checkout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
1.7.2.6.2 PayPal Website Payments Pro (UK) Direct Payments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
1.7.2.6.3 PayPal Website Payments Pro (UK) Express Checkout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
1.7.2.6.4 PayPal Website Payments Pro (US) Direct Payments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
1.7.2.6.5 PayPal Website Payments Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.7.2.7 Sage Pay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
1.7.2.7.1 Sage Pay Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
1.7.2.7.2 Sage Pay Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
1.7.2.7.3 Sage Pay Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
1.7.2.8 WorldPay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
1.7.2.8.1 WorldPay Select Junior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
1.7.3 Shipping Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
1.7.3.1 Flat Rate Shipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
1.7.3.2 Per Item Shipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
1.7.3.3 Table Rate Shipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
1.7.3.4 United State Parcel Service (USPS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
1.7.3.5 Zone Rates Shipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
1.7.4 Order Total . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
1.8 Upgrade Guides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
1.8.1 v2.2 to v2.3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
1.8.1.1 (A) (SEC) Administration Tool Log-In Update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
1.8.1.2 (SQL) (UP) Update Database Field Lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
1.8.1.3 (AC) (COMPAT) Fix Timezone Warning Messages for PHP v5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
1.8.1.4 (AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP v5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
1.8.1.5 (C) (SEC) Add Customer Session Token to Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
1.8.1.6 (C) (BUG) Validate Removal of Customer Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
1.8.1.7 (AC) (BUG) Sanitize Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
1.8.1.8 (A) (UP) Add Support for Basic HTTP Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
1.8.1.9 (C) (UP) Generate a New Shopping Cart ID When Restoring Products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
1.8.1.10 (C) (BUG) Fix Navigation History Session Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
1.8.1.11 (AC) (UP) Improve Validation of E-Mail Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
1.8.1.12 (AC) (UP) Code Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
1.8.1.13 (A) (UP) Update Define Languages Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
1.8.1.14 (C) (BUG) Verify Shopping Cart Product Attribute Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
1.8.1.15 (AC) (UP) Remove PHP3 Compatibility Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
1.8.1.16 (AC) (UP) Improve IP Address Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
1.8.1.17 (A) (BUG) Don't Show Empty Menu Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
1.8.1.18 (AC) (UP) Add htaccess Protection to the Images Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
1.8.1.19 (C) (UP) Optimize Tax Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
1.8.1.20 (AC) (UP) Improve Force Cookie Usage in Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
1.8.1.21 (A) (BUG) Fix Automatic Removal of Manufacturer Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
1.8.1.22 (A) (UP) Add API Version Tag to Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
1.8.1.23 (C) (UP) Hide Currencies and Languages Info Boxes for Single Currencies and Languages . . . . . . . . . . . . . . . 209
1.8.1.24 (A) (UP) Hide Language Selection if Only One Language is Installed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
1.8.1.25 (C) (BUG) Fix Retrieval of Special Product Prices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
1.8.1.26 (A) (BUG) Fix HTML E-Mails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
1.8.1.27 (A) (BUG) Improve Saving of Module Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
1.8.1.28 (AC) (UP) Add Pre-Populated List of Currencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
1.8.1.29 (A) (SQL) (NEW) Introduce Security Directory Permissions Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
1.8.1.30 (AC) (SQL) (NEW) Introduce Action Recorder Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
1.8.1.31 (AC) (UP) Cleanup Language Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
1.8.1.32 (AC) (NEW) Move Installation Checks to New Security Checks Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
1.8.1.33 (A) (UP) Introduce Windows Compatible is_writable() Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
1.8.1.34 (A) (UP) Bypass HTTP Authentication for IIS Webservers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
1.8.1.35 (AC) (UP) Update PHP_SELF Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
1.8.1.36 (A) (NEW) Introduce Easy Store Logo Uploader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
1.8.1.37 (AC) (SQL) (UP) Update Password Hashing to Phpass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
1.8.1.38 (C) (BUG) Fix Length Check of Customer Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
1.8.1.39 (C) (BUG) Fix Notice When Products Without Attributes are Added to the Shopping Cart . . . . . . . . . . . . . . . . . 251
1.8.1.40 (C) (BUG) Verify Languages Currency Exists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
1.8.1.41 (C) (BUG) Allow Quoted Words to be Searched . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
1.8.2 v2.3.0 to v2.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
1.8.2.1 (C) (UP) Confirm New Product Reviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
1.8.2.2 (C) (A) (BUG) Fix a PHP Notice in Phpass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
1.8.2.3 (C) (BUG) Fix Reviews Box Language Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
1.8.2.4 (A) (BUG) Fix Pre-Defined Australian Dollar Currency Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
1.8.2.5 (A) (UP) Label the HTML Content field for Large Product Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
1.8.2.6 (C) (UP) XHTML Fixes for Popup Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
1.8.2.7 (C) (UP) Update Version to v2.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
osCommerce Online Merchant v2.3
Copyright
Copyright (c) 2006-2010 osCommerce. All rights reserved. http://www.oscommerce.com
Authors
Harald Ponce de Leon
John Fitchett
Melinda Odom
Table of Contents
Introduction
New Installation
Catalog (Frontend)
Administration Tool (Backend)
Tips
Errors & Fixes
Add-Ons
Upgrade Guides
Introduction
Introduction
osCommerce Online Merchant is a free online shop e-commerce solution under continuous development by the open source community. Its
core features allows store owners to setup, run, and maintain their online stores with absolutely no software costs or license fees involved,
and with no programming or technical knowledge needed.
The success of osCommerce Online Merchant is secured by a dedicated team that focuses on the core features, and by an active
community of store owners and developers that focus on additional features. To date, the community has provided over 5,000 add-ons that
are available for free, that extend on the core features of osCommerce Online Merchant to meet the needs of individual store owners.
osCommerce Online Merchant is built with the powerful PHP web scriping language and uses the fast MySQL database server for the online
store data. The combination of PHP and MySQL allows osCommerce Online Merchant to run on any webserver environment that supports
PHP and MySQL, which includes Linux, Solaris, BSD, Mac OS X, and Microsoft Windows environments.
osCommerce was started in March 2000 and has since matured to a solution that is powering many thousands of live shops around the
world.
New Installation
New Installation
Requirements
Pre-Installation Steps
Installation Procedure
Post-Installation Steps
Requirements
Requirements
osCommerce Online Merchant can be installed on any PHP enabled web server that can connect to a MySQL database. This includes
shared servers, dedicated servers, and local installations running on Linux, Unix, BSD, Mac OS X, and Microsoft Windows operating
systems.
Web Server
PHP
MySQL Database Server
Web Server
The web server must support PHP either as a module or allow execution of CGI scripts. For performance reasons FastCGI is recommended
over CGI.
PHP
osCommerce Online Merchant is compatible with PHP 4 and PHP 5. For performance and security reasons it is recommended to use the
latest PHP 5 version on the web server.
The following PHP options are recommended to be set in the php.ini configuration file:
register_globals Off
magic_quotes_gpc Off
file_uploads On
session.auto_start Off
session.use_trans_sid Off
Pre-Installation Steps
Pre-Installation Steps
osCommerce Online Merchant is a web based solution that needs its relevant files to exist on the web server. The files can be copied to the
web server by extracting the download package on your computer and uploading its contents to the web server via FTP, or by copying the
download package to the web server directly and extracting its contents there.
/home/shinyredapples/public_html/
/srv/www/htdocs/
/usr/local/htdocs/
/var/www/vhosts/shinyredapples.com/httpdocs/
catalog (directory)
CHANGELOG
community_docs.pdf
documentation.pdf
extras (directory)
LICENSE
STANDARD
upgrade.html
Using FTP to Copy the Download Package Contents to the Web Server
The download package of osCommerce Online Merchant should be saved and extracted on your computer to reveal its contents. The
catalog directory must be copied to the public HTML directory on the web server.
This can be achieved on most FTP clients by dragging the catalog directory from your local file browser panel to the remote panel listing the
files on the web server.
All PHP files must be uploaded in ASCII mode (not in Binary mode).
The download package of osCommerce Online Merchant should be saved and extracted on the web server to reveal its contents. The
catalog directory must be copied to the public HTML directory.
cp -R catalog /path/to/public/html/directory/
File Permissions
The following files need to be writable by the web server.
catalog/includes/configure.php
catalog/admin/includes/configure.php
The catalog/includes/configure.php and catalog/admin/includes/configure.php files must have their web server writable
permission removed after the installation procedure has completed successfully. This is described in the Post-Installation
Steps chapter.
Please consult with your hosting provider for the correct permission flag to allow the web server to write to those files. This is commonly
defined with a permission flag of 755.
In some cases a world write permission flag of 777 can be used but may lead to an insecure installation of osCommerce
Online Merchant.
Changing the file permissions can be performed by most FTP clients or directly on the web server.
Most FTP clients are capable of changing file permissions on the web server. This is commonly performed by right-clicking on the file and
selecting "Properties" or "Attributes" on the context menu.
The file permissions can be changed by allowing all users to read, write, and execute the file, or by manually entering the world readable and
world writable flag of 777.
Changing File Permissions Directly on the Server
Changing file permissions directly on the web server can be performed with the following terminal command:
Database
A MySQL database on the web server or database server is required for the installation procedure to successfully import the database table
structure and required data settings.
Root Directory The directory where the online store is installed on the web server. /home/shinyredapples/public_html/catalog/
Server Address The address of the database server in the form of a hostname or IP address. localhost
Password The password that is used together with the username to connect to the database server. securepassword
Database Name The name of the database to hold the data in. oscommerce
Installation Procedure
Installation Procedure
The web based installation procedure configures the online store and imports the configuration data into the database. This is necessary to
create a fully functional online store and to create an administrator that administrates the online store through the Administration Tool.
The configuration values provided by default are safe to use but may need to be changed depending on the environment of the web server.
Please review the Pre-Installation Steps chapter before continuing with the installation procedure.
For example:
http://www.shinyredapples.com/catalog/
osCommerce Online Merchant automatically detects if the installation has already been completed and redirects to the installation procedure
if it has not yet been performed.
Step 1: Welcome Page
The first step is the welcome page shown in Figure 1 which displays the current recommended configuration settings for PHP.
It is recommended to update a PHP configuration value, or to install and activate a PHP extension, if it is marked against the recommended
setting.
When making PHP configuration changes or when installing and activating a PHP extension, the web server service needs
to be restarted for the changes to take effect. Once restarted, refreshing the welcome installation page and viewing the
Server Capabilities listing can confirm if the PHP configuration changes have taken place and if it meets the recommended
settings.
The installation procedure verifies the values entered before proceeding to the next step. If there is a problem connecting to the database
server an error message is shown similar to the message shown in Figure 2b.
Check to make sure the correct username, password, and database name are listed.
It is important to keep note of the administrator username and password as these are used to login and to access the Administration Tool.
Additional administrators can be created in the Administration Tool after the installation procedure has been successfully
completed.
Step 5: Finished!
The last step in the installation procedure stores the database server and web server parameters to the configuration file on the web server.
On successfully saving the configuration file, the installation procedure is finalized and the online store is ready to be used as shown on
Figure 5.
Figure 5. Successful Installation Confirmation
Please review the Post-Installation Steps chapter after the installation procedure has been successfully completed to
secure the online store.
Post-Installation Steps
Post-Installation Steps
Upon successful installation of osCommerce Online Merchant, the following steps need to be performed to secure the installation of the
online store.
Configuration Files
The file permissions on catalog/includes/configure.php and catalog/admin/includes/configure.php must be set to deny write access by the
web server service. This is commonly performed by setting the permission flag to a read only value of 644 or 444 depending on your server.
Writable Directories
The following directories must be set to allow the web server service to write to for the Administration Tool to function properly. This is
commonly performed by setting the permission flags to a world-writable value of 777.
catalog/images
catalog/cache (create this folder)
catalog/admin/backups
catalog/admin/images/graphs
If no extra protection is set for the Administration Tool, it is recommended to move the catalog/admin/backups directory
outside the public html directory otherwise public access to the backup files would be possible. The location of the backup
directory must be correctly defined in catalog/includes/configure.php.
Catalog (Frontend)
Catalog (Frontend)
Template Layout and Header Tags
The template design layout is defined in catalog/includes/template_top.php and catalog/includes/template_bottom.php, with the page content
existing in the base catalog files.
The outside structure of the design layout is specified in catalog/includes/template_top.php and catalog/includes/template_bottom.php,
which, for compatibility to earlier osCommerce Online Merchant v2.2 releases, also utilizes catalog/includes/header.php,
catalog/includes/footer.php, catalog/includes/column_left.php, and catalog/includes/column_right.php.
catalog/includes/template_top.php
HTML doctype
Header/Meta tags
Page header (catalog/includes/header.php)
Page left column (catalog/includes/column_left.php)
catalog/includes/template_bottom.php
Page right column (catalog/includes/column_right.php)
Page footer (catalog/includes/footer.php)
Header and Meta Tag Modules
As all base catalog files use the same catalog/includes/template_top.php file to define the HTML doctype, page title, and header tags, a
modular header and meta tags implementation complements the template layout structure that allows page specific modules to define the
page title and set additional header and meta tags.
The header and meta tag modules are located in catalog/includes/modules/header_tags inside sub-directories matching the name of the
base catalog file (without the file extension), and are loaded in alphabetical order.
An example header and meta tag module is catalog/includes/modules/header_tags/product_info/title.php which adds the product name to the
page title on the product information page.
If the base catalog file name is changed, the matching header and meta tag module sub-directory must also be renamed
otherwise the modules will no longer load together with the page.
The header and meta tag modules must follow the following format:
<?php
class ht_productInfo_title {
function parse() {
global $oscTemplate;
ht_productInfo_title
ht Short code for "Header Tag" to distinguish header and meta tag modules from other modules.
productInfo The name of the matching base catalog file in camel case form (without the file extension).
catalog/includes/modules/header_tags/create_account/module_name.php ht_createAccount_module_name
catalog/includes/modules/header_tags/index/module_name.php ht_index_module_name
catalog/includes/modules/header_tags/products_new/module_name.php ht_productsNew_module_name
The module must contain a static parse() method which contains the main code for the module, and must define $oscTemplate as a global
variable to alter the header and meta tags for the page.
The oscTemplate class provides the following three methods to alter the tags for the page:
getTitle
Returns the current title of the page. By default the page title is defined by the TITLE language definition which is the name of the online
shop.
$title = $oscTemplate->getTitle();
setTitle
New modules can be installed by copying the module files to the appropriate sub-directories in catalog/includes/modules/header_tags for the
page they should be loaded for.
The modular implementation allows page specific header and meta tags to be altered without needing to edit core source code files.
Configuration
Catalog
Customer Section
Locations & Taxes
Localization
Reports
Tools
Configuration
Configuration
The Configuration section will setup all the basic store configuration. To access the configuration section click on "Configuration" and a drop
down of text links will appear underneath. Clicking the "Configuration" link puts you on the "My Store" page. To edit any of these listings in
the center of the page click the "i" with the circle around it of each listing to highlight it and click on the "edit" button to the right.
Administrators
My Store
Minimum Values
Maximum Values
Images
Customer Details
Shipping & Packaging
Product Listing
Stock
Logging
Cache
Email Options
Download
GZIP Compression
Sessions
Administrators
Administrators
The store administrators login information was setup during installation of the store.
After you login with that information you can edit the username and password and add additional administrators.
My Store
My Store
My Store lists general information values for the store owner.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Store Name
Store Owner
E-Mail Address
E-Mail From
Country
Zone
Expected Sort Order
Expected Sort Field
Switch To Default Language Currency
Send Extra Order Email to
Use Search-Engine Safe URLs
Display Cart After Adding Product
Allow Guest to Tell a Friend
Default Search Operator
Store Address and Phone
Show Category Counts
Tax Decimal Places
Display Prices with Tax
Figure 1 shows the My Store listing page under Admin -> Configuration -> My Store
Figure 1. My Store listing page under Admin > Configuration > My Store
Store Name
The name of your store that works in conjunction with the search engines. A 15-20 word sentence using some keywords is good.
Store Owner
The store owner's name, or can also be the name of the store. This value will be in the "from" field of any email that is sent from the website
when sent, such as one that is sent to the customer after purchasing.
E-Mail Address
The store general email address used for receiving. This will be the destination for any emails sent through the website, such as through the
feedback from or notification emails sent by the website as notification of new orders. This should be a SINGLE email address only.
E-Mail From
The email in the "from" field of any email that is sent from the website. It can be the same address as 'E-Mail Address'. This should be a
SINGLE email address only.
Country
Zone
The state or zone of residence for the store. This is necessary to enter, as it is used in any tax or shipping cost calculations.
When you setup a new product in the "Catalog" section of your store you can set a "Date Available:" for your product which is the "expected
sort order" in the expected products box. This value is ordered either ascending or descending order. A listing of all the "products expected"
is under "Catalog/Products Expected" in your store admin.
The "expected sort field" is the column listings to sort by in the expected products box either by the "product name" or the "date expected".
If you have several currencies it will automatically switch currencies when the language is changed.
The email address where you will receive orders. There can be several email addresses here for backups in this format: Name 1
<email@address1>, Name 2 <email@address2>. If the store owner's email is not in this listing the store owner will not be notified of an
order. Whereas the 'E-Mail Address' above is for only one entry, this is how to effectively add addresses to that function.
If set to "true" the shopping cart page will show when a product is put in the cart. The customer then must click on "continue" to go back to
their product page to continue shopping. The customer will also see their items in the shopping cart box.
If this is set to "false" then the customer will stay on the same page of the item they are putting in the cart and will be able to see their items
in the shopping cart box in the top right column box of your store. Customized stores may or may not have this feature.
Enables a box for the customer, when shopping, to send an email about a specific product after accessing the product description area.
The name of the store owner's store, phone, and other information that will be seen by the customer when they use check/money order to
checkout.
Set to "true" to show the counts of products in each main category folder.
Set to "false" if you do not want to show the number of products in each main category folder. A small arrow to the right of the folder will still
show.
Pad the tax value this amount of decimal places. For example, if the cost of tax was $2, this would display as $2.00
Set to "true" the prices will display including tax on the shopping cart before checking out and also shows the tax on the confirmation
checkout page not adding the tax again to the product total. If this setting is used then you need to set the "Display Tax" to "false" under
"Modules/Order Total" section.
Set to "false" the product prices will not display with tax and the tax will display on the confirmation checkout page adding the tax to the
product total.
Minimum Values
Minimum Values
The values set for Minimum values are any fields filled out by the store owner that will affect the minimum amount of text for the credit card
owner, credit card number, review text, best sellers, and the minimum number of products a customer has purchased.
The minimum values are any field that is filled out by the customer. Usually these are left as is but they can be changed if desired.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Minimum Values listing page under Admin -> Configuration -> Minimum Values
Figure 1. Minimum Values listing page under Admin -> Configuration -> Minimum Values
Maximum Values
Maximum Values
The Maximum Values are the values for the different module listings in the store.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 2 shows the Maximum Values listing page under Admin -> Configuration -> Maximum Values
Figure 2. Maximum Values listing page under Admin -> Configuration -> Maximum Values
Most of these are self-explanatory. There are just a few that sometimes can be confusing.
Search Results
Number of products listed on the store product pages per page. This listing is also used for the admin searches.
Page Links
Navigation numbers at the bottom of the product listing before going to dots (ex: 5 ...).
Order History
Images
Images
The settings for all the image sizes in the store are listed and editable.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Images listing page under Admin -> Configuration -> Images
Figure 1. Images listing page under Admin -> Configuration -> Images
The "Small Image Width & Height" are the image sizes of the product thumbnails on the product listing page.
The "Heading Image Width & Height" are the image sizes that are uploaded for each category folder that show in the upper right corner of
the text body after clicking on a category folder in your store.
The "Subcategory Image Width & Height" are the image sizes for all subcategory folders listed in the text body after clicking on a
subcategory folder.
Image Required
Image Required set to true will list all images in the store even if an image shows blank because of misnaming. Set to false all the images
that are valid will show and the blank ones because of misnaming will not show.
Note: If the images are going to be all different sizes a tip is to totally remove all the "width" measurements. Do not put a
"0" in the space, instead totally remove it and leave a blank space for the "width only" measurement. If left blank,
osCommerce will resize the images according to the "height" measurement and constrain the image so there is no
distortion.
Customer Details
Customer Details
Customer detail values are the values entered when a customer creates a new account. These can be turned off or on at the store owner's
discretion. Some listings (such as Newsletter) can only be set to on or off only, and some listings (such as Gender) are set to required or not
required, and other listings give the option of a Minimum number of letters required for that listing.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Customer Details listing page under Admin -> Configuration -> Customer Details
Figure 1. Customer Details listing page under Admin -> Configuration -> Customer Details
The minimum set of fields that can be required to create an account are:
First Name
Last Name
E-Mail Address
Password
Post Code
State
Shipping & Packaging
Country of Origin
Postal Code
Enter Maximum Package Weight You Will Ship
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Shipping/Packaging listing page under Admin -> Configuration -> Shipping/Packaging
Figure 1. Shipping/Packaging listing page under Admin -> Configuration -> Shipping/Packaging
Country of Origin
Postal Code
Put your maximum weight here of a package you will ship, anything over this the packaging will be calculated as multiple smaller parcels.
Two values that are next in the list are used for the calculation of the number of packages: "Package Tare weight" (initially set at 3 weight
units) and "Larger packages - percentage increase" (standard set at 10%).
The shipping module estimates the weight of the packing material as whichever is larger: the fixed Tare weight ("Tare" comes from Arabic for
"throw-away"), or the percentage of the product weight. This overhead weight is added to the weight of the products when computing
postage.
For example, say Tare weight = 3 and Percentage = 10. Then a 1-pound package gets 4 pounds worth of postage (the fixed Tare weight is
larger). And 100 pounds of product gets 110 pounds worth of postage (the variable percentage is larger).
Product Listing
Product Listing
The Product Listing section is edited to list the various columns available for the product listings in the store. The columns are sorted from left
to right on the product listing page according to the "Value" that is set for each one in this section. If a value of "0" is set that column will be
turned completely off on the product listing page of the store.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Product Listing page under Admin -> Configuration -> Product Listing
Figure 1. Product Listing page under Admin -> Configuration -> Product Listing
Location of Prev/Next Navigation Bar sets the location of the Prev/Next Navigation Bar, either top, bottom, or both.
The number of products listed on each product listing page in your store is set in Configuration -> Maximum Values -> Search Results.
If you are looking for a horizontal presentation of the products on the product listing page instead of the default vertical presentation please
look at:
Additional Contribution
Product Listing in Columns
Stock
Stock
Stock is a complete inventory control allowing the store owner to keep track of all inventory by setting a quantity available for each product.
NOTE: To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Stock listing page under Admin -> Configuration -> Stock
Figure 1. Stock listing page under Admin -> Configuration -> Stock
Set Stock level and Subtract Stock to true and the ecommerce software will check your stock and substract from the product stock value you
have set on each product if used when items are purchased.
Allow Checkout
Allow Checkout allows customer to checkout even though your stock level is too low for a particular product.
Mark Product out of Stock is a symbol you can use to mark a product on the checkout page when it is out of stock. The default osCommerce
store uses asterisks ***.
Stock Re-order Level
An amount is entered to define when stock needs to be reordered ... for the store owner's information only.
Logging
Logging
Set Logging features.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Logging page under Admin -> Configuration -> Logging
Cache
Cache
The cache control allows the store owner to save certain areas of the shopping cart to a cache folder. This allows for a performance increase
when users are browsing the store as the database is not queried again until the cache has expired or has been reset by the store owner.
The default value of using cache is "false". When you set it to true but the directory that is set under "Cache Directory" is not available you
get a pink error message at the top of the store screen like this when you go to Tools->Cache
Error: Cache directory does not exist. Please set this in Configuration -> Cache.
Leaving the default /tmp/ might work but when you are on a shared server other osC shops on the server might also write their cache to this
folder. The risk is that the catalog menu of another shop might be shown in yours!
Therefore you are better off creating a subdirectory folder named (for example) "cache" in the "catalog" folder or directly in your root folder
with your store files. Set the chmod permissions to 755 (the webserver should be able to write to this folder) or to 777 in some instances. You
can use an FTP program to change the permissions.
Click on Cache Directory and set the absolute directory path to the "cache" folder.
If there is any question or problem establishing the absolute path, it may be because of server redirects. Go to Tools/Database Backup and
see what path is listed by the Admin for the database 'backups' folder. Use that path and append 'catalog/cache/' to the end of it so that your
path might appear as:
/home/username/www/catalog/cache/
Pay close attention to case sensitivity so that the directory path exactly matches the "cache" folder created in FTP.
Go back to Tools/Cache Control, refresh if necessary, and the error message should be gone.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Cache page in Admin -> Configuration -> Cache
It is recommended that the cache directory is NOT in the same place for all stores hosted on the same server for security
reasons.
Blocks of cached pages from different store areas are shown in the admin under Tools/Cache Control. The cached pages can be deleted by
clicking the reset button under the "action" column which will remove the cached pages. These pages will be replaced automatically when
accessed again.
Email Options
Email Options
There are a number of configuration options available to control how the emails are sent to the customer. These have already been set when
installed. Only change if you have an understanding or email functions. The information below is for general understanding.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the E-Mail Options listing page under Admin -> Configuration -> E-Mail Options
Figure 1. E-Mail Options listing page under Admin -> Configuration -> E-Mail Options
osCommerce is able to send emails containing HTML to the customer. Sendmail is a unix method of sending mails and smtp is used mostly
on windows/mac servers. If the webserver is a windows server use smtp and if the webserver is unix based then use sendmail.
Sendmail
To ensure the correct functioning of the emails to be sent to the customers the following settings need to be set.
SMTP
An SMTP mail server is most commonly used when hosting websites on Windows based servers.
To ensure the correct functioning of the emails to be sent to the customers the following settings need to be set.
E-Mail Transport Method = SMTP
E-Mail Linefeeds = CRLF
E-mail Linefeeds
Email Linefeeds defines the character sequence used to separate mail headers. Unix/Linux uses LF alone to separate lines (new line
character) but Windows uses a combination of CR & LF ( CRLF Line feed).
Set to LF if you are on a Unix/Linux server and set to CRLF if you are on a Windows server.
Sending MIME type determines the content of mail like txt/html, txt/xml, etc. Set to true for HTML emails and false for pure text emails.
osCommerce is able to verify email addresses by contacting the name server for a domain to ensure that it is setup to receive emails. This
gives a good check to ensure invalid email addresses cant be entered.
Since all the email addresses contain the domain name (@domain.com), the existence of the domain name can be verified to make sure to
some extent that the email id given by the user is valid. This is done through 'nslookup' command; however, this may not work on windows
so keep it false on windows based servers.
Some hosting companies disable this feature. If you are having problems when creating customer accounts set this option
to False.
Send Emails
It is possible to disable the sending out of all emails to the customer. This is useful during the development and testing phases.
Set to true to send emails to the customer when they register or checkout after purchasing and set to false to disable the sending of emails to
customers.
Download
Download
The "Download Section" needs to be enabled if you are going to allow customers to download products directly after purchasing from your
store ... examples are ebooks.
These downloadable products should be zipped up and uploaded to the "catalog/download" folder of your store. This is accomplished via
FTP or your server administration from your hosting company. It is best to use lower case letters to name your files.
Make sure /catalog/pub has permissions of 777 (chmod 777) and /catalog/download has permissions of 755 (chmod 755).
Setup Downloads
Enable Download
Download by Redirect
Expiry Delay (Days)
Maximum Number of Downloads
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Download listing page under Admin -> Configuration -> Download
Figure 1. Download listing page under Admin -> Configuration -> Download
Setup Downloads
1. Under configuration in the admin set up the downloads by turning on "Enable download" and "Download by redirect". Click each listing to
highlight and click the "edit" button.
Enable Download
Download by Redirect
How many days the download will be available for before being deleted.
Maximum number of times the customer will be able to download the file before they are locked out.
2. Add the product in the admin under "catalog -> categories/products" into your category folder.
3. After you have added the product go to "Catalog -> Product Attributes" in the admin.
4. Choose the product in the center bottom "Product Attributes" box of this section.
When you have download enabled in the configuration section of your store a downloadable product can be added in the bottom center of
the "Catalog/Product Attributes" section. When putting a product in as a downloadable one you have the option to change how many
downloads and how many days a customer has to retrieve their downloads. When you list the zip file to be downloaded for that product be
sure the name is exactly like the name of the download in the downloads folder as it is "case sensitive".
GZIP Compression
GZIP Compression
When GZIP Compression is set to true each page that is accessed over the Internet is first completely constructed by the server and then
compressed using gzip before sending it to the browser (when the browser supports this, otherwise it will not be gzip'ed before sending).
Normal setting is 5. It helps customers on slow connections (remember that images are already compressed using gif or jpg, only the HTML
is compressed) but is an extra load to the server.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the GZip page under Admin -> Configuration -> GZip Compression
Figure 1. GZip page under Admin -> Configuration -> GZip Compression
Sessions
Sessions
A session is a unique number assigned to a client (visitor). The unique number is also used as a filename in /tmp
Because the client has the number on his URL (or in a cookie) you can keep track of what he/she wants /does by writing data to the session
file. That data is also available in your scripts.
So in order for your sessions to work (file based) the php script (which is ran by the webserver) needs write access to a directory (like /tmp).
If this directory lives WITHIN your document root (remotely accessible by a browser) it is a security threat as people can actually read other
peoples' session files in their browser.
Consider this:
http://www.yoursite.com/sessions/
If you had directory listings on I would get a nice list of all current sessions on your site on that moment. If I would click one it would show me
the contents and if I would copy it and use it as my own session I could impersonate that specific user... (session hijacking)
If it lives OUTSIDE the doc root you can not reach it from the outside world. The webserver itself can.
So find out who your webserver runs as (linux is usually nobody from group nobody) and change ownership (chown) of the dir to that. Next
you chmod it 700 which makes it only accessible to that user/group.
It is up to you where you want to store your sessions, mysql or files. The mySQL option is offered for shared hosting accounts where loads of
people use the /tmp directory making the chance of session hijacking or session mistakes bigger.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Sessions page under Admin -> Configuration -> Sessions
You should set the configuration value for "Prevent Spider Sessions" to true. In the directory catalog/includes/ there is a file named spiders.txt
file which contains a list of search engine spiders and if "Prevent spider sessions" is set to true then those spiders are not allowed to create
session ids. This file is not up-to-date. There is a contribution called "Updated spiders.txt".
Additional Contribution
http://addons.oscommerce.com/info/2455
If you leave "Prevent Spider Sessions" on "false" your site will be indexed by search engines with links that contain session ids. People who
click on them arrive at your website with the same session id. If one person is already logged in and the new visitor arrives with the same
session id then there is crossover between their accounts, their carts etc.
If your site has SSL you can also set "Recreate session id" to true to force updating of session ids when people switch to ssl.
Customers on aol cannot use your store with these all set to "True". The only two that can be set to "True" for aol users are
"Force Cookie Use" and "Prevent Spider Sessions".
Catalog
Catalog
The "Catalog Section" is for adding main category listings, products, product attributes, manufacturers, and other functions necessary for a
well running eCommerce store.
All products must be in a catalog -> category folder to be viewable in the osCommerce store.
Figure 1 shows the Category listing page under Admin -> Catalog -> Categories & Products
Figure 1. Category listing page under Admin -> Catalog -> Categories & Products
To edit any of the listings click the "i" with the circle around it on the line you want to edit and when that
listing is highlighted, click the "edit", "delete", or "move" button to the right of that listing.
After you have made a new folder or product it will show on the main screen which is called "Top" which is the name in the drop-down box to
the upper right of the admin page. This drop-down box will eventually list all the folders in your store.
Each category folder is sorted alphabetically unless you attach a sort order to it. To attach a sort order to a category folder put a number in
the "sort order" box when making the folder. If you want to change or remove the sort order later, click the "i" with the circle around it to the
right of the folder you want to change to highlight it and then click the "edit", "delete", or "move" buttons.
Be aware that if you have products in a folder and you click the "delete" button all of the products in that folder will also be deleted. Clicking
the "edit" button will edit the category folder itself and clicking the "move" button and choosing a new place for the category folder in the drop
down box will move the entire folder with all products in it to another place.
To get inside the category folder to add products click the "yellow folder" to the left of the category folder name. This puts you inside the
category folder.
Figure 2 shows the Categories Edit listing page under Admin -> Catalog -> Categories -> Edit
Figure 2. Categories New Categories listing page under Admin -> Catalog -> Categories -> Edit
Category Name
The Category Name is limited to 32 characters which needs to be adhered to as the number of characters will effect the width of the left
column if increased too high. The characters can be increased in the categories_description database table in phpMyAdmin. If you have
other languages installed you would set a category name for all languages.
Category Image
A Category Image can be uploaded for that particular Category. The image size is set in the Configuration -> Images and is called the
Subcategory Image. This image will show to the customer in the upper right corner of the body after clicking on the category.
Sort Order
The "Sort Order" is set by a number. If a sort order is left blank, the category folders will sort alphabetically.
Move a Category Folder
After a Category has been created it may be necessary to move it to another Category Folder.
Figure 3 shows the Categories Move listing page under Admin -> Catalog -> Categories -> Move
Figure 3. Categories Move listing page under Admin -> Catalog -> Categories -> Move
To move a Category, click the "i" with the circle around it to highlight the Category you want to move and click the "move"
button to the right of that listing. The next page text reads "Please select which category you wish "your main category
folder" to reside in." Choose a new location for the Category folder in the drop down menu and click "move".
Figure 4 shows the Category Delete listing page under Admin -> Catalog -> Categories -> Delete
Figure 4. Category Delete listing page under Admin -> Catalog -> Categories -> Delete
To delete a Category, click the "i" with the circle around it to highlight the Category you want to delete and click the "delete" button to the right
of that listing. The next page gives warnings about deleting a category.
Be aware that if you have products in a folder and you click the "delete" button all of the products in that folder will also be deleted. Clicking
the "edit" button will edit the category folder itself and clicking the "move" button and choosing a new place for the category folder in the
dropdown box will move the entire folder with all products in it to another place.
Clicking on the "new product" button will create a new product. This screen shot will show the Ajax Attribute Manager and the WYSIWYG
Editor contributions if they are installed.
Figure 5 shows the Product page under Admin -> Catalog -> Categories & Products -> New Product
Figure 5. Category listing page under Admin -> Catalog -> Categories & Products -> New Product
When you are creating a new product you have the ability to:
show the product in or out of stock ... "in" or "turned on" will show a green dot highlighted in the "status" column of the product
listings and "out" or "turned off" will show a red highlighted dot in the "status" column of the product listings
set the date the product will be available which corresponds with the "Products Expected" module
set the product's name and description (if using different languages an editing box will be available for each language to be
translated)
set the product's quantity in stock (this corresponds with the "Configuration -> Stock" section, product's model number
upload the products's image
set the tax class which is used to charge tax on each product
set products weight which, if you are using "weight" for your shipping schedule under "Modules/Shipping", each product will need to
have a weight listed
Note: The tax class must be setup first in the "Locations/Taxes" section in your store admin.
The ajax attribute manager is an easy way to add and assign attributes when adding your products. When you add a product to the store in
the product description area you can assign attributes to it which is an easier way to add them than using the Product Attributes as indicated
below. The more recent Ajax Attribute Manager will add downloadable products in the product description area.
To delete a new product, click the "i" with the circle around it to highlight the product you want to delete and click the "delete" button on the
right. This will completely remove the product from your store database. If you want to keep the product in the store database to show at a
later time it is best to click the "red circle under the Status column" which just turns the product off in your store but leaves it in the database.
To move a new product, click the "i" with the circle around it to highlight the product you want to move and click the "move" button on the
right. This works the same as moving a main category folder.
When you click the "move" button you will see this message:
"Move (name of product) to:". Choose a place to move it and click the "move" button.
To copy a new product, click the "i" with the circle around it to highlight the product you want to copy and click the "copy to" button on the
right. When you click the "copy to" button you will see this message:
Copy Method:
-Link product
-Duplicate product
Choose "Link product" if you want to link it only as one product that shows in your store but the product can be added to as many category
folders as you want.
Click "Duplicate product" if you want to add another separate product ... an example would be if you have a product with the same
description but a different name, picture, and price. Note that if you duplicate a product it's status will be set to "off" at first until you click the
green status icon that sets it to true ... on.
Product Attributes
Product Attributes
Attributes give the store owner an additional way to market products. For example, shirts are sold of different sizes and different colors. Sizes
and Colors are considered attributes. Product Attributes must be set up individually for each product. They are a great way to offer mutliple
options to a customer without needing to create many separate but similar products to choose from.
It is always best to setup as many of your attributes using this section as possible before adding your products.
Figure 1 shows the Categories listing page under Admin -> Catalog -> Product Attributes
Figure 1. Product Attributes listing page under Admin -> Catalog -> Product Attributes
Product Attributes
First, you would setup the "Option Name" (under "Product Options" at the top left). Using shirts as an example you would have at least 2
"Option Names", color and size.
Next, you will setup your "Option Values" (under "Option Values" at the top right). In this section you will see a box that shows the "Option
Names" that you have already setup. You have color setup as an "Option Name" so make sure color is in this box. Then, to the right of that
box is a blank box where you type in one of your colors. Do this for each color and then do this again for each size. Make sure you associate
and "Option Value" (red, white, blue) with an "Option Name" (color, size, etc.).
Under the "Products Attributes" section at the bottom you will see a drop down box listing all of your products that you have already put into
your store. Choose a product in the drop down menu and add your attributes. A price either increased or decreased from the "base" price of
the product can be set by putting an amount in the "Value Price" box and choosing a "plus" or a "minus" sign in the "Price Prefix" drop down
menu. If the price stays the same on each attribute then leave the "Value Price" box blank.
For Example:
size = medium = 10.00 (this is the regular price so no need to put a price in the "price box"
size = small = 8.00 (put 2.00 - (this is $2 with a "minus" sign from the base price of $10.00)
size = large = 12.00 (put 2.00 + (this is $2 with a "plus" sign from the base price of $10.00)
The bottom "Products Attributes" section is the area to setup any downloadable products like eBooks, etc.
Using the AJAX Attribute Manager check the boxes of the attributes you want to use for a particular product. A price either increased or
decreased from the "base" price of the product can be set by putting an amount in the "Value Price" box and choosing a "plus " or a
"minus in the "Price Prefix" drop down menu. If the price stays the same on each attribute then leave the "Value Price" box blank.
Manufacturers
Manufacturers
Manufacturer's Edits
Manufacturer's Name
Manufacturer's Image
Manufacturer's URL
Delete Manufacturer
A list of manufacturers can be added to the store, and which product was made by which manufacturer can also be set. This allows the
customer to search by manufacturers when shopping.
Figure 1 shows the Manufacturers listing page under Admin -> Catalog -> Manufacturers
Figure 1. Manufacturers listing page under Admin -> Catalog -> Manufacturers
To edit or delete any of these listings click the "i" with the circle around it on the line you want to
edit and when that listing is highlighted, click the "edit" or "delete" button to the right of that listing.
Add a manufacturer with its own image by clicking the "insert" button link. The "Manufacturers URL" link box can also be used as a direct link
to the manufacturer that shows only in the "Manufacturer Info" box in the right column if used.
Manufacturer's Edits
Figure 2 shows the Manufacturers edit page under Admin -> Catalog -> Manufacturers -> Edit
Figure 2. Manufacturers edit page under Admin -> Catalog -> Manufacturers -> Edit
Manufacturer's Name
This is the Manufacturer's name that will be displayed to the customer. It will be the same text displayed regardless of which language the
customer is using.
Manufacturer's Image
An image can be uploaded, typically the Manufacturer's logo, to represent the Manufacturer to the customer. This can be especially helpful if
the image is more recognizable than the actual name, especially if the customer doesn't recognize the name entered above due to language
differences.
Manufacturer's URL
The url can be entered to direct the customer to the Manufacturer's website, so the customer can go to the Manufacturer's website. This
website can be different for each of the installed languages.
Delete Manufacturer
After highlighting the Manufacturer you want to remove click the delete button to the right and follow the directions.
Reviews
Reviews
Reviews Listings
Reviews Edits
Delete Reviews
Reviews Listings
Each time a customer writes a review it is added to the store database and listed in the "Reviews" section. These reviews can be edited or
deleted by the store administrator.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Reviews listing page under Admin -> Catalog -> Reviews
Figure 1. Reviews listing page under Admin -> Catalog -> Reviews
Reviews Edits
Reviews can also be edited through the Administrative tool. The text of the review can be changed, as well as the rating for the review.
Figure 2 shows the Reviews edit page under Admin -> Catalog -> Reviews -> Edit
Figure 2. Reviews edit page under Admin -> Catalog -> Reviews -> Edit
Delete Reviews
To delete a review, click the "i" with the circle around it to highlight the review you want to delete and click the "delete" button to the right.
Specials
Specials
Specials Listings
Specials Edit
Product
Special Price
Expiry Date
Specials Delete
Specials are products that from time to time have a reduced cost to purchase. These are products that currently exist in the store so they
must be added through the normal Categories & Products section before setting a special price. The products set on special will be added to
the "Specials" box with the special price in your store. When a customer navigates to the product the special price will show and also on the
product listing page of your store.
Specials Listings
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Specials listing page under Admin -> Catalog -> Specials
Figure 1. Specials listing page under Admin -> Catalog -> Specials
Specials Edit
To add a new special to the store, click on the "new product" button link.
On the next screen choose your product from the drop-down box, put a special price. This can be a percentage (10%) off or it can be a
reduced set dollar amount like 10.00, and the expiration date if any.
If you enter a new price, the decimal separator must be a '.' (decimal-point), example: 49.99
Leave the expiry date empty for no expiration.
Figure 2 shows the Specials edit page under Admin -> Catalog -> Specials -> Edit
Figure 2. shows the Specials edit page under Admin -> Catalog -> Specials -> Edit
Product
This is the product that will be on special. It must be a product that already exists in the store.
Special Price
This is the price that will be advertised and used when the customer orders the product. The "original" price that was set through the
administrative tool will also be displayed with a strikethrough font, with this price displayed in red next to it.
Expiry Date
These are the dates that describe when the special price and status will be in effect. For example, a store owner might wish to make a
product a special for only a week, after which time it will return to normal. These dates allow the store owner to have this functionality without
having to return to the administrative tool exactly one week later.
Specials Delete
To delete a special, click the "i" with the circle around it to highlight the special you want to delete and click the "delete" button to the right.
Products Expected
Products Expected
The products expected section is the listing of products that will be expected to be in your store on a certain date. These product listings
originally are setup when adding a new product to the "Categories & Products" section by choosing a "Products Status" and a "Date
Available".
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Products Expected listing page under Admin -> Catalog -> Products Expected
Figure 1. Products Expected listing page under Admin -> Catalog -> Products Expected
When putting a product into the store there is a "Date Available" calendar to setup a date the product will be available for purchase in the
store. This must be set when putting the product into the store.
The products expected can be edited from this section instead of going into each product in Categories/Products.
When a product has an expected date on it that product can be seen on the first page only of the store at the bottom center called "Upcoming
Products" and has the date to the right.
Customer Section
Customer Section
The customers section holds all of the customers and orders that have been placed. The customer information can be edited, deleted, see
orders, and emailed from this section. The "Search" box in the top of the page will enable you to search for a string of text in the fields last
name, first name and email address of customers.
The store owner can edit any customer details except the password.
Customers
Orders
Customers
Customers
Edit Customer
Customer Orders
Customer Email
Customer Delete
The names, details and orders of customers who have created accounts and/or purchased from the store are listed showing the date their
account was created. A number of options are available for the store owner.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Edit Customer
This option allows the store owner to edit the name and contact details relating to a particular customer.
Figure 2 shows the Customers edit page under Admin -> Customers -> Edit
Figure 2. Customers listing page under Admin -> Customers -> Edit
Note: The orders for this customer will not be removed when a customer is deleted.
Customer Orders
The orders option takes the store owner to the orders screen to review the orders for that customer.
Figure 3 shows the Customer orders page under Admin -> Customers -> Orders
Figure 3. Customer orders page under Admin -> Customers -> Orders
Customer Email
Figure 4 shows the Customer orders page under Admin -> Customers -> email
Figure 4. Customer orders page under Admin -> Customers -> email
Customer Delete
To delete a customer click the "i" with the circle around it on the customer you want to delete and when that listing is highlighted, click the
"delete" button to the right of that listing.
Orders
Orders
The Orders section are all the "pending" orders.
To edit click the "i" with the circle around it to highlight the order, and then click the "edit" button to see the order.
Figure 1 shows the Customer orders page under Admin -> Customers -> Orders
Figure 1. Customer orders page under Admin -> Customers -> Orders
Orders can be viewed and edited. Comments about the order can be added to notify the customer of the order progress or append the
comments. If the comments are sent to the customer the customer will be able to read and review them in their store account as long as the
order stays in the database.
You also have an invoice and packing slip that can be printed. It is always advisable to print out your order details of each order to keep a
hard copy.
Figure 2 shows the Customer orders page under Admin -> Customers -> Orders -> Edit
Figure 2. Customer orders page under Admin -> Customers -> Orders -> Edit
Figure 1 shows the Customers page under Admin -> Locations / Taxes -> Countries
Figure 1. Customers listing page under Admin -> Locations / Taxes -> Countries
Zones
Figure 2 shows the Customers page under Admin -> Locations / Taxes -> Zones
Figure 2. Customers listing page under Admin -> Locations / Taxes -> Zones
Tax Zones
The state and tax description of your store.
Figure 3 shows the Customers page under Admin -> Locations / Taxes -> Tax Zones
Figure 3. Customers listing page under Admin -> Locations / Taxes -> Tax Zones
Tax Classes
The title of your tax class title like "taxable goods" and the description of that title.
Figure 4 shows the Customers page under Admin -> Locations / Taxes -> Tax Classes
Figure 4. Customers listing page under Admin -> Locations / Taxes -> Tax Classes
Tax Rates
The tax rate of the state your store is in.
Figure 5 shows the Customers page under Admin -> Locations / Taxes -> Tax Rates
Figure 5. Customers listing page under Admin -> Locations / Taxes -> Tax Rates
Click on the "new zone" button. In the Zone Name: input field I enter "CA"
After you click insert, you will see CA show up in the list. You think you're done, but not quite!
Click on the "CA" (or whatever name you have!) in the list and you will see the heading say "Geographical Zones / CA"
Now you get to select a geographical zone. From Country, I Select United States
A few more steps to go! Now under "Locations/Taxes" click on "Tax Rates"
Select "Taxable Goods" from the Tax Class Title drop down menu
From the Zone menu, select CA (or whatever zone you created)
Localization
Localization
Localizatin is seting up your default currency, language, and order status to notify and communicate with your customers.
Currencies
Languages
Orders Status
Currencies
Currencies
Two currencies are installed by default, the US Dollar and the EU Euro.
Although the exchange rates of the other currencies will be updated automatically when the update tool is used, if any products have been
entered in the Administration Tool, they will need to have the prices updated manually so be sure to install the default currency first, THEN
add products!
To edit click the "i" with the circle around it on the line you want to edit and when that listing is highlighted, click the "edit"
button to the right of that listing.
Figure 1 shows the Currencies listing page under Admin -> Localization -> Currencies
Figure 1. Currencies listing page under Admin -> Localization -> Currencies
Figure 2 shows the Currencies listing page under Admin -> Localization -> Currencies -> Edit
Figure 2. Currencies listing page under Admin -> Localization -> Currencies -> Edit
Title
This text will be used to describe what the currency is. It will be the same text regardless of what language the customer selects.
Code
This is the text code that will be used to refer to the currency when a row is inserted into the database. It will also be used to do the automatic
exchange rate updates online, so it must match with the online systems. You can find a list of the currency codes here.
The text entered here will be displayed to the left and to the right of the numeric currency amount, respectively. Any letters or symbols can be
used in this box.
Decimal Point
The character of the decimal point.
Thousands Point
Decimal Places
This specifies the number of decimal places that will be displayed on all currency values. Two digits is the default on the US Dollar and Euro
and is the most common amount.
Value
The value of the currency is multiplied by the value that was entered by the store owner in the Administration Tool. Therefore, to have a set
currency display the same to the customer, a value of 1.00 would be entered, as is the default for the US Dollar. Although this value can be
updated automatically, the number can be entered manually as well. There should only be one currency that has a value of 1.00, the default
currency, and all other currencies will then use that as a reference. This default currency is what the Adminstrator will have in mind as prices
are entered into the system.
Deleting a Currency
To remove a currency click the "i" with the circle around it on the line you want to edit and when that listing is highlighted, click the "delete"
button to the right of that listing.
Languages
Languages
Languages are available in English (default), German, and Spanish. New languages can be added to the Catalog and Administration Tool by
either installing language-packs or contributions, or by manually translating a language set by ones self.
To edit click the "i" with the circle around it on the line you want to edit and when that listing is highlighted, click the "edit"
button to the right of that listing.
Figure 1 shows the Languages listing page under Admin -> Localization -> Languages
Figure 1. Currencies listing page under Admin -> Localization -> Languages
Languages can be edited but it is best to leave the default settings for function of the store.
Figure 2 shows the Languages listing page under Admin -> Localization -> Languages -> Edit
Figure 2. Currencies listing page under Admin -> Localization -> Languages -> Edit
Name
Code
Image
Directory
Sort Order
Orders Status
Orders Status
The active download order status has been changed to a more flexible solution where downloads can be active with multiple order statuses
instead of just one. This allows downloads to occur during a "Processing" period for a physical and virtual order, and at the final stage of the
order when it is marked as "Delivered".
A further change has been introduced to the "admin/localization/order statuses" with a new public flag setting. This allows orders to be shown
or hidden from customers depending on the order status level. This is useful for the payment modules creating temporary "Preparing" orders
which are not shown to the customer.
The value of this is if you offer physical products along with instant downloadable products and a customer purchases both a physical and a
download product at the same time then the status should show "Processing" in their store account and still be able to have the instant
download link for the downloadable product since you will be mailing the physical product.
Additional statuses can be added to the "Orders Status" section by clicking the "insert" button.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Order Status listing page under Admin -> Localization -> Orders Status
Figure 1. Order Status listing page under Admin -> Localization -> Orders Status
Order Statuses are edited to either show the order to the customer at a certain order status level and/or allow downloads of virtual products
at a certain order status level.
Be sure, after editing a status, to click the "update" button so your changes will be saved.
Figure 2 shows the Order Status listing page under Admin -> Localization -> Orders Status -> Edit
Figure 2. Order Status listing page under Admin -> Localization -> Orders Status -> Edit
The "Public Status" column with the green checkmarks allows the customer to view this process after logging into their store account. The
store owner will also see the progress in each customer's order edit section.
The "Downloads Status" column shows at what payment module status listing a downloadable product can be downloaded. This setting
controls which status setting on your "payment modules" will allow a customer to actually download a downloadable product that has been
purchased.
Example 1
You only offer "virtual" products that would be downloadable after purchasing like ebooks, embroidery designs, etc. You would set the
"Delivered" status to show up in the customer account and also to allow the customer's "virtual" products to be downloaded at this status
level in the "Localization/Orders Status" admin section.
In modules/payment each enabled payment module used would have the "Orders Status" set to "Delivered". The payment module used for
this scenario would only be those that require a credit card to be used like authorize.net and any of the paypal payment modules.
Example 2
You offer both "physical" and "virtual (downloadable)" products to your customers. The "physical" product would need to be shipped and the
"virtual" product would be downloaded so you would use the "Pending" status.
In "Localization/Orders Status" you would set the "Pending" status to show up in the customer account and NOT allow downloads of "virtual"
products (public status column has a green checkmark and downloads status columns has a red x). The "Processing" status would have a
green checkmark in both public and downloads status columns in the "Localization/Orders Status" admin section.
If a customer orders both a "physical" and a "virtual" product their account will show "Pending" in their customer account and they will not be
able to download their downloadable product until you, the store owner, changes the status of their order in the store admin in
"Customers/Orders" edit section to "Processing".
In the modules/payment you would have any payment statuses used set to "Pending". Once payment is received you would change the
order status in "Customers/Orders" edit section to "Processing" so the customer could download their downloadable product. Any payment
modules are acceptable since the store owner will be manually changing the status after payment is received to allow "virtual" downloads.
With the "physical" and "virtual" products there is only tax calculated on the "physical" products as there is not any tax on "virtual"
downloadable products.
Reports
Reports
Products Viewed
Products Purchased
Customer Orders-Total
Products Viewed
The Products Viewed report will tell the store owner which of the products have been viewed the most times. The report is used by the store
owner to target special offers on products that are most frequently viewed.
Figure 1 shows the Reports page under Admin -> Reports -> Products Viewed
Figure 1. Reports page under Admin -> Reports -> Products Viewed
Products Purchased
The Products Purchased report will tell the store owner which of the products has been purchased the most times. The report is used by the
store owner to target special offers on products that are most frequently bought.
Figure 2 shows the Reports page under Admin -> Reports -> Products Purchased
Figure 2. Reports page under Admin -> Reports -> Products Purchased
Customer Orders-Total
The Customer Orders-Total report will tell the store owner how much money in total a customer has spent at the store. The report is used by
the store owner to target special offers or discounts for customers who purchase often.
Figure 3 shows the Reports page under Admin -> Reports -> Customer Orders-Total
Figure 3. Reports page under Admin -> Reports -> Customer Orders-Total
Tools
Tools
The Tools section is used to backup your database, manage a banner, file manager, send your customers an email, send your customers a
newsletter, give you your server information, and see who's online.
The database backup tool allows the store owner to make backups of the store database, including all customer and order information. It is
recommended that regular backups of the store are created server side and downloaded to your computer in case of problems with the store.
There is no tool on the adminstrative section to automatically make backups, and it should be known that many hosting sites also do not
make regular backups of this information unless explicitly asked.
Useful Information
The backup directory needs to be created by the store owner and given the permissions of 777 to give the web server write
permission for that folder.
Figure 1 shows the Database Backup Manager screen in Admin -> Tools -> Database Backup Manager
Figure 1. Database Backup Manager screen in Admin -> Tools -> Database Backup Manager
New Backup
To backup the stores database click on the backup button. This will present the store owner with some choices.
Figure 2 shows the Database Backup listing page in Admin -> Tools -> Database Backup Manager -> Backup
Figure 2. Database Backup listing page in Admin -> Tools -> Database Backup Manager -> Backup
Check the "Download only" box if you want to download your store database to your harddrive. A box will pop up for you to pick the folder to
put it in.
If you do not see an option to zip or gzip a backup you might need to change the path to the functions (Unix or Linux only) in
admin/includes/application_top.php around line 40:
define('LOCAL_EXE_GZIP', '/usr/bin/gzip');
define('LOCAL_EXE_GUNZIP', '/usr/bin/gunzip');
define('LOCAL_EXE_ZIP', '/usr/local/bin/zip');
define('LOCAL_EXE_UNZIP', '/usr/local/bin/unzip');
Note: By default the table sessions and whos_online will not be backed-up. If you do a restore, customers that are online
will lose the contents of their carts!
Restore a Backup
The store's database can be restored to a saved backup file either already saved on the server or from a local file that was previously
downloaded. To restore a file that is on the server, click on the filename of the desired backup and then on restore.
Figure 3 shows the Database Backup listing page in Admin -> Tools -> Database Backup Manager -> Restore
Figure 3. Database Backup listing page in Admin -> Tools -> Database Backup Manager -> Restore
To restore from a backup stored on the local computer, press restore button. This will then allow you to browse to the file where the backuip
is stored.
Useful Information
Do not interrupt the backup or restore process which might take a couple of minutes.
* For security reasons this is best done through a HTTPS connection so that the information cannot be intercepted.
Banner Manager
Banner Manager
General Banner Settings
Displaying Banners
The Banner Manager is a simple banner management implementation that displays image or HTML based banners, and tracks impressions
and clicks on a per banner basis.
Each banner is assigned a group which is used for displaying random banners in the set group. This allows certain banners to be shown
throughout certain locations on the overall web site layout.
To edit any of these listings click the "i" with the circle around it on the line you want to edit and when that listing is
highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Banner Manager listing page in Admin -> Tools -> Banner Manager
Figure 1. Banner Manager listing page in Admin -> Tools -> Banner Manager
Figure 1 shows the Banner Manager listing page in Admin -> Tools -> Banner Manager -> Edit
Figure 1. Banner Manager listing page in Admin -> Tools -> Banner Manager -> Edit
Banner Title
Banner URL
Banner Group
Scheduled At
A future date when the banner is to become active. If no scheduled date is defined, the banner is automatically active when saved.
HTML Text
Expires On
The expiration value can be set for a specific date or for a specific impression count value. When this value has been reached, the banner
will automatically become inactive. If no expiration value is defined, the banner will always remain active.
Displaying Banners
Banners can be displayed by either selecting a random banner in a banner group, or by directly requesting an ID to a banner.
<?php
echo tep_display_banner('dynamic', '468x50');
?>
Useful Information
The dynamic parameter value instructs the tep_display_banner() function to select a random banner from the 468x50
banner group.
Useful Information
The static parameter value instructs the tep_display_banner() function to select the banner with the ID value of 1.
Cache Control
Cache Control
Whenever your cache directory is not setup for your store you will get a pink error message at the top of the store screen like this:
Error: Cache directory does not exist. Please set this Configuration -> Cache.
Figure 1 shows the Cache Control listing page under Admin -> Tools -> Cache Control
Figure 1. Cache Control listing page under Admin -> Tools -> Cache Control
Through an FTP program, create a subfolder named "cache" in the "catalog" folder and set the chmod permissions to 777. Actually, it can be
named anything and put in any directory to which you have FTP access. but this is the most convenient for these purposes and easiest to
determine the absolute directory path since servers often have many redirects in their structure making the correct root directory path
confusing.
Now, go to Configuration/Cache. Click on "Use Cache" and set to "true". Click on Cache Directory and set the absolute directory path to the
"cache" folder. If there is any question or problem establishing the absolute path, it may be because of server redirects. Go to
Tools/Database Backup and see what path is listed by the Admin for the database 'backups' folder. Use that path and append
'catalog/cache/' to the end of it so that your path might appear as
/home/username/www/catalog/cache/
Pay close attention to case sensitivity so that the directory path exactly matches the "cache" folder created in FTP. Go back to Tools/Cache
Control, refresh if necessary, and the error message should be gone.
If the "file does not exist" messages still exist, upload via FTP, three blank files into your cache directory called:
categories_box-english.cache
manufacturers_box-english.cache
also_purchased-english.cache
If there are more languages, create more files replacing engish with language name and upload.
Now, go back to Tools/Cache Control, refresh if necessary, and the files should be
established, listing the date and time they were created.
Define Languages
Define Languages
Figure 1 shows the Define Languages listing page under Admin -> Tools -> Define Languages
Figure 1. Define Languages listing page under Admin -> Tools -> Define Languages
Each page is a link for editing but the permissions would have to be changed to 777.
File Manager
File Manager
Send Email
Send Email
An email can be sent to one customer, to all customers, or to all newsletter subscribers.
Figure 1 shows the Send Email page under Admin -> Tools -> Send Email
Figure 1. Send Email page under Admin -> Tools -> Send Email
The next page screen comes up showing your message and allows you to make changes before really submitting. If all is good click the
"send mail" button and your email will be sent.
Newsletter Manager
Newsletter Manager
Creating a Newsletter
Sending a Newsletter
The Newsletter Manager is a newsletter management system that sends emails to a targeted audience, namely the customers that have
given their email address when creating an account. Two newsletter modules are installed by default. One is used for sending emails to
customers who have selected to receive newsletters upon creating their user account (newsletter), and one for sending emails to customers
who have selected to be notified of product updates (product_notification). Also, a generic email can be sent to customers.
Handy Hint
To edit the details or send a newsletter click on one of the editing buttons after locking the newsletter.
Creating a Newsletter
Figure 1 shows the Newsletter Manager listing page in Admin -> Tools -> Newsletter Manager_
Figure 1. Newsletter Manager listing page in Admin -> Tools -> Newsletter Manager
Now, you can edit, delete, preview, send, or unlock your new newsletter.
Sending a Newsletter
Before a newsletter can be sent, the newsletter entry needs to be locked to show other administrators, who may be online at the time, that a
newsletter is pending to be delivered. When locked, a newsletter can be edited, deleted, previewed, sent, or unlocked. This will prevent
unsaved changes from being missed during the mailing. Once a newsletter entry has been locked, it can be sent to the targeted audience via
the chosen newsletter module (Newsletter, Product Notification or generic Email).
Figure 2 shows the Newsletter Manager listing page in Admin -> Tools -> Newsletter Manager -> Edit
Figure 2. Newsletter Manager listing page in Admin -> Tools -> Newsletter Manager -> Edit
When sending a "product notification newsletter" a new page comes up with the product listing in the left box. Choose product/products from
the left box and transfer to the right box and click submit.
The Global Product Notifications button will send the newsletter to any customer who has enabled this feature in their store account to
receive all notifications. Selecting only a few products in the left box and transferring to the right box will only send the newsletter to any
customer that has specifically checked these individual product notifications after purchasing them on the last page of the ordering process ...
checkout_success.php.
Depending on the newsletter module chosen, the target audience may need to be defined before the newsletter can be sent. This is not
required for the newsletter module as the target audience is already known (customers who have chosen to receive newsletters), however
the target audience needs to be defined for the product_notification module where the administrator must select which products the
newsletter is in relation to so that customers who have selected to be notified over certain product updates can receive the newsletter.
Once the target audience has been defined, a preview of the newsletter is shown for last minute changes to be performed, as well as the
number of customers who will receive the newsletter. The newsletter can then be sent when it has been confirmed via the online preview of
the content.
Server Info
Server Info
The server info page gives the store owner details on the configuration of the webserver that can be used to help diagnose issue's.
Server Host
Server OS
Server Date
Server Up Time
Database Host
Database
Datebase Date
HTTP Server
PHP Version
By providing this information when asking for help in the bug report or the community forums you will make the task of finding and resolving
the issue much easier.
Who's Online
Who's Online
Who's Online is a traffic reporting tool useful to see who is accessing your site. If a customer is logged into your store and looking around you
can click on their link and see what page they are on and what products they are perusing.Online is a traffic reporting tool useful to see who
is accessing your site. If a customer is logged into your store and looking around you can click on their link and see what page they are on
and what products they are perusing.
Figure 1 shows the Who's Online page in Admin > Tools > Who's Online_
Figure 1. Who's Online page in Admin > Tools > Who's Online
Tips
Tips
Tips for making the osCommerce store have a more customized look.
Two database tables need to be modified when changing the length of the product model field:
products
orders_products
Using phpMyAdmin
1. Set the new size value under the Length/Values field, and click on the Save button.
Using MySQL
This value can be reset so that new orders are assigned an ID from a specific starting range, for example from 1000.
The above query will assign an ID of 1000 to the next order made.
The ID can be set to any number, however as the orders_id field in the database is of type signed integer, the ID must exist in the following
range:
-2147483648 to 2147483647
Higher ID numbers can be achieved by converting the orders_id field type from signed integer to unsigned integer, which allows the following
range to be used:
0 to 4294967295
or, by changing the orders_id field type to big integer, which allows the following range to be used:
-9223372036854775808 to 9223372036854775807
0 to 18446744073709551615
References
MySQL Numeric Types
Some of the tips provided in this article require changes to be made to core osCommerce source files, and some tips require configuration
parameters to be set which will be finalized and made available in the osCommerce 2.2 Milestone 3 project release.
General Tips
Page Links
Site and Page Content
Usage Of Keywords
Page File Names
Recipricol Links
Valid HTML
Images
Page Links
In order for search engine spiders to be able to find all of the pages on a website, links need to be provided so that accessing them is
possible. An efficient navigation system can be achieved by avoiding the use of images, javascript, applets/active-x objects, and flash
presentations as page links.
Viewing the site with a text based browser such as Lynx can help in ensuring the accessibility of pages. A list of alternative browsers can be
found here:
http://www.w3.org/WAI/References/Browsing.html
Search engines like Google who factor link popularity into their ranking algorithms take the text used in text links into consideration, and
should contain keywords.
Search engine spiders index all pages and content of a web site, with the more content and relevant-content being made available that
matches keywords, the better.
Adding feedback, reviews, and press articles to the web site increases its appeal to both customers and search engines alike.
Usage Of Keywords
Keywords that are targeted for should exist in the content of the web site.
Becareful of over-using keywords, as the end result may damage the page ranking instead of helping it.
Keywords that best describe the content of the page should be used as part of the file name, with spaces being replaced with hyphens ('-').
Recipricol Links
Exchanging links with sites your visitors will find useful helps improve page ranking.
Don't exchange links only to increase link popularity as it may cause the opposite effect due to dilusion.
Valid HTML
Making sure the HTML source code is valid ensures that search engine spiders will correctly index the content on the page.
http://validator.w3.org
Images
All images should include descriptive, keyword-rich alt text, and be used to describe the image.
The alt text should not be too long and should fit in the image placeholder.
osCommerce Tips
Disabling Sessions
Linking To Products
Meta Tags
Disabling Sessions*
Sessions should be disabled for search engine spiders to prevent session ID's from being indexed which could cause a potential security and
privacy issue when multiple customers share the same session ID that the search engine spider has indexed.
Sessions for search engine spiders can be disabled at the following section on the osCommerce Administration Tool:
If the above configuration parameters are set to True, search engine spiders existing in osCommerce/includes/spiders.txt will not be given a
session ID.
The following contribution can be used for osCommerce 2.2 Milestone 1 and earlier versions which provides similar functionality:
SID Killer
Linking To Products
A convienient method to provide a link to all products and pages on the web site is to use a sitemap page or a page listing all available
products.
A sitemap page has been implemented in the osCommerce 2.2 Milestone 3 release that automatically and efficiently lists all available
categories.
The following contribution can be used for osCommerce 2.2 Milestone 2 and earlier versions, that lists all available products on a page:
Meta Tags
Including meta tags in the header of the HTML page can help improve the page ranking in search engine search results, although most
search engines today ignore the meta tags.
As of osCommerce 2.2 Milestone 3, meta tags are appropriately set for all pages.
Solution
There is a trick to use to upload images into their own folder under the images folder. There are basically 3 steps:
Step 1 - Create folders in your catalog/images folder to match the categories on your harddrive and also on your server. Based on the demo
catalog you would have folders called dvd, gt_interactive, hewlett_packard in the catalog/images folder.
Step 3 - When images are added via the item description page (in the admin panel), select the location via the browse button. Right before
the image name - change the backward slash to a forward slash .
C:oscommerce\catalog\images\dvd/movie.jpg
Subcategories would be similar so if you want to put an image (movie2.jpg) in the good subcategory for example:
C:oscommerce\catalog\images\dvd/good/movie2.jpg
would be:
C:oscommerce\catalog\images\dvd/good/movie2.jpg
and you will see /good/movie2.jpg in the "good" folder.
To:
The following solution can be added to includes/header.php for it to be shown on all pages of the catalog.
The following HTML and PHP code can be used to display the number of items existing in the shopping cart:
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="shoppingCartContents">
<?php
echo $cart->count_contents() . ' Items';
if ($cart->count_contents() > 0) {
echo '<br>Total: ' . $currencies->format($cart->show_total());
}
?>
</td>
</tr>
</table>
The HTML and PHP code above uses a new shoppingCartContents stylesheet definition that has to be defined in the stylesheet.css file. This
definition can be any name of choice.
The lbs (pounds) can also be displayed by using this php code:
<?php
echo $cart->count_contents() . ' Items';
if ($cart->count_contents() > 0) {
echo '<br>Total: ' . $currencies->format($cart->show_total()) . '<br>' . $cart->show_weight()
. ($cart->show_weight() > 1 ? 'lbs' : 'lb');
}
?>
<?php
echo $cart->count_contents() . ' Items';
if ($cart->count_contents() > 0) {
echo ' Total: ' . $currencies->format($cart->show_total()) . ' ' . $cart->show_weight() .
($cart->show_weight() > 1 ? 'lbs' : 'lb');
}
?>
Change:
$categories_string .= '<br>';
To:
$categories_string .= '<hr>';
Solution
The following methods are available to repair damaged database tables, depending on whether the database server is still running or not:
The <database table name> part in the commands below must be replaced with the actual database table name as shown
in the error message.
The following SQL statement can be executed when the database server is still running.
The following command, which is part of the MySQL installation, can be executed on the server when the database server is no longer
running.
References
The problem is at the end or beginning of your php file. Blank spaces or lines are not allowed. This usually occurs in your english.php file in
the languages file. Go to the end and see
if there is any blank characters after the ?> tag.
Error * Failed Opening
This error means there is not a class in includes/boxes.php so you will have to make one.
Remove the / from the end of your domain listing and make sure true is like this 'true' in the includes/configure.php file.
The error means the somewhere tep_get_tax_description is being called with only 3 arguments instead of 4. In MS1, tep_get_tax_description
didn't have the 4th argument $tax_exempt.
1. Add 0 to every call to tep_get_tax_description (i.e. make them not tax exempt.
2. In general.php where tep_get_tax_description is defined, put = 0 after tep_get_tax_description like this:
Display shows the 'n' character in index page when categories are selected.
You have edited the index.php using the online file manager which has removed the \ backslashes from the code. This is a known issue with
using the file manager to edit files. It is better to use an ftp program such as ws_ftp to download the file and edit it locally then ftp back to the
server.
Using a normal file editor (i.e. NOT the online file manager), edit the same file that you had previously edited with the file manager.
catalog/index.php seems to be the most commonly edited file with this problem. Change all of the instances of "n"; to "\n"; . "n" is the code for
a newline and is the letter n.
Change To:
Change To:
The following error message is shown when a main code file has been uploaded to the languages directory by accident.
Upload the correct file to the languages/*/ directory where * is the name of the language you are using.
Warning: mysql_connect(): Access denied for user: 'username@localhost' (Using password: YES) in
/home/username/public_html/shop/includes/functions/database.php on line 19
Unable to connect to database server!
To fix talk to your hosting provider. It looks like too many people are accessing mysql on the same server.
To fix comment out line 703 in includes/functions/general.php (just put two forward slashes at the start of the line)
Error * SSL - This page contains secure and non secure items
Error * SSL - This page contains secure and non secure items
Here are a couple of examples of the code neccessary to use the tep_href_link and tep_image functions and get rid of the nasty security
warnings you get for having "mixed" content on a secure page that are caused by hardcoding an absolute address or image.
This is an image that is not a link ... the image is pulled from the catalog/images directory.
This is a clickable image link for a page within your web site.
If you are using images in the stylesheet for backgrounds they should also use the relative address ... e.g. images/my_background.gif.
Detailed Explanation
Introduction
SSL stands for Secure Sockets Layer. This is technology derived in part from the military that encrypts data transfers across the internet.
There are several flavours of SSL but the most prevalent one today is 128 bit encryption, but watch out 256 bit encryption is on it's way!
For an e-trader, SSL encryption protects your customers transaction details as they are passed back and forth between their browser and
your server/domain. The data encryption happens at one end using a key and is deciphered at the other end using an equivalent key. The
permutations for how data can be encrypted are astronomical making it virtually theft and interference proof during transit.
SSL DOES NOT PROTECT your server from attacks, nor your admin or catalog from malicious hacks. In order to protect your server and
files you need to use facilities such as firewalls, virus checkers, Apache and IIS user and password protection for directories and files.
You need SSL if you are selling to the public for two very good reasons.
Your customers expect it - As surfers become more sophisticated they look at your site and want to make sure their details will be
safe should they order products. SSL seals are part - but a big part - in that re-assurance process. If the choice between two sites
comes down to which offers transaction security - do you want to be the site that misses out?
Even if you have unsophisticated customers who do not look for SSL encryption before they buy - if the data they send you is
intercepted and misused - you could land up being in heavy lawsuits for amongst many other things negligence. This is a small
possibility - but do you want to take the risk?
Getting SSL
Surf and find a Certificate issuer you feel happy with where you buy your SSL cerificate for a period of time 1 year, 2 year, etc.
If you have your own server you will need to generate a CSR (Certificate Signing request). If you are on shared hosting you need to get your
host to raise a CSR (Certificate Signing request). To do this the host will need certain information from you, especially if they are not also
your registrar. Such info will be your domains registered adminstrator. This info will be required by the SSL issuer. Along with the CSR they
also generate a key that will be used to encrypt and decipher data transmissions from your server/domain.
They own or have a trusted root in most browsers - All browsers come pre-installed with so called Trusted roots. These prevent Joe
Shmoe and his cousin Joe Bloggs from issuing worthless certificates that cannot do the encrypting to unsuspecting buyers. To see
trusted roots if you use IE go to Internet Options under tools and select the content tab where you will see in the middle section all
the trusted root certs installed on IE and their issuers.
If they don't have a trusted root in most browsers make sure they have a cert known as a chaining cert that links whatever they sell
to you with a trusted root.
Trusted root sellers are EXPENSIVE and very well recognised brands.
Chaining certs are affordable - They are still 128 bit encryption hence no less secure - but the brands are less well known.
1. Your certificate will encrypt data in a very precise way - if the cert is issued to www.yourdomain.com it will NOT encrypt transfers between
yourdomain.com and browsers and vice versa. So make sure you instruct your host to get the CSR raised with the correct AND full name of
the domain you want to be encrypted.
I normally use the domain name without the www. qualifier because servers for a number of reasons can strip the www. off, but I have yet to
see a server add it on without a deliberate redirect.
2. Send the CSR to your cert issuer who will vet the details and write to the administrator noted when the CSR was raised.
3. Assuming you are the administrator of your domain - you will have to acknowledge the mail from the issuer and OK the SSL.
4. The issuer will raise a SSL cert and send it to you. If you are using a chaining issuer they will also send a chain certificate.
The SSL cert will be installed in a directory on your server along with the chaining certificate if applicable.
They will also install the key they generated in step 2 above.
They will then add certain statements known as directives to your Apache configure files. These tell Apache that the site has SSL
encryption certification.
The workings of SSL with osCommerce are quite straightforward. Once your SSL is installed, you set the configuration path for https:// in
catalog/includes/configure.php to enable SSL and the code takes care of the rest.
Note: In the example above the certificate was issued WITHOUT the www. qualifier and this shop is installed in Catalog
directory ONE level below root. In normal working - these changes above will result in a small padlock being shown in the
bottom right of your browser status bar when you navigate to a secure page AND your address line will show the https://
URL instead of http://
If you look through the code you will see example after example of statements that refer to SSL where osC is making a decision based on
request type as to whether to display the secured or non secured pages.
In short neither you nor your customers has to type in https:// into the address line to get to secure pages. osCommerce will identify from the
configuration if SSL is installed and direct browsers to the correct page depending on what the browser is doing on your site.
Trouble Shooting
1. Security Alert
The alert box says info you exchange with this site cannot be viewed or changed by others. However there is a problem with the sites
security certificate.
1. The certificate is from a trusted certifying authority - Green tick for good or Red cross for bad will show. The company you get your
SSL certificate from should have a trusted root certificate installed.
2. The security certificate date is valid - Green tick for good or Red cross for bad will show
You need to extend the certificates validity - refer to the issuer.
3. The name on the security certificate is invalid or does not match the name of the site - Green tick for good or Red cross for bad will
show.
Your certificate has probably been issued with or without the www. and you have used the other spellng in your
catalog/includes/configure.php file. Make sure the cert name as issued is used in the configure.php files.
This alert appears if the secured page the browser is trying to show has objects or references that point to non secured domains.
So for instance if you had a graphical image of credit cards as processed by your gateway and say you were hotlinking to the images with a
piece of code such as <img src="http://mycreditcardprocessor.com> That image is not on your encrypted domain hence the alert would
show.
Often this problem will appear from one or more of three sources:
1. Where you are hotlinking images for your products from the wholesalers server
2. Objects in your footer
3. Objects in your boxes in the columns
If you set your site up and during install you choose SSL security WITHOUT having done the stuff in here you may get 404's when you try to
access secured pages.
Wrapping Up
Some people have dedicated servers and even on some shared server you can raise a self issued SSL certification. This does everything as
above except the certificate root does not exist in browsers. Therefore your site may be secure (although I do not profess to know if self
certificates offer 128 bit encryption), BUT your site visitors will ALWAYS get the alert in Trouble Shooting point 1.
Even though the alert says the site is safe, this is perhaps worse than not having a certificate as it alerts people to the fact that there is a
problem with the certificate - and people do not like problems !!!
Talk to your host for the path you need to apply in your configure.php paths
If the problem is an image you are hotlinking you need to ask the owner if you can have access to the image and place it in your own images
directory under the encrypted domain and then change the path in your footer so that it now references the image in your domain.
<?php
echo tep_image(DIR_WS_IMAGES . 'my_image.gif', 'my ALT text', '100', '150');
?>
All images which are also hyperlinks should be referenced in the following way:
<?php
echo '<a href="' . tep_href_link('your_directory/your_page.php') . '">' .
tep_image(DIR_WS_IMAGES . your_image.gif) . '</a>';
?>
If you are using images in the stylesheet for backgrounds they should also use the relative address ... e.g. images/my_background.gif
If you have for instance a visitor counter that goes back to the counter owners server to process info - you may be able to construct an if else
statement around the counter using php such that if the $request_type is SSL then do not go to the counter owners site.
For Google ads the script has to go back to google - not on your domain which gives the problem so use the following construct to prevent
google ads from showing iF the browser is on a secure page:
<?php
if ($request_type != 'SSL') {
.....
.....
.....
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
.....
.....
}
?>
Error * Write to Config
Since you are on a windows box and using IIS, set both configure.php files to read only (644) and that will resolve the message. This is also
for any other servers.
Add-Ons
Add-Ons
Authentication
Payment Modules
Shipping Modules
Order Total
Authentication
Authentication
Yubico
Yubico
Yubico
YubiKey
About Yubico
The YubiKey was invented in 2006 by Stina and Jakob Ehrensvärd, renowned Swedish IT-innovators. In 2007, Yubico was founded to bring
the technology to market. The company is funded and owned by team members, including Internet security and sales professionals with
proven track records of building successful IT-businesses. The team is based in Sweden, UK, California and India.
Yubico has broken the relationship between complexity, cost and security with the YubiKey. In business since 2007, with over 3,500
customers in 60 countries, the Yubico technology is being rapidly adopted by developers and cloud computing services around the world.
Customers range from individual developers to major enterprises.
The YubiKey is a hardware authentication token that looks like a small USB memory stick, but it is actually a keyboard. With the command of
an integrated touch button, the device can send a time-variant, secure login code as if it was typed in from a keyboard. The patents pending
technology works with all applications, any browser and on all computers without the need for drivers. It’s easy to use, easy to integrate and
inexpensive.
Resources
Yubico Website
Yubikey Add-On for osCommerce Online Merchant
Documentation for Yubikey Add-On
osCommerce Community Support Forum Channel for Yubikey Add-On
YubiKey
YubiKey
Introduction
YubiKey authentication for webstore administrator account
YubiKey authentication for webstore user account
Forgotten password interface for webstore user account
Database schema modifications
Validation of YubiKey OTP
Introduction
This document describes the screen layouts and database changes to support YubiKey strong authentication for Yubico webstore admin and
customer accounts. The Yubico webstore is based on osCommerce version v2.2 Release Candidate 2a.
This integration feature makes it mandatory to use YubiKey OTP based strong two-factor authentication for osCommerce administrator
accounts and optionally makes it available to customer accounts.
Yubico webstore administrators need to enter a valid YubiKey OTP and the password to login to the webstore. For convenience, there is no
need to provide the user name for admin login; only the YubiKey OTP and Password is required to authenticate an admin user.
The User name field is derived from the YubiKey OTP. Token ID which are the first 12 char. of the 44 char. OTP is treated
as the User name for osCommerce admin user. For better user experience and convenience in identifying a realworld user
for a given admin account, we have added two new fields in administrator table for storing administrator first and last name.
At the time of initial setup and configuration of osCommerce, the first administrator account needs to be created. This
osCommerce behavior remains the same with the only change that the administrator will see the above screen and will
need provide the OTP, the password and click the "Create" button that appears in place of the "Login" button above.
We have modified the administrator screen to display more information like the first and last name etc.
We have modfified the update administrator interface for modifiying (editing) first and last name information alongwith YubiKey OTP as well
as the password.
We can also use this interface for replacing the assigned YubiKey for existing administrators as well as changing the password.
There is one to one mapping between the YubiKey and the administrator i.e. an admininstrator can only be assigned one
YubiKey.
When a user creates a new customer account, he/she will get an option to select authentication preferences. Below the "Your Password" box
on the Create new user account screen a new box "Your Authentication Preferences" is added as shown below. It has options for setting
customers authentication preferences:
The default is "Use YubiKey OTP and password". Users ordering the YubiKeys for the first time can choose the option "Use Email-Address
and Password (select this if you do not already have a yubiKey)" at the time of registration and after receiving their first key, can edit their
account settings to choose "Use YubiKey OTP and password" to enable strong authentication.
Customers who have selected YubiKey strong authentication need to enter their YubiKey and the password. Other customers need to
provide the email ID specified at the time of account creation and the password.
Customers can update their authentication preferences by logging into their account and select "My Account" + "View or change my
authentication scheme":
Step 1
Step 2 The following screen is shown. The customer can now update the authentication preferences as desired:
Each customer can assign multiple YubiKey to its account provided that the YubiKey is not already assigned to any other
account.
If a customer has not opted for YubiKey authentication, the password reset mechanism remains unchanged. i.e. on click of "Continue"
button, the server resets the password and sends an email with the new password to the registered email ID.
If a customer has registered for YubiKey authentication; on click of "Continue" button, the customer is presented with 3 selection options
(radio buttons) on the screen as follows:
The following logic is implemented on the server for each of the above options:
Option a - "I forgot my Password": The OTP is validated and if valid, the password is reseted and sent in an email to the registered
email ID.
For the other two options: the User authentication preference is set to "Use Email-Address and Password" mode and the password
is reset and sent in email to the registered email ID.
We have added a table customers_yubikey_mapping for maintaining the YubiKey and the customer ID mapping. Table schema is as follows:
We have added a new column in the customer table for storing the customer authentication type:
ALTER TABLE `customers` ADD `customers_authentication_type` int(1) NOT NULL default '1';
We have modified the administrator table scheme as follows:
We use the php-yubico module (Auth_Yubico-1.8.tgz file) from Yubico available at http://code.google.com/p/php-yubico/ to validate the
YubiKey OTPs with online Yubico validation server.
More details and documentation for the php validation module are available at:
http://www.yubico.com/developers/api/
http://code.google.com/p/php-yubico/wiki/ReadMe
Payment Modules
Payment Modules
2Checkout
Authorize.net
ChronoPay
ClickandBuy
ipayment
PayPal
Sage Pay
WorldPay
2Checkout
2Checkout
About 2Checkout
2Checkout.com, Inc. (2CO) is the authorized reseller for over 1.6 million tangible or digital products and services.
Established in 1999 and headquartered in Columbus, Ohio, 2CO provides turnkey e-commerce solutions to thousands of business customers
around the world. 2CO's proprietary technology supports back-office functions including financial reporting, tracking, fraud prevention, affiliate
tracking, customer service and sales tracking.
Resources
2Checkout Website
2Checkout Payment Modules for osCommerce Online Merchant
Documentation for 2Checkout Payment Modules
osCommerce Community Support Forum Channel for 2Checkout Payment Modules
The 2Checkout Hosted Payment payment module is included in osCommerce Online Merchant v2.2 and is available as a separate add-on
for existing store owners who are running earlier versions of osCommerce Online Merchant v2.2.
The 2Checkout Hosted Payment payment module supports the following 2Checkout features:
The 2Checkout Hosted Payment payment module requires account settings to be defined on the 2Checkout Vendor Admin
interface in order to function correctly.
The following settings are found in the 2Checkout Vendor Admin -> Account -> Site Management section and must be defined in order to
function correctly.
Secret Word
A secret word used in the encryption of a security parameter that the 2Checkout gateway sends to the online store after a transaction has
been processed.
The page the customer will be forwarded to after a transaction has been successfully processed.
This must be set to the location of the checkout_process.php file on your webserver.
http://www.your-shop.com/path-to-catalog/checkout_process.php
https://www.your-shop.com/path-to-catalog/checkout_process.php
Use the first value if you are not sure if your webserver supports SSL (HTTPS) connections.
Configuration Settings
Enable 2Checkout
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
Vendor Account
Transaction Mode
Production The Production mode is used to process and receive payments from customers.
Secret Word
The Secret Word value securely verifies the results of a transaction. This must match the value entered in the 2Checkout Vendor Admin
interface.
Payment Routine
Multi-Page The Multi-Page routine is the traditional payment method spread over multiple pages and supports all payment methods
and tangible and intangible products/services.
Single-Page The Single-Page routine is a more faster an efficient payment method that only supports credit card payments and
intangible products/services.
Processing Currency
The processing currency must match the value entered in the 2Checkout Vendor Admin interface to correctly calculdate order total values.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when a successful transaction has been made.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
includes/languages/english/modules/payment/pm2checkout.php
includes/languages/espanol/modules/payment/pm2checkout.php
includes/languages/german/modules/payment/pm2checkout.php
includes/modules/payment/pm2checkout.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/pm2checkout.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Changelog
v1.2 11-Dec-2008
v1.1 13-Jan-2008
Initial Release
Authorize.net
Authorize.net
About Authorize.net
Authorize.Net enables merchants to authorize, settle and manage credit card and electronic check transactions via Web sites, retail stores,
mail order/telephone order (MOTO) call centers and mobile devices.
Reputation You Can Trust - More than 195,000 merchants trust Authorize.Net to manage their payment transactions securely and
reliably.
Easy to Integrate - Authorize.Net offers several methods for linking Web sites to the payment gateway. Web merchants can choose
the method that best suits their business needs. Retail merchants integrate to the payment gateway via third-party POS solutions.
Free Customer Support - Customer satisfaction is our number one priority. That's why we provide free customer support seven days
a week via toll-free telephone, e-mail and online chat. Representatives are available Monday through Friday from 6 AM to 6 PM
Pacific time.
Scalability - Authorize.Net provides valuable solutions for cost-conscious merchants. If your business needs change, you can
transition to the CyberSource Advanced service for enterprise-volume processing, international payments, advanced risk
management services, and more.
Business Partnerships - We are dedicated to providing products and value-adding services and tools that help merchants minimize
risk, reduce costs and increase revenue.
The Advanced Integration Method is the recommended method of submitting transactions to the payment gateway. This method allows a
merchant's server to securely connect directly to the payment gateway to submit transaction data. The merchant retains full control of the
payment data collection and the user experience. This method requires merchants to be able to initiate and manage secure Internet
connections.
The Simple Integration Method is a relatively simple and secure method to submit transactions to the Payment Gateway. Merchants using
this method have the option to let the gateway handle all the steps in transaction processing-payment data collection, data submission, and
response to customer. Any request to the gateway is required to contain information that indicates to the gateway that the transaction is
authentic and has been submitted for processing with the merchant's knowledge. This information is contained in a fingerprint that has to be
generated by the merchant and included with every request submitted to the gateway. The fingerprint is a hash generated using the
HMAC-MD5 hashing algorithm on a set of pre-defined transaction-specific fields. If the fingerprint cannot be validated by the gateway, the
request will be rejected.
Resources
Authorize.net Website
Authorize.net Payment Modules for osCommerce Online Merchant
Documentation for Authorize.net Payment Modules
osCommerce Community Support Forum Channel for Authorize.net Payment Modules
The Advanced Integration Method is the recommended connection method and offers the most secure and flexible integration. AIM allows
merchants to host their own secure payment form and send transactions to the payment gateway using an end-to-end secure sockets layer
(SSL) connection.
Employs industry standard secure data encryption technology - 128-bit Secure Sockets Layer (SSL) protocol.
Uses transaction key authentication for ultimate security.
Allows control over all phases of the customer's online transaction experience.
Configurable transaction response integrates easily with merchant applications.
The Advanced Integration Method is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store
owners who are running earlier versions of osCommerce Online Merchant v2.2.
This payment module requires account settings to be defined on the Authorize.net Merchant Interface in order to function
correctly.
This payment module requires PHP to support cURL or access to the "curl" program file.
MD5 Hash
The MD5 Hash feature allows transaction responses to be securely received from the payment gateway. The MD5 Hash is calculated with a
secret word that is configured in the Authorize.net Merchant Interface -> Settings -> MD5 Hash section.
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
Login ID
Transaction Key
MD5 Hash
The MD5 hash value securely verifies the results of a transaction. This must match the value entered in the Authorize.net Merchant Interface
Security section.
Transaction Server
Live The Live server is used in live environments to process and receive payments from customers.
Test The Test server is only used to test transactions in a staging environment. No transactions are processed and no payments are
made when transactions are being tested.
Transaction Mode
Live The Live mode verifies and processes the credit card information for processing.
Test The Test mode only verifies the credit card information for testing purposes when the Live transaction server is being used. No
transactions are processed and no payments are made when transactions are being tested.
Transaction Method
Authorization The Authorization transaction method only authorizes transactions and must be captured manually through the
Authorize.net Merchant Interface.
Capture The Capture transaction method authorizes and transfers the funds to your Merchant account.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when a successful transaction has been made.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
cURL Location
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
includes/languages/english/modules/payment/authorizenet_cc_aim.php
includes/languages/espanol/modules/payment/authorizenet_cc_aim.php
includes/languages/german/modules/payment/authorizenet_cc_aim.php
includes/modules/payment/authorizenet_cc_aim.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/authorizenet_cc_aim.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
The Simple Integration Method uses scripting techniques to authenticate transactions with a unique transaction fingerprint. SIM provides a
customizable, secure hosted payment form to make integration easy for Web merchants that do not have an SSL certificate. The
Authorize.net Payment Gateway can handle all the steps in the secure transaction process - payment data collection, data submission and
the response to the customer - while keeping Authorize.Net virtually transparent.
Payment gateway hosted payment form employs 128-bit SSL data encryption.
Digital fingerprints enhance security, providing multiple layers of authentication.
Customize the look and feel of the payment gateway hosted payment form and/or receipt page.
The Simple Integration Method is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store
owners who are running earlier versions of osCommerce Online Merchant v2.2.
This payment module requires account settings to be defined on the Authorize.net Merchant Interface in order to function
correctly.
MD5 Hash
The MD5 Hash feature allows transaction responses to be securely received from the payment gateway. The MD5 Hash is calculated with a
secret word that is configured in the Authorize.net Merchant Interface -> Settings -> MD5 Hash section.
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
Login ID
Transaction Key
MD5 Hash
The MD5 hash value securely verifies the results of a transaction. This must match the value entered in the Authorize.net Merchant Interface
Security section.
Transaction Server
Test The Test server is only used to test transactions in a staging environment. No transactions are processed and no payments are
made when transactions are being tested.
Transaction Mode
Live The Live mode verifies and processes the credit card information for processing.
Test The Test mode only verifies the credit card information for testing purposes when the Live transaction server is being used. No
transactions are processed and no payments are made when transactions are being tested.
Transaction Method
Authorization The Authorization transaction method only authorizes transactions and must be captured manually through the
Authorize.net Merchant Interface.
Capture The Capture transaction method authorizes and transfers the funds to your Merchant account.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when a successful transaction has been made.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
includes/languages/english/modules/payment/authorizenet_cc_sim.php
includes/languages/espanol/modules/payment/authorizenet_cc_sim.php
includes/languages/german/modules/payment/authorizenet_cc_sim.php
includes/modules/payment/authorizenet_cc_sim.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/authorizenet_cc_sim.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
ChronoPay
ChronoPay
About ChronoPay
ChronoPay is one of the leading Payment Service Providers on the European market. Headquartered in Amsterdam, The Netherlands, the
company enjoys an exceptional track record of growth. The management of ChronoPay and its subsidiaries consists of some of the most
experienced and knowledgeable people within the payment processing industry. Decades of collective experience have combined to produce
a company with great maturity and a clear vision for the future.
ChronoPay meets the highest security standards as required by the major credit card organisations Visa, MasterCard and American Express
(PCI compliancy). Additionally, their system is tested daily for all known vulnerabilities and is certified by HackerSafe.
ChronoPay Hosted Payment Page
With the ChronoPay Hosted Payment Page the customer is sent from the merchant's online shop to ChronoPay's payment page residing on
their secure server. The customer fills in their payment details and is then redirected back to the merchant's website. This payment procedure
is HackerSafe certified and the payment pages can be customized to match the look and feel of your website.
Resources
ChronoPay Website
ChronoPay Payment Modules for osCommerce Online Merchant
Documentation for ChronoPay Payment Modules
osCommerce Community Support Forum Channel for ChronoPay Payment Modules
With the ChronoPay Hosted Payment Page the customer is sent from the merchant's online shop to ChronoPay's payment page residing on
their secure server. The customer fills in their payment details and is then redirected back to the merchant's website. This payment procedure
is HackerSafe certified and the payment pages can be customized to match the look and feel of your website.
ChronoPay Hosted Payment Page is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store
owners who are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The ChronoPay Hosted Payment Page payment module supports the following ChronoPay features:
MD5 Password
The ChronoPay Hosted Payment Page payment module requires account settings to be defined on the ChronoPay
Client Interface in order to function correctly.
The following settings are found in the ChronoPay Client Interface -> Setup -> List of Products -> Product section and must be defined in
order to function correctly.
Access URL
The page the customer will be forwarded to after a transaction has been successfully processed.
This must be set to the location of the checkout_process.php file on your webserver.
http://www.your-shop.com/path-to-catalog/checkout_process.php
https://www.your-shop.com/path-to-catalog/checkout_process.php
Use the first value if you are not sure if your webserver supports SSL (HTTPS) connections.
Configuration Settings
Enable ChronoPay
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
ChronoPay Product ID
Unique code of product or service. ChronoPay uses it to determine which Merchant site the Customer belongs to.
MD5 Hash
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The customers order is saved in the database on the checkout confirmation page before the customer is forwarded to ChronoPay to finalize
the payment transaction. The order is saved in the database with this defined order status; by default it is Preparing
[COMMUNITY:ChronoPay].
The order status is updated again when the customer finalizes the payment transaction at ChronoPay and returns to the store with the link
provided by ChronoPay. The order status is also updated when the callback call from ChronoPay is received.
If the customer does not finalize the payment transaction at ChronoPay, the order remains in the database with this order status and can be
removed after a period of time.
The orders status will be updated to this value when the callback call from ChronoPay is received and the order has been verified.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/chronopay/callback.php
includes/languages/english/modules/payment/chronopay.php
includes/languages/espanol/modules/payment/chronopay.php
includes/languages/german/modules/payment/chronopay.php
includes/modules/payment/chronopay.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/chronopay.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
ClickandBuy
ClickandBuy
ClickandBuy E-Payment
About ClickandBuy
ClickandBuy helps merchants from all over the world increasing their eCommerce revenues. Today over 11,000 merchants already use
ClickandBuy for payments settlement, including Apple iTunes, AOL, Skype, T-Online, Meetic, Electronic Arts, Codemasters, Playboy,
Yamaha, Nero, SanDisk, snapfish, Nexagen, redcoon, Foto.com, Tailorstore, asknet. And millions of customers pay with ClickandBuy. In
Switzerland ClickandBuy is operated by licensing partner SWISSCOM and in other European markets by ClickandBuy (Europe) Ltd.
ClickandBuy will shortly also be available via TELMEX in Latin America, a market with over 100 million clients.
ClickandBuy has repeatedly received excellent scores and been placed amongst the leading competitors in terms of safety, data protection
and ease of use. In January 2007 Intel invested in ClickandBuy. At the same time ClickandBuy announced a global strategic partnership with
Intel. In August 2006 Deutsche Telekom acquired a ten per cent stake in ClickandBuy. Deutsche Telekom and ClickandBuy intend to expand
their existing cooperation in strategic terms, with ClickandBuy assuming responsibility for the global settlement of Deutsche Telekom's
comprehensive range of products and services. In January 2006, 3i also invested EUR 20 million to support ClickandBuy in its strategy of
international expansion.
ClickandBuy E-Payment
With ClickandBuy, you can accept 43 methods of payment for your products and services, including ELV (direct debit), online bank transfers,
credit and debit cards, and landline phone billing. No matter what your business, whether it be selling physical goods, digital media, or
services, ClickandBuy can simplify your payment process - without requiring you to negotiate multiple bank and credit card-processing
contracts in different countries around the world. Get secure, fast, and easy payment processing with ClickandBuy as your full-service
payment system:
Resources
ClickandBuy E-Payment
ClickandBuy E-Payment
ClickandBuy E-Payment is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store owners
who are running osCommerce Online Merchant v2.2 Milestone 2 onwards.
The ClickandBuy E-Payment payment module supports the following ClickandBuy features:
The ClickandBuy E-Payment payment module requires account settings to be defined on the ClickandBuy
Merchant Service Area in order to function correctly.
The following settings are found in the ClickandBuy Merchant Service Area -> Offer Administration -> Summary -> [COMMUNITY:domain] ->
Link List section and must be defined in order to function correctly.
Link
This value must be set to either of the following values depending on your server type.
http://www.your-site.com/
Use the first value if you are not sure if your webserver supports SSL (HTTPS) connections.
It is important to use only the domain name as part of the Link and to add the "/" character at the end of the link address. Not adding the "/"
character to the end of the link address will generate a false Premium Link to use as part of the module configuration and will cause
transactions to fail.
Configuration Settings
Enable ClickandBuy
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
Seller ID
This can be found on the ClickandBuy Merchant Service Area -> Settings -> Profile Details page shown as the Merchant ID.
Premium Link
http://premium-xxxxxxxxxx.eu.clickandbuy.com/
This can be found on the ClickandBuy Merchant Service Area -> Offer Administration -> Summary -> [COMMUNITY:domain] -> Link List ->
[COMMUNITY:link] -> Change Entry page.
MD5 Hash
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
Orders made with this payment module are set to this order status level.
Orders that are confirmed in the Second Confirmation verification are set to this order status level.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
cURL Program Location
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/clickandbuy/callback.php
ext/modules/payment/clickandbuy/images/clickandbuy_pref_180.gif
includes/languages/english/modules/payment/clickandbuy.php
includes/languages/espanol/modules/payment/clickandbuy.php
includes/languages/german/modules/payment/clickandbuy.php
includes/modules/payment/clickandbuy.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/clickandbuy.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
ipayment
ipayment
About ipayment
ipayment supports your online business by providing your customers a secure payment system that includes credit cards and bank transfers.
The following secure payment methods are available:
Visa
MasterCard
Maestro
American Express
JCB
Diners Club
Visa Electron
Solo
Elektronisches Lastschriftverfahren (ELV)
paysafecard
Resources
ipayment Website
ipayment Payment Modules for osCommerce Online Merchant
Documentation for ipayment Payment Modules
ipayment Credit Card is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store owners who
are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The ipayment Credit Card payment module supports the following ipayment features:
Security Hash
Configuration Settings
Manual Installation (as an Add-On)
Configuration Settings
Enable iPayment
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
Account Number
User ID
User Password
Transaction Method
The Authorization method only authorizes the transaction and must be captured through the ipayment Merchant Interface.
The Secret Word value securely verifies the results of a transaction. This must match the value entered in the ipayment Merchant Interface
site.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when a successful transaction has been made.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
includes/languages/english/modules/payment/ipayment_cc.php
includes/languages/espanol/modules/payment/ipayment_cc.php
includes/languages/german/modules/payment/ipayment_cc.php
includes/modules/payment/ipayment_cc.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/ipayment_cc.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
PayPal
PayPal
About PayPal
With over 140 million user accounts worldwide, PayPal is a popular payment method amongst millions of online shoppers and one of the
global leaders in online payments.
It's a fast and secure way for customers to pay online via all major debit and credit cards, online bank transfers and via payments
from PayPal user accounts. Customers don't even need a PayPal account to pay with PayPal.
PayPal is affordable for businesses of all sizes.
PayPal offers chargeback protection on qualifying transactions.
PayPal offers different products to suit your business needs and size.
Website Payments Pro is an all-in-one payments solution that enables a merchant to accept debit and credit card payments as well as bank
transfers directly on your website, over the phone, by fax and by mail order. You also gain the benefits of PayPal Express Checkout. It's the
smart, scaleable way to grow business.
Control your checkout from start to finish. PayPal processes payments seamlessly in the background.
Have one package offering you all the benefits of a merchant account and gateway.
Also add an express lane for over 140 million global PayPal user accounts.
Get all the advantages of Express Checkout combined with those of your merchant account and gateway.
Get approved in as little as 5 - 7 days.
Express Checkout
Express Checkout is PayPal's fastest checkout solution. Customers can pay easily, quickly, and securely in as few as three clicks. The
customer initiates and approves PayPal payments earlier in the checkout process, and shipping and billing information is sent immediately
from PayPal to your website.
Add an express lane for over 140 million global PayPal user accounts.
Increase sales. PayPal is shown to increase sales by an average of 14%*
Get new customers. Leverage the growing network of millions of PayPal accounts.
Own the entire customer relationship. Customers return to your site to confirm payment.
PayPal Express Checkout is available either as part of Website Payments Pro, our all-in-one payments solution, or as a standalone
add-on to your existing payment solution.
Website Payments Standard is an easy and secure way for customers to pay online. Buyers shop on your website, pay on PayPal and return
to your site. Set up can be completed in as little as a few minutes.
Accept payments via all major debit and credit cards as well as bank transfers. Customers do not need to have a PayPal account to
pay you.
No set-up or monthly fees - you typically just pay a small amount for each payment received.
No approval required - start accepting online payments today.
Please click here for more detailed information on Website Payments Standard.
* Q1 2006 PayPal phone survey of small and medium-sized businesses with at least $120,000 in annual sales online.
Resources
PayPal Website
PayPal Payment Modules for osCommerce Online Merchant
Documentation for PayPal Payment Modules
osCommerce Community Support Forum Channel for PayPal Payment Modules
PayPal Express Checkout is an express lane for 140 million PayPal user accounts worldwide.
Speed through checkout with as few as 3 clicks with information protected securely with PayPal.
Make payments using their credit card, debit card, bank account, PayPal balance, or an e-check.
Bring you repeat, loyal business because they love the simple checkout experience.
When customers complete a purchase, they return to your site so you can cross-sell, upsell, and gather direct-marketing data. If you accept
credit cards, adding PayPal can boost sales by an average of 14%* and increase checkout conversion.
* Q1 2006 PayPal phone survey of small and medium-sized businesses with at least $10,000 in annual sales online.
PayPal Express Checkout is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store owners
who are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The PayPal Express Checkout payment module supports the following PayPal features:
This PayPal Express Checkout payment module is a global product which can be used in stand alone mode (i.e. without
the need to activate Direct Payment module).
This payment module requires PHP to support cURL or access to the "curl" program file.
Existing osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1 store owners must perform
additional changes to core source code files to install and use this payment module. These changes are described in the
"Manual Installation (as an Add-On)" chapter.
Configuration Settings
Manual Installation (as an Add-On)
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure. A "Check Out with PayPal"
image button is also shown on the shopping cart page.
API Username
The username to use for the PayPal API service. This is tied to your PayPal seller e-mail address profile to accept payments for.
API Password
API Signature
Transaction Server
The Live server is for production use to receive payments from customers, and the Sandbox server is used to test transactions only.
Transaction Method
The Authorization method only authorizes the transaction which can be captured up to 29 days later, and must be captured through your
PayPal account page.
The Sale method instantly transfers the funds to your PayPal account.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when the transaction has been performed.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/paypal/express.php
ext/modules/payment/paypal/images/btn_express.gif
ext/modules/payment/paypal/images/btn_express_espanol.gif
ext/modules/payment/paypal/images/btn_express_german.gif
includes/languages/english/modules/payment/paypal_express.php
includes/languages/espanol/modules/payment/paypal_express.php
includes/languages/german/modules/payment/paypal_express.php
includes/modules/payment/paypal_express.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/paypal_express.php
The following codebase changes must also be performed to allow the "Check Out with PayPal" image button to appear on the shopping cart
page:
http://svn.oscommerce.com/fisheye/changelog/osCommerce?cs=1699
Please be sure to add the TEXT_ALTERNATIVE_CHECKOUT_METHODS language definition to the languages you have installed in the
following file:
includes/languages/<language>/shopping_cart.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
PayPal Website Payments Pro (UK) Direct Payments allows Debit/Credit cards to be accepted directly on a merchant's website during the
checkout process.
PayPal Website Payments Pro (UK) Direct Payments is included in osCommerce Online Merchant v2.2 and is available as a separate
add-on for existing store owners who are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The PayPal Website Payments Pro (UK) Direct Payments payment module supports the following PayPal features:
This payment module is targeted at UK PayPal merchants and uses the Payflow payment gateway. PayPal requires the
Website Payments Pro (UK) Express Checkout payment module to be enabled if this module is activated and therefore
should not be used as a stand alone product.
This payment module requires PHP to support cURL or access to the "curl" program file.
Configuration Settings
Manual Installation (as an Add-On)
Changelog
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure. The credit or debit card
information is entered on the checkout confirmation page.
Vendor
The merchant login ID that was created when a Website Payments Pro account was registered.
User
If one or more additional users are setup on the account, this value is the ID of the user authorized to process transactions. If, however, no
additional users were setup on the account, this has the same value as Vendor.
Password
The 6- to 32-character password that was defined during the registering of the account.
Partner
The ID provided by the authorized PayPal Reseller who registered you for the Payflow SDK. If the account was purchased directly from
PayPal, use PayPalUK.
Transaction Server
The Live server is for production use to receive payments from customers, and the Sandbox server is used to test transactions only.
Transaction Method
The Authorization method only authorizes the transaction which can be captured up to 29 days later, and must be captured through your
PayPal account page.
The Sale method instantly transfers the funds to your PayPal account.
The page during the checkout procedure that collects the card details. The card details can either be collected on the checkout payment
page or the checkout confirmation page.
Stores running osCommerce v2.2 Milestone 2 must use the Checkout Payment page to collect the card details on for
transactions to be processed correctly.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when the transaction has been performed.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
includes/languages/english/modules/payment/paypal_uk_direct.php
includes/languages/espanol/modules/payment/paypal_uk_direct.php
includes/languages/german/modules/payment/paypal_uk_direct.php
includes/modules/payment/paypal_uk_direct.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/paypal_uk_direct.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Changelog
v1.1 22-Jan-2008
Add configuration parameter to control where the card details should be collected; either on the checkout payment or checkout
confirmation page. This is needed for 2.2MS2 compatibility which can only collect card details on the checkout payment page.
Split card owner name into two fields for the first and last name.
v1.0 11-Jan-2008
Initial Release
PayPal Express Checkout is an express lane for 140 million PayPal user accounts worldwide.
Speed through checkout with as few as 3 clicks with information protected securely with PayPal.
Make payments using their credit card, debit card, bank account, PayPal balance, or an e-check.
Bring you repeat, loyal business because they love the simple checkout experience.
When customers complete a purchase, they return to your site so you can cross-sell, upsell, and gather direct-marketing data. If you accept
credit cards, adding PayPal can boost sales by an average of 14%* and increase checkout conversion.
* Q1 2006 PayPal phone survey of small and medium-sized businesses with at least $10,000 in annual sales online.
PayPal Express Checkout (UK) is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store
owners who are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The PayPal Express Checkout (UK) payment module supports the following PayPal features:
This payment module is targeted at UK PayPal merchants and uses the Payflow payment gateway. PayPal
requires the PayPal Website Payments Pro (UK) Direct Payments payment module to be enabled if this module is
activated. For Express Checkout as a standalone option please use the PayPal Express Checkout module.
This payment module requires PHP to support cURL or access to the "curl" program file.
Existing osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1 store owners must perform
additional changes to core source code files to install and use this payment module. These changes are described
in the "Manual Installation (as an Add-On)" chapter.
Configuration Settings
Manual Installation (as an Add-On)
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure. A "Check Out with PayPal"
image button is also shown on the shopping cart page.
Vendor
The merchant login ID that was created when a Website Payments Pro account was registered.
User
If one or more additional users are setup on the account, this value is the ID of the user authorized to process transactions. If, however, no
additional users were setup on the account, this has the same value as Vendor.
Password
The 6- to 32-character password that was defined during the registering of the account.
Partner
The ID provided by the authorized PayPal Reseller who registered you for the Payflow SDK. If the account was purchased directly from
PayPal, use PayPalUK.
Transaction Server
The Live server is for production use to receive payments from customers, and the Sandbox server is used to test transactions only.
Transaction Method
The Authorization method only authorizes the transaction which can be captured up to 29 days later, and must be captured through your
PayPal account page.
The Sale method instantly transfers the funds to your PayPal account.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when the transaction has been performed.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/paypal/express_uk.php
ext/modules/payment/paypal/images/btn_express.gif
ext/modules/payment/paypal/images/btn_express_espanol.gif
ext/modules/payment/paypal/images/btn_express_german.gif
includes/languages/english/modules/payment/paypal_uk_express.php
includes/languages/espanol/modules/payment/paypal_uk_express.php
includes/languages/german/modules/payment/paypal_uk_express.php
includes/modules/payment/paypal_uk_express.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/paypal_uk_express.php
The following codebase changes must also be performed to allow the "Check Out with PayPal" image button to appear on the shopping cart
page:
http://svn.oscommerce.com/fisheye/changelog/osCommerce?cs=1699
Please be sure to add the TEXT_ALTERNATIVE_CHECKOUT_METHODS language definition to the languages you have installed in the
following file:
includes/languages/<language>/shopping_cart.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
PayPal Website Payments Pro (US) Direct Payments allows Credit cards to be accepted directly during the checkout procedure.
PayPal Website Payments Pro (US) Direct Payments is included in osCommerce Online Merchant v2.2 and is available as a separate
add-on for existing store owners who are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The PayPal Website Payments Pro (US) Direct Payments payment module supports the following PayPal features:
PayPal requires the PayPal Express Checkout payment module to be enabled if this module is activated and therefore
should not be used as a stand alone product.
This payment module requires PHP to support cURL or access to the "curl" program file.
Configuration Settings
Manual Installation (as an Add-On)
Changelog
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure. The credit or debit card
information is entered on the checkout confirmation page.
API Username
The username to use for the PayPal API service. This is tied to your PayPal seller e-mail address profile to accept payments for.
API Password
API Signature
Transaction Server
The Live server is for production use to receive payments from customers, and the Sandbox server is used to test transactions only.
Transaction Method
The Authorization method only authorizes the transaction which can be captured up to 29 days later, and must be captured through your
PayPal account page.
The Sale method instantly transfers the funds to your PayPal account.
The page during the checkout procedure that collects the card details. The card details can either be collected on the checkout payment
page or the checkout confirmation page.
Stores running osCommerce v2.2 Milestone 2 must use the Checkout Payment page to collect the card details on for
transactions to be processed correctly.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when the transaction has been performed.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
includes/languages/english/modules/payment/paypal_direct.php
includes/languages/espanol/modules/payment/paypal_direct.php
includes/languages/german/modules/payment/paypal_direct.php
includes/modules/payment/paypal_direct.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/paypal_direct.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Changelog
v1.1 22-Jan-2008
Add configuration parameter to control where the card details should be collected; either on the checkout payment or checkout
confirmation page. This is needed for 2.2MS2 compatibility which can only collect card details on the checkout payment page.
v1.0 11-Jan-2008
Initial Release
PayPal Website Payments Standard is a secure quick-start solution that has everything store owners need to start accepting credit cards,
bank transfers, and PayPal payments online.
PayPal Website Payments Standard is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing
store owners who are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The PayPal Website Payments Standard payment module supports the following PayPal features:
Sandbox server to perform test transactions
Authorization and Sale transaction methods
Encrypted Web Payments
Instant Payment Notification
Configuration Settings
Manual Installation (as an Add-On)
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
E-Mail Address
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The customers order is saved in the database on the checkout confirmation page before the customer is forwarded to PayPal to finalize the
payment transaction. The order is saved in the database with this defined order status; by default it is Preparing [COMMUNITY:PayPal IPN].
The order status is updated again when the customer finalizes the payment transaction at PayPal and returns to the store with the link
provided by PayPal. The order status is also updated when the Instant Payment Notification from PayPal is received.
If the customer does not finalize the payment transaction at PayPal, the order remains in the database with this order status and can be
removed after a period of time.
The orders status will be updated to this value when the Instant Payment Notification from PayPal is received and the order has been
verified.
Gateway Server
The Live server is for production use to receive payments from customers, and the Sandbox server is used to test transactions only.
Transaction Method
The Authorization method only authorizes the transaction which can be captured up to 29 days later, and must be captured through your
PayPal account page.
The Sale method instantly transfers the funds to your PayPal account.
Page Style
The name of the Page Style to use as defined on your PayPal Profile account page.
All transaction parameters for an Invalid order can be sent to a defined e-mail address for further investigation.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
Setting this parameter to True encrypts the parameters sent to PayPal during the payment transaction.
This feature requires OpenSSL to be supported by your PHP installation, or access to the "openssl" program file and to
PHPs exec() function.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/paypal/standard_ipn.php
includes/languages/english/modules/payment/paypal_standard.php
includes/languages/espanol/modules/payment/paypal_standard.php
includes/languages/german/modules/payment/paypal_standard.php
includes/modules/payment/paypal_standard.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/paypal_standard.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Sage Pay
Sage Pay
Sage Pay provides a range of services allowing you to process secure credit and debit card payments online, over the telephone or via mail
order.
Ecommerce
Mail Order/Telephone Order
Sage 50/200
PayPal
Sage Pay Go connects to all the major UK acquiring banks and offer a simple sign up
process combined with extremely competitive pricing, with no set up costs, licence
charges or additional fees.
Merchant Services: If you do not already have a Merchant account, Sage Pay have
partnered with Bank of Scotland and can arrange one for you at very speciail market leading
rates.
For merchants who share hosting facilities or use shopping cart software.
For merchants who wish to run their own order and transaction reports on their servers. This is a hosted payment page solution that gives
the effect of Sage Pay Direct but without the PCI Compliance issues.
For merchants who wish to keep customers on their own website for the entire transaction process. This solution requires a digital SSL
certificate.
Risk management has become a key component of payment processing solutions. All fraud checks are designed to prevent fraud before it
takes place to avoid chargebacks.
Sage Pay Go includes all the bank initiated fraud checks including: AVS, CV2 and 3D Secure (Verified by Visa and MasterCard
SecureCode).
Sage Pay partners with The 3rd Man who are risk management specialists.
Stable and robust infrastructure ensures maximum resilience.
System monitors and disaster recovery processes 24/7/365.
PCI DSS Level 1 compliant.
If you have any questions or need further information do not hesitate to contact our Customer Service Team 24hrs a day or visit our website.
http://www.SagePay.com/
OFFER: 3 months free unlimited Sage Pay processing when you sign up to Sage Pay - Saving a minimum of £60! Promotion code "
osc223" APPLY NOW
Resources
Sage Pay Form is our simplict method of accepting payment online, it is recommended if your website is hosted on a shared server.
How It Works
The Sage Pay Form payment module is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing
store owners who are running earlier versions of osCommerce Online Merchant v2.2.
Existing osCommerce Online Merchant v2.2 Milestone 2 store owners must perform additional changes to core source
code files to install and use this payment module. These changes are described in the "Manual Installation (as an Add-On)"
chapter.
Configuration Settings
Manual Installation (as an Add-On)
Changelog
Upgrade Notes
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
The vendor login name used to connect to the transaction gateway with.
Encryption Password
Transaction Method
Authenticate The Authenticate transaction method only verifies the card and card holder using the 3D-Secure mechanism provided by
the card-schemes and card issuing banks. Authorisations and Settlements of transactions are performed manually on the
My Sage Pay Admin interface.
Deferred The Deferred transaction method verifies and authorises the transaction and is captured manually on the My Sage Pay
Admin Interface.
Payment The Payment transaction method verifies, authorises, and transfers the funds to your Merchant account via batch
settlement.
Transaction Server
Live The Live server is used in production environments to process and receive payments from customers.
Test The Test server is only used to test transactions on the Production server. No transactions are processed and no payments
are made when transactions are being tested.
Simulator The Simulator server is used to test transactions in a sandbox testing environment. No transactions are processed and no
payments are made within this environment.
Vendor E-Mail
If you wish to use multiple email addresses, you should add them using the : (colon) character as a separator. e.g.
[email protected]:[email protected]
If provided, an e-mail will be sent to this address when each transaction completes (successfully or otherwise).
Send E-Mail
Customer and Vendor Send customer and vendor e-mails if addresses are provided.
Vendor Only Send vendor e-mail but NOT the customer e-mail.
A message to the customer which is inserted into the successful transaction e-mails only.
If provided this message is included toward the top of the customer confirmation e-mails.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when a successful transaction has been made.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/sage_pay/errors.php
includes/languages/english/modules/payment/sage_pay_form.php
includes/languages/espanol/modules/payment/sage_pay_form.php
includes/languages/german/modules/payment/sage_pay_form.php
includes/modules/payment/sage_pay_form.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/sage_pay_form.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Additional Changes for Existing osCommerce Online Merchant v2.2 Milestone 2 Store Owners
The following core source code changes must also be performed for osCommerce Online Merchant v2.2 Milestone 2 installations:
http://github.com/osCommerce/oscommerce2/commit/80fb06c35704b1c9a8160bc7f7345cc91145862a
This change has been made as a bugfix for osCommerce Online Merchant v2.2 Release Candidate 1 (released 4th July 2007).
Changelog
v1.2 04-Sep-2009
v1.1 01-Sep-2009
v1.0 28-Aug-2009
Initial Release
Upgrade Notes
v1.1 to v1.2
If you are upgrading from v1.1 to v1.2 of the payment module, please copy and overwrite the following files on your server:
includes/modules/payment/sage_pay_form.php
To configure the VendorEMail, SendEMail, and eMailMessage parameter values, either remove and re-install the module from the
Administration Tool -> Modules -> Payment Modules page, or perform the following SQL queries to your database:
v1.0 to v1.1
If you are upgrading from v1.0 to v1.1 of the payment module, please copy and overwrite the following files on your server:
includes/modules/payment/sage_pay_form.php
To update the "Transaction Server" parameter, either remove and re-install the module from the Administration Tool -> Modules -> Payment
Modules page, or perform the following SQL query to your database:
Sage Pay Server is recommended if you wish to run your own order and transaction reports, but you do not want to collect credit card details
on your website. To use this product your website must have a fixed IP address. The hosted Sage Pay payment pages work within an iframe
on your website giving you the look and feel of a direct integration but without the PCI Compliance requirements as no card data is ever
Stored, Processed or Transmitted from the merchant's website.
How It Works
Simple integration
Complete security using the Sage Pay payment pages
Customisable payment pages
iFrame solution
Flexible payment features
Automate transaction requests
Run your own order and transaction reports
The Sage Pay Server payment module is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing
store owners who are running earlier versions of osCommerce Online Merchant v2.2.
This payment module requires PHP to support cURL or access to the "curl" program file.
Existing osCommerce Online Merchant v2.2 Milestone 2 store owners must perform additional changes to core source
code files to install and use this payment module. These changes are described in the "Manual Installation (as an Add-On)"
chapter.
Configuration Settings
Manual Installation (as an Add-On)
Changelog
Upgrade Notes
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
The vendor login name used to connect to the transaction gateway with.
Normal Redirect the customer to the payment page hosted at Sage Pay.
Low Load the Sage Pay payment page through an iframe in the checkout procedure.
Transaction Method
Authenticate The Authenticate transaction method only verifies the card and card holder using the 3D-Secure mechanism provided by
the card-schemes and card issuing banks. Authorisations and Settlements of transactions are performed manually on the
My Sage Pay Admin interface.
Deferred The Deferred transaction method verifies and authorises the transaction and is captured manually on the My Sage
Pay Admin Interface.
Payment The Payment transaction method verifies, authorises, and transfers the funds to your Merchant account via batch
settlement.
Live The Live server is used in production environments to process and receive payments from customers.
Test The Test server is only used to test transactions on the Production server. No transactions are processed and no payments
are made when transactions are being tested.
Simulator The Simulator server is used to test transactions in a sandbox testing environment. No transactions are processed and no
payments are made within this environment.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when a successful transaction has been made.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
cURL Location
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/sage_pay/checkout.php
ext/modules/payment/sage_pay/errors.php
ext/modules/payment/sage_pay/redirect.php
includes/languages/english/modules/payment/sage_pay_server.php
includes/languages/espanol/modules/payment/sage_pay_server.php
includes/languages/german/modules/payment/sage_pay_server.php
includes/modules/payment/sage_pay_server.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/sage_pay_server.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Additional Changes for Existing osCommerce Online Merchant v2.2 Milestone 2 Store Owners
The following core source code changes must also be performed for osCommerce Online Merchant v2.2 Milestone 2 installations:
http://github.com/osCommerce/oscommerce2/commit/80fb06c35704b1c9a8160bc7f7345cc91145862a
This change has been made as a bugfix for osCommerce Online Merchant v2.2 Release Candidate 1 (released 4th July 2007).
Changelog
v1.2 07-Sep-2012
Fixed generated URLs (tep_href_link() produces & in URLs which need to be replaced with & in the payment module)
v1.1 01-Sep-2009
v1.0 28-Aug-2009
Initial Release
Upgrade Notes
v1.1 to v1.2
If you are upgrading from v1.1 to v1.2 of the payment module, please copy and overwrite the following files on your server:
includes/modules/payment/sage_pay_server.php
v1.0 to v1.1
If you are upgrading from v1.0 to v1.1 of the payment module, please copy and overwrite the following files on your server:
includes/modules/payment/sage_pay_server.php
To update the "Transaction Server" parameter, either remove and re-install the module from the Administration Tool -> Modules -> Payment
Modules page, or perform the following SQL query to your database:
Sage Pay Direct is recommended if you wish to keep customers on your website for the entire transaction process and/or you wish to create
your own customised reports. This solution can also be integrated with back office software such as a call centre. To use this product your
website must have a fixed IP address and you must have a valid SSL certificate.
How It Works
Features And Benefits
Adaptable solution that can also be integrated with back office software
Comprehensive integration kits
Fully branded using your own payment pages
Flexible payment features
Automate transaction requests
Run your own order and transaction reports
The Sage Pay Direct payment module is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing
store owners who are running earlier versions of osCommerce Online Merchant v2.2.
This payment module requires PHP to support cURL or access to the "curl" program file.
Existing osCommerce Online Merchant v2.2 Milestone 2 store owners must perform additional changes to core source
code files to install and use this payment module. These changes are described in the "Manual Installation (as an Add-On)"
chapter.
Configuration Settings
Manual Installation (as an Add-On)
Changelog
Upgrade Notes
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
The vendor login name used to connect to the transaction gateway with.
Transaction Method
Authenticate The Authenticate transaction method only verifies the card and card holder using the 3D-Secure mechanism provided by
the card-schemes and card issuing banks. Authorisations and Settlements of transactions are performed manually on the
My Sage Pay Admin interface.
Deferred The Deferred transaction method verifies and authorises the transaction and is captured manually on the Sage Pay Admin
Interface.
Payment The Payment transaction method verifies, authorises, and transfers the funds to your Merchant account via batch
settlement.
Setting this parameter to True verifies the billing address with the Credit Card Verification Checknumber (CVC).
Transaction Server
Live The Live server is used in production environments to process and receive payments from customers.
Test The Test server is only used to test transactions on the Production server. No transactions are processed and no payments
are made when transactions are being tested.
Simulator The Simulator server is used to test transactions in a sandbox testing environment. No transactions are processed and no
payments are made within this environment.
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The orders status will be updated to this value when a successful transaction has been made.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
cURL Location
Accept Visa
Accept Solo
Accept Maestro
Setting this parameter to True allows Visa Electron UK Debit cards to be accepted.
Setting this parameter to True allows Japan Credit Bureau cards to be accepted.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/sage_pay/checkout.php
ext/modules/payment/sage_pay/direct_3dauth.php
ext/modules/payment/sage_pay/errors.php
ext/modules/payment/sage_pay/redirect.php
includes/languages/english/modules/payment/sage_pay_direct.php
includes/languages/espanol/modules/payment/sage_pay_direct.php
includes/languages/german/modules/payment/sage_pay_direct.php
includes/modules/payment/sage_pay_direct.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/sage_pay_direct.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Additional Changes for Existing osCommerce Online Merchant v2.2 Milestone 2 Store Owners
The following core source code changes must also be performed for osCommerce Online Merchant v2.2 Milestone 2 installations:
http://github.com/osCommerce/oscommerce2/commit/80fb06c35704b1c9a8160bc7f7345cc91145862a
This change has been made as a bugfix for osCommerce Online Merchant v2.2 Release Candidate 1 (released 4th July 2007).
Changelog
v1.1 01-Sep-2009
v1.0 28-Aug-2009
Initial Release
Upgrade Notes
v1.0 to v1.1
If you are upgrading from v1.0 to v1.1 of the payment module, please copy and overwrite the following files on your server:
includes/modules/payment/sage_pay_direct.php
To update the "Transaction Server" parameter, either remove and re-install the module from the Administration Tool -> Modules -> Payment
Modules page, or perform the following SQL query to your database:
WorldPay
WorldPay
About WorldPay
For millions of people around the world, WorldPay is the way to pay - trusted and secure.
An important part of The Royal Bank of Scotland Group, the 5th biggest banking group in the world, WorldPay payment solutions are trusted
by thousands of businesses, big and small.
Customers can accept payments over the internet, by phone, fax and mail. They accept Visa, MasterCard, Diners, American Express, JCB
and all the major credit cards. Not forgetting debit cards and local payment schemes like Maestro, Laser, Electron and more. Bank transfers
(such as the German ELV system), instalments, standing-order and direct-debit style payments. All in their customer's currency and
language - wherever they are in the world.
WorldPay is the only way to accept such a universal range of payments through one merchant account, one payment processing system,
24/7.
WorldPay Select Junior uses HTML forms to pass information between your site and the WorldPay Payment pages. This is the most
straightforward integration method, requiring only basic internet development skills. It enables you to offer a secure payment environment to
your shoppers, a wide range of payment methods and currencies, and provides flexibility in the look and feel of your payment pages and
confirmation emails. If required, you can also add extra encryption.
Resources
WorldPay Website
WorldPay Payment Modules for osCommerce Online Merchant
Documentation for WorldPay Payment Modules
osCommerce Community Support Forum Channel for WorldPay Payment Modules
WorldPay Select Junior is included in osCommerce Online Merchant v2.2 and is available as a separate add-on for existing store owners
who are running osCommerce Online Merchant v2.2 Milestone 2 and v2.2 Release Candidate 1.
The WorldPay Select Junior payment module supports the following WorldPay features:
Callback Password
MD5 Password
The WorldPay Select Junior payment module requires account settings to be defined on the WorldPay Customer
Management System in order to function correctly.
Callback URL
This value must be set to either of the following values depending on your server type.
http://<WPDISPLAY ITEM=MC_callback>
https://<WPDISPLAY ITEM=MC_callback>
Use the first value if you are not sure if your webserver supports SSL (HTTPS) connections.
Callback enabled?
Configuration Settings
Setting this parameter to True makes the payment method available to customers during the checkout procedure.
Installation ID
Callback Password
The Callback Password to verify callback responses with. This value must match the value provided in the WorldPay Customer Management
System -> Installation Account -> Configuration Options -> Callback Password field.
MD5 Password
The MD5 Password to verify transactions and callback responses with. This value must match the value provided in the WorldPay Customer
Management System -> Installation Account -> Configuration Options -> MD5 Secret For Transactions field.
Transaction Method
Test Mode
Defines if transactions should be processed in test mode (true) or in production mode (false).
Payment Zone
If set, this payment method will only be available to orders made within the defined zone.
The customers order is saved in the database on the checkout confirmation page before the customer is forwarded to WorldPay to finalize
the payment transaction. The order is saved in the database with this defined order status; by default it is Preparing
[COMMUNITY:WorldPay].
The order status is updated again when the customer finalizes the payment transaction at WorldPay and returns to the store with the link
provided by WorldPay. The order status is also updated when the callback call from WorldPay is received.
If the customer does not finalize the payment transaction at WorldPay, the order remains in the database with this order status and can be
removed after a period of time.
The orders status will be updated to this value when the callback call from WorldPay is received and the order has been verified.
Sort Order
The position to show the payment method on the checkout payment page against other available payment methods.
After extracting the add-on package, copy the files located in the catalog directory to your osCommerce installation directory on the server.
The files must be copied in the correct directory structure as extracted from the add-on package.
ext/modules/payment/worldpay/junior_callback.php
includes/languages/english/modules/payment/worldpay_junior.php
includes/languages/espanol/modules/payment/worldpay_junior.php
includes/languages/german/modules/payment/worldpay_junior.php
includes/modules/payment/worldpay_junior.php
The standard languages definitions in English, Spanish, and German are provided in the add-on package. For additional languages, copy
one of the existing language definition files to the appropriate language directory and edit the file with a text editor to edit the language
definitions. The location of the language definition file must be in:
includes/languages/<language>/modules/payment/worldpay_junior.php
When the files have been copied to their appropriate locations, the payment module will be available in the Administration Tool -> Modules ->
Payment Modules listing where it can be installed.
Shipping Modules
Shipping Modules
Shipping Modules give the store owner a way to change which shipping options are available to the customer at checkout time. During the
checkout process, these modules are called to calculate the final shipping and packaging costs for the order. The price can be affected by
how many products have been ordered, how much they weigh, as well as any other configuration settings set either in the shipping module
itself.
For example UPS modules (UPS XML which can be used all over the world is found at http://addons.oscommerce.com/info/1323, UPS
Choice at http://addons.oscommerce.com/info/528 which can be only used for US based shops).
To install a shipping module click the "i" with the circle around it next to the shipping module and click the "install" button to
the right.
Figure 1 shows the Shipping Modules listing page under Admin -> Modules -> Shipping
Figure 1. Shipping Modules listing page under Admin -> Modules -> Shipping
The shipping module must be enabled before you can edit it. Edit according to your needs and always add a different sort order to each
shipping module used (ex: 1, 2, 3, etc). Each shipping module you use must have a "sort order" attached to it so each shipping module that is
enabled will show up on the shipping page for the customer and in the "sort order" that is set.
To remove a shipping module highlight the one you want to remove by clicking the "i" with the circle around it and click the
remove button. This will not remove the files associated with the shipping module but will merely disable it.
Note that shipping modules always come with at least two files: the "shipping" module file that goes in catalog/includes/modules/shipping/
and the language file (with exactly the same name!) that goes in the language directory for example
catalog/includes/languages/english/modules/shipping/
If either one of these files is missing you will get errors in the admin section, also for modules that are not installed yet!
Figure 1 shows the Flat Rate Shipping Module listing page under Admin -> Modules -> Shipping -> Flat Rate -> Edit
Figure 1. Flat Rate Shipping Module listing page under Admin -> Modules -> Shipping -> Flate Rate -> Edit
Enable or disable this module with the true/false radio buttons. Note, setting the module to 'False' doesn't uninstall the module - it only affects
whether or not customers will be able to see Flat Rate shipping during checkout.
Shipping Cost
This is the actual cost of shipping. This price will be applied to all orders, regardless of how many items they buy, how much everything
weighs, etc.
Tax Class
If selected, this will apply the selected tax class to the shipping cost before being shown to the customer.
Shipping Zone
If selected, allows control of the Flat Rate shipping to be shown only to people from the selected region.
Sort Order
The sort order field describes in what order the module will be presented to the customer during checkout. The sorting is done with the lowest
number representing the top of the displayed list, except for a value of 0, which is put at the bottom.
Figure 1 shows the Per Item Shipping listing page under Admin -> Modules -> Shipping -> Per Item -> Edit
Figure 1. Per Item Shipping Module listing page under Admin -> Modules -> Shipping -> Per Item -> Edit
Enable or disable this module with the true/false radio buttons. Note, setting the module to 'False' doesn't uninstall the module - it only affects
whether or not customers will be able to see Per Item shipping during checkout.
Shipping Cost
The number entered here will be multiplied by the number of items in an order to calculate the shipping cost to be applied.
Handling Fee
This is an extra field to add a separate handling charge to the final shipping cost. The handling fee is the same for the order, regardless of
how many products were ordered.
Tax Class
If selected, this will apply the selected tax class to the shipping cost before being shown to the customer.
Shipping Zone
If selected, allows control of the Per Item shipping to be shown only to people from the selected region.
Sort Order
The sort order field describes in what order the module will be presented to the customer during checkout. The sorting is done with the lowest
number representing the top of the displayed list, except for a value of 0, which is put at the bottom.
Table Rate Shipping
Figure 1 shows the Table Rate Shipping Module listing page under Admin -> Modules -> Shipping -> Table Rate -> Edit
Figure 1. Table Rate Shipping Module listing page under Admin -> Modules -> Shipping -> Table Rate -> Edit
Enable or disable this module with the true/false radio buttons. Note, setting the module to 'False' doesn't uninstall the module - it only affects
whether or not customers will be able to see Table Rate shipping during checkout.
Shipping Table
This table will be applied to either to total weight or total price of the order to calculate a final shipping cost. However, there is a limit of 255
characters to this field. The default table of :
25:8.50,50:5.50,10000:0.00
Or by price:
Table Method
The Table Method allows either the total price of the order or the total weight of the order used as the lookup in the table described in the
Shipping Table.
Handling Fee
This is an extra field to add a separate handling charge to the final shipping cost. The handling fee is the same for the order, regardless of
how many products were ordered.
Tax Class
If selected, this will apply the selected tax class to the shipping cost before being shown to the customer.
Shipping Zone
If selected, allows control of the Table Rate shipping to be shown only to people from the selected region.
Sort Order
The sort order field describes in what order the module will be presented to the customer during checkout. The sorting is done with the lowest
number representing the top of the displayed list, except for a value of 0, which is put at the bottom.
Figure 1 shows the USPS Shipping Module listing page under Admin -> Modules -> Shipping -> USPS -> Edit
Figure 1. USPS Module listing page under Admin -> Modules -> Shipping -> USPS -> Edit
Enable or disable this module with the true/false radio buttons. Note, setting the module to 'False' doesn't uninstall the module - it only affects
whether or not customers will be able to see USPS shipping during checkout.
The username entered here will be used in the communication with the USPS production server during the shipping calculation
communication
The password entered here will be used with the username above in the communication with the USPS production server during the shipping
calculation communication
Handling Fee
This is an extra field to add a separate handling charge to the final shipping cost. The handling fee is the same for all orders, regardless of
how many products were ordered.
Tax Class
If selected, this will apply the selected tax class to the shipping cost before being shown to the customer.
Shipping Zone
If selected, allows control of the Table Rate shipping to be shown only to people from the selected region.
Sort Order
The sort order field describes in what order the module will be presented to the customer during checkout. The sorting is done with the lowest
number representing the top of the displayed list, except for a value of 0, which is put at the bottom.
Figure 1 shows the Zone Rates listing page under Admin -> Modules -> Shipping -> Zone Rates -> Edit
Figure 1. Zone Rates Shipping Module listing page under Admin -> Modules -> Shipping -> Zone Rates -> Edit
Enable or disable this module with the true/false radio buttons. Note, setting the module to 'False' doesn't uninstall the module - it only affects
whether or not customers will be able to see Zone Rates shipping during checkout.
Tax Class
If selected, this will apply the selected tax class to the shipping cost before being shown to the customer.
Sort Order
The sort order field describes in what order the module will be presented to the customer during checkout. The sorting is done with the lowest
number representing the top of the displayed list, except for a value of 0, which is put at the bottom.
Zone 1 Countries
If the customer is having an ordered delivered to one of the countries specified here, Zone Rates shipping will be available as an option
during checkout.
This table will be applied to either the total weight of the order to calculate a final shipping cost. However, there is a limit of 255 characters to
this field. The default table of :
3:8.50,7:10.50,99:20.00
This is an extra field to add a separate handling charge to the final shipping cost. The handling fee is the same for the order, regardless of
how many products were ordered.
Order Total
Order Total
The "Order Total" module puts the items in the order they will appear in the checkout process. Always put a different "sort order" on the ones
used. Most store owners keep the default settings.
To install or edit (after installing) any of these listings click the "i" with the circle around it on the line you want to edit and
when that listing is highlighted, click the "edit" button to the right of that listing.
Figure 1 shows the Order Totals listing page under Admin -> Modules -> Order Total
Figure 1. Order Totals listing page under Admin -> Modules -> Order Total
If the order total is below a certain amount, this option allows for adding an additional charge to the total. This is used to prevent small orders
from being unprofitable for the store owner. Here, the limit at which this module triggers can be set, as well as how much to add, and some
other display options.
Shipping
Whether or not the shipping cost is display is selected here, as well as an option to allow for free shipping. It is not possible to allow for free
shipping only to certain areas with this option, the Zone Rates shipping module should be used for that purpose.
Sub-Total
Whether or not to display the order sub-total cost and in what order to display.
Tax
Whether or not to display the tax on the order and in what order to display.
Total
Whether or not to display the order total cost and in what order to display.
Upgrade Guides
Upgrade Guides
v2.2 to v2.3.0
v2.3.0 to v2.3.1
v2.2 to v2.3.0
This upgrade guide only provides the minimum required changes in the form of security updates and bug fixes. These
changes will not upgrade your store to a complete v2.3 version. Please continue to use v2.2 add-ons and do not install v2.3
optimized add-ons as the may not function with your installation. If you wish to upgrade to a full v2.3 version, perform only
(SQL) Database Changes and use the database with a new v2.3 installation.
(A) (SEC) Administration Tool Log-In Update — Importance: High | Difficulty: Easy
(SQL) (UP) Update Database Field Lengths — Importance: High | Difficulty: Easy
(AC) (COMPAT) Fix Timezone Warning Messages for PHP v5.3 — Importance: Medium | Difficulty: Easy
(AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP v5.3 — Importance: Medium | Difficulty: Hard
(C) (SEC) Add Customer Session Token to Forms — Importance: Medium | Difficulty: Medium
(C) (BUG) Validate Removal of Customer Address — Importance: High | Difficulty: Easy
(AC) (BUG) Sanitize Parameters — Importance: High | Difficulty: Medium
(A) (UP) Add Support for Basic HTTP Authentication — Importance: High | Difficulty: Medium
(C) (UP) Generate a New Shopping Cart ID When Restoring Products — Importance: Medium | Difficulty: Easy
(C) (BUG) Fix Navigation History Session Content — Importance: High | Difficulty: Easy
(AC) (UP) Improve Validation of E-Mail Addresses — Importance: Medium | Difficulty: Medium
(AC) (UP) Code Cleanup — Importance: High | Difficulty: Easy
(A) (UP) Update Define Languages Page — Importance: Medium | Difficulty: Medium
(C) (BUG) Verify Shopping Cart Product Attribute Combinations — Importance: High | Difficulty: Easy
(AC) (UP) Remove PHP3 Compatibility Code — Importance: Low | Difficulty: Easy
(AC) (UP) Improve IP Address Detection — Importance: Medium | Difficulty: Easy
(A) (BUG) Don't Show Empty Menu Entries — Importance: Low | Difficulty: Easy
(AC) (UP) Add htaccess Protection to the Images Directory — Importance: Medium | Difficulty: Easy
(C) (UP) Optimize Tax Calculations — Importance: Medium | Difficulty: Easy
(AC) (UP) Improve Force Cookie Usage in Sessions — Importance: Medium | Difficulty: Easy
(A) (BUG) Fix Automatic Removal of Manufacturer Images — Importance: High | Difficulty: Easy
(A) (UP) Add API Version Tag to Modules — Importance: Low | Difficulty: Easy
(C) (UP) Hide Currencies and Languages Info Boxes for Single Currencies and Languages — Importance: Low | Difficulty: Easy
(A) (UP) Hide Language Selection if Only One Language is Installed — Importance: Low | Difficulty: Easy
(C) (BUG) Fix Retrieval of Special Product Prices — Importance: Low | Difficulty: Easy
(A) (BUG) Fix HTML E-Mails — Importance: Low | Difficulty: Easy
(A) (BUG) Improve Saving of Module Parameters — Importance: Low | Difficulty: Easy
(AC) (UP) Add Pre-Populated List of Currencies — Importance: Low | Difficulty: Easy
(A) (SQL) (NEW) Introduce Security Directory Permissions Feature — Importance: Medium | Difficulty: Easy
(AC) (SQL) (NEW) Introduce Action Recorder Feature — Importance: Medium | Difficulty: Hard
(AC) (UP) Cleanup Language Definitions — Importance: Low | Difficulty: Easy
(AC) (NEW) Move Installation Checks to New Security Checks Modules — Importance: Medium | Difficulty: Easy
(A) (UP) Introduce Windows Compatible is_writable() Function — Importance: Low | Difficulty: Easy
(A) (UP) Bypass HTTP Authentication for IIS Webservers — Importance: Low | Difficulty: Easy
(AC) (UP) Update PHP_SELF Value — Importance: Low | Difficulty: Easy
(A) (NEW) Introduce Easy Store Logo Uploader — Importance: Low | Difficulty: Easy
(AC) (SQL) (UP) Update Password Hashing to Phpass — Importance: High | Difficulty: Easy
(C) (BUG) Fix Length Check of Customer Passwords — Importance: Low | Difficulty: Easy
(C) (BUG) Fix Notice When Products Without Attributes are Added to the Shopping Cart — Importance: Low | Difficulty: Easy
(C) (BUG) Verify Languages Currency Exists — Importance: Low | Difficulty: Easy
(C) (BUG) Allow Quoted Words to be Searched — Importance: Low | Difficulty: Easy
The Administration Tool log-in feature introduced in v2.2RC2 can be bypassed on Apache web servers with AcceptPathInfo enabled by
manipulating the URL.
The fix involves setting a local $login_request variable in the login.php page and is checked for in application_top.php when no administrator
session exists.
Affected Files
catalog/admin/includes/application_top.php
catalog/admin/login.php
catalog/admin/includes/application_top.php
@@ -146,6 +146,10 @@
$redirect = true;
}
+ if (!isset($login_request) || isset($HTTP_GET_VARS['login_request']) ||
isset($HTTP_POST_VARS['login_request']) || isset($HTTP_COOKIE_VARS['login_request']) ||
isset($HTTP_SESSION_VARS['login_request']) || isset($HTTP_POST_FILES['login_request']) ||
isset($HTTP_SERVER_VARS['login_request'])) {
+ $redirect = true;
+ }
+
if ($redirect == true) {
tep_redirect(tep_href_link(FILENAME_LOGIN));
}
catalog/admin/login.php
@@ -10,6 +10,8 @@
Released under the GNU General Public License
*/
+ $login_request = true;
+
require('includes/application_top.php');
require('includes/functions/password_funcs.php');
SQL Queries
alter table address_book modify entry_gender char(1);
alter table address_book modify entry_company varchar(255);
alter table address_book modify entry_firstname varchar(255) NOT NULL;
alter table address_book modify entry_lastname varchar(255) NOT NULL;
alter table address_book modify entry_street_address varchar(255) NOT NULL;
alter table address_book modify entry_suburb varchar(255);
alter table address_book modify entry_postcode varchar(255) NOT NULL;
alter table address_book modify entry_city varchar(255) NOT NULL;
alter table address_book modify entry_state varchar(255);
PHP v5.3 displays a warning message if a default timezone has not been defined in its php.ini configuration file.
This fix checks if a default timezone has been defined and if not, defines a default timezone with the date_default_timezone_get() PHP
function.
Affected Files
catalog/admin/includes/functions/compatibility.php
catalog/includes/functions/compatibility.php
catalog/admin/includes/functions/compatibility.php
@@ -49,6 +49,11 @@
do_magic_quotes_gpc($HTTP_COOKIE_VARS);
}
+// set default timezone if none exists (PHP 5.3 throws an E_WARNING)
+ if ((strlen(ini_get('date.timezone')) < 1) && function_exists('date_default_timezone_set')) {
+ date_default_timezone_set(@date_default_timezone_get());
+ }
+
if (!function_exists('is_numeric')) {
function is_numeric($param) {
return ereg("^[0-9]{1,50}.?[0-9]{0,50}$", $param);
catalog/includes/functions/compatibility.php
@@ -49,6 +49,11 @@
do_magic_quotes_gpc($HTTP_COOKIE_VARS);
}
+// set default timezone if none exists (PHP 5.3 throws an E_WARNING)
+ if ((strlen(ini_get('date.timezone')) < 1) && function_exists('date_default_timezone_set')) {
+ date_default_timezone_set(@date_default_timezone_get());
+ }
+
if (!function_exists('array_splice')) {
function array_splice(&$array, $maximum) {
if (sizeof($array) >= $maximum) {
The POSIX Regular Expressions (ereg) functions have been deprecated in PHP v5.3 which displays warning messages when the functions
are used.
The fix is to replace all ereg related functions with preg functions.
Affected Files
catalog/admin/backup.php
catalog/admin/cache.php
catalog/admin/configuration.php
catalog/admin/includes/classes/language.php
catalog/admin/includes/classes/phplot.php
catalog/admin/includes/classes/sessions.php
catalog/admin/includes/functions/compatibility.php
catalog/admin/includes/functions/general.php
catalog/admin/includes/functions/html_graphs.php
catalog/admin/includes/functions/validations.php
catalog/admin/modules.php
catalog/admin/server_info.php
catalog/admin/whos_online.php
catalog/advanced_search_result.php
catalog/includes/application_top.php
catalog/includes/classes/cc_validation.php
catalog/includes/classes/http_client.php
catalog/includes/classes/language.php
catalog/includes/classes/sessions.php
catalog/includes/functions/compatibility.php
catalog/includes/functions/general.php
catalog/includes/functions/validations.php
catalog/index.php
View Changes Online
catalog/admin/backup.php
@@ -63,7 +63,7 @@
$schema .= ',' . "\n";
}
$next = '';
@@ -248,7 +248,7 @@
$sql_length = strlen($restore_query);
$i = strpos($restore_query, ';')-1;
- if (eregi('^create*', $query)) {
+ if (preg_match('/^create*/i', $query)) {
$table_name = trim(substr($query, stripos($query, 'table ')+6));
$table_name = substr($table_name, 0, strpos($table_name, ' '));
catalog/admin/cache.php
@@ -80,7 +80,7 @@
}
if (file_exists(DIR_FS_CACHE . $cached_file)) {
$cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_CACHE . $cached_file));
@@ -89,9 +89,9 @@
$dir = dir(DIR_FS_CACHE);
catalog/admin/configuration.php
@@ -77,7 +77,7 @@
while ($configuration = tep_db_fetch_array($configuration_query)) {
if (tep_not_null($configuration['use_function'])) {
$use_function = $configuration['use_function'];
- if (ereg('->', $use_function)) {
+ if (preg_match('/->/', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
catalog/admin/includes/classes/language.php
@@ -84,7 +84,7 @@
for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
reset($this->languages);
while (list($key, $value) = each($this->languages)) {
- if (eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) &&
isset($this->catalog_languages[$key])) {
+ if (preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this
->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
$ this->language = $this->catalog_languages[$key];
break 2;
}
catalog/admin/includes/classes/phplot.php
@@ -674,8 +674,8 @@ class PHPlot{
if ($which_valign == 'top') {
$which_ypos = $which_ypos - ImageFontHeight($which_font);
}
- $which_text = ereg_replace("\r","",$which_text);
- $str = split("\n",$which_text); //multiple lines submitted by Remi Ricard
+ $which_text = preg_replace("/\r/","",$which_text);
+ $str = explode("\n",$which_text); //multiple lines submitted by Remi Ricard
$height = ImageFontHeight($which_font);
$width = ImageFontWidth($which_font);
if ($which_angle == 90) { //Vertical Code Submitted by Marlin Viss
@@ -779,7 +779,7 @@ class PHPlot{
function SetPlotType($which_pt) {
$accepted = "bars,lines,linepoints,area,points,pie,thinbarline";
$asked = trim($which_pt);
- if (eregi($asked, $accepted)) {
+ if (preg_match('/' . $asked .'/i', $accepted)) {
$this->plot_type = $which_pt;
return true;
} else {
@@ -936,7 +936,7 @@ class PHPlot{
// It thus depends on the current character size, set by SetCharacterHeight().
/////////////////////////////////////////////////////////////////
- $str = split("\n",$this->title_txt);
+ $str = explode("\n",$this->title_txt);
$nbLines = count($str);
if ($this->use_ttf == 1) {
catalog/admin/includes/classes/sessions.php
@@ -379,7 +379,7 @@
// '<session-name>=<session-id>' to allow URLs of the form
// http://yoursite/<session-name>=<session-id>/script.php
if (empty($session->id)) {
- eregi($session->name . '=([(AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP
v5.3^/]+)', $GLOBALS['REQUEST_URI'], $regs);
+ preg_match('/' . $session->name . '=([(AC) (COMPAT) Use Perl-Compatible Regular Expressions
for PHP v5.3^/]+)/i', $GLOBALS['REQUEST_URI'], $regs);
$regs[1] = trim($regs[1]);
if (!empty($regs[1])) {
$session->id = $regs[1];
catalog/admin/includes/functions/compatibility.php
@@ -56,7 +56,7 @@
if (!function_exists('is_numeric')) {
function is_numeric($param) {
- return ereg("^[0-9]{1,50}.?[0-9]{0,50}$", $param);
+ return preg_match("/^[0-9]{1,50}.?[0-9]{0,50}$/", $param);
}
}
@@ -87,7 +87,7 @@
if(tep_not_null($host) && tep_not_null($type)) {
@exec("nslookup -type=$type $host", $output);
while(list($k, $line) = each($output)) {
- if(eregi("^$host", $line)) {
+ if(preg_match("/^$host/i", $line)) {
return true;
}
}
catalog/admin/includes/functions/general.php
@@ -52,9 +52,9 @@
}
function tep_sanitize_string($string) {
- $string = ereg_replace(' +', ' ', $string);
-
- return preg_replace("/[<>]/", '_', $string);
+ $patterns = array ('/ +/','/[<>]/');
+ $replace = array (' ', '_');
+ return preg_replace($patterns, $replace, trim($string));
}
function tep_customers_name($customers_id) {
@@ -146,7 +146,7 @@
if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
} else {
- return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second,
$month, $day, 2037)));
+ return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second,
$month, $day, 2037)));
}
}
@@ -938,8 +938,8 @@
$cached_file = $cache_blocks[$i]['file'];
$languages = tep_get_languages();
for ($j=0, $k=sizeof($languages); $j<$k; $j++) {
- $cached_file_unlink = ereg_replace('-language', '-' .
$languages[$j]['directory'], $cached_file);
- if (ereg('^' . $cached_file_unlink, $cache_file)) {
+ $cached_file_unlink = preg_replace('/-language/', '-' .
$languages[$j]['directory'], $cached_file);
+ if (preg_match('/^' . $cached_file_unlink . '/', $cache_file)) {
@unlink(DIR_FS_CACHE . $cache_file);
}
}
@@ -950,7 +950,7 @@
$cached_file = $cache_blocks[$i]['file'];
$languages = tep_get_languages();
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- $cached_file = ereg_replace('-language', '-' . $languages[$i]['directory'],
$cached_file);
+ $cached_file = preg_replace('/-language/', '-' . $languages[$i]['directory'],
$cached_file);
@unlink(DIR_FS_CACHE . $cached_file);
}
}
@@ -1276,7 +1276,7 @@
// nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n)
function tep_convert_linefeeds($from, $to, $string) {
if ((PHP_VERSION < "4.0.5") && is_array($from)) {
- return ereg_replace('(' . implode('|', $from) . ')', $to, $string);
+ return preg_replace('/(' . implode('|', $from) . ')/', $to, $string);
} else {
return str_replace($from, $to, $string);
}
catalog/admin/includes/functions/html_graphs.php
@@ -160,7 +160,7 @@
$horizontal_graph_string .= '>';
catalog/admin/includes/functions/validations.php
@@ -43,22 +43,22 @@
function tep_validate_email($email) {
$valid_address = true;
- $mail_pat = '^(.+)@(.+)$';
+ $mail_pat = '/^(.+)@(.+)$/i';
$valid_chars = "[(AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP v5.3^]
\(\)<>@,;:\.\\\"\[]";
$atom = "$valid_chars+";
$quoted_user='(\"[(AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP v5.3^\"
]*\")';
$word = "($atom|$quoted_user)";
- $user_pat = "^$word(\.$word)*$";
- $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
- $domain_pat = "^$atom(\.$atom)*$";
+ $user_pat = "/^$word(\.$word)*$/i";
+ $ip_domain_pat='/^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$/i';
+ $domain_pat = "/^$atom(\.$atom)*$/i";
catalog/admin/modules.php
@@ -234,7 +234,7 @@
$keys .= '<b>' . $value['title'] . '</b><br>';
if ($value['use_function']) {
$use_function = $value['use_function'];
- if (ereg('->', $use_function)) {
+ if (preg_match('/->/', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include(DIR_WS_CLASSES . $class_method[0] . '.php');
catalog/admin/server_info.php
catalog/admin/whos_online.php
@@ -84,7 +84,7 @@
<td class= "dataTableContent" align="center"><?php echo
$whos_online['ip_address']; ?></td>
<td class= "dataTableContent"><?php echo date('H:i:s',
$whos_online['time_entry']); ?></td>
<td class= "dataTableContent" align="center"><?php echo date('H:i:s',
$whos_online['time_last_click']); ?></td>
- <td class= "dataTableContent"><?php if (eregi('^(.*)' . tep_session_name() .
'=[a-f,0-9]+[&]*(.*)', $whos_online['last_page_url'], $array)) { echo $array[1] . $array[2]; }
else { echo $whos_online['last_page_url']; } ?> </td>
+ <td class= "dataTableContent"><?php if (preg_match('/^(.*)' . tep_session_name() .
'=[a-f,0-9]+[&]*(.*)/i', $whos_online['last_page_url'], $array)) { echo $array[1] . $array[2]; }
else { echo $whos_online['last_page_url']; } ?> </td>
</tr>
<?php
}
catalog/advanced_search_result.php
@@ -300,7 +300,7 @@
$where_str .= " group by p.products_id, tr.tax_priority";
}
catalog/includes/application_top.php
@@ -341,7 +341,7 @@
while (list($key, $value) = each($HTTP_POST_VARS)) {
if (is_array($value)) {
while (list($key2, $value2) = each($value)) {
- if (ereg ("(.*)\]\[(.*)", $key2, $var)) {
+ if (preg_match ("/(.*)\]\[(.*)/", $key2, $var)) {
$id2[$ var[1]][$var[2]] = $value2;
}
}
catalog/includes/classes/cc_validation.php
@@ -14,21 +14,21 @@
var $cc_type, $cc_number, $cc_expiry_month, $cc_expiry_year;
- if (ereg('^4[0-9]{12}([0-9]{3})?$', $this->cc_number)) {
+ if (preg_match('/^4[0-9]{12}([0-9]{3})?$/', $this->cc_number)) {
$ this->cc_type = 'Visa';
- } elseif (ereg('^5[1-5][0-9]{14}$', $this->cc_number)) {
+ } elseif (preg_match('/^5[1-5][0-9]{14}$/', $this->cc_number)) {
$ this->cc_type = 'Master Card';
- } elseif (ereg('^3[47][0-9]{13}$', $this->cc_number)) {
+ } elseif (preg_match('/^3[47][0-9]{13}$/', $this->cc_number)) {
$ this->cc_type = 'American Express';
- } elseif (ereg('^3(0[0-5]|[68][0-9])[0-9]{11}$', $this->cc_number)) {
+ } elseif (preg_match('/^3(0[0-5]|[68][0-9])[0-9]{11}$/', $this->cc_number)) {
$ this->cc_type = 'Diners Club';
- } elseif (ereg('^6011[0-9]{12}$', $this->cc_number)) {
+ } elseif (preg_match('/^6011[0-9]{12}$/', $this->cc_number)) {
$ this->cc_type = 'Discover';
- } elseif (ereg('^(3[0-9]{4}|2131|1800)[0-9]{11}$', $this->cc_number)) {
+ } elseif (preg_match('/^(3[0-9]{4}|2131|1800)[0-9]{11}$/', $this->cc_number)) {
$ this->cc_type = 'JCB';
- } elseif (ereg('^5610[0-9]{12}$', $this->cc_number)) {
+ } elseif (preg_match('/^5610[0-9]{12}$/', $this->cc_number)) {
$ this->cc_type = 'Australian BankCard';
} else {
return -1;
catalog/includes/classes/http_client.php
@@ -386,7 +386,7 @@
$str = fgets($this->socket, 1024);
$finished = ($str == $lastLine);
if (!$finished) {
- list($hdr, $value) = split(': ', $str, 2);
+ list($hdr, $value) = explode(': ', $str, 2);
// nasty workaround broken multiple same headers (eg. Set-Cookie headers) @FIXME
if (isset($headers[$hdr])) {
$headers[$hdr] .= '; ' . trim($value);
catalog/includes/classes/language.php
@@ -84,7 +84,7 @@
for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
reset($this->languages);
while (list($key, $value) = each($this->languages)) {
- if (eregi('^(' . $value . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) &&
isset($this->catalog_languages[$key])) {
+ if (preg_match('/^(' . $value . ')(;q=[0-9]\\.[0-9])?$/i', $this
->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
$ this->language = $this->catalog_languages[$key];
break 2;
}
catalog/includes/classes/sessions.php
@@ -388,7 +388,7 @@
// '<session-name>=<session-id>' to allow URLs of the form
// http://yoursite/<session-name>=<session-id>/script.php
if (empty($session->id)) {
- eregi($session->name . '=([(AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP
v5.3^/]+)', $GLOBALS['REQUEST_URI'], $regs);
+ preg_match('/' . $session->name . '=([(AC) (COMPAT) Use Perl-Compatible Regular Expressions
for PHP v5.3^/]+)/i', $GLOBALS['REQUEST_URI'], $regs);
$regs[1] = trim($regs[1]);
if (!empty($regs[1])) {
$session->id = $regs[1];
catalog/includes/functions/compatibility.php
@@ -123,7 +123,7 @@
if (!function_exists('is_numeric')) {
function is_numeric($param) {
- return ereg('^[0-9]{1,50}.?[0-9]{0,50}$', $param);
+ return preg_match('/^[0-9]{1,50}.?[0-9]{0,50}$/', $param);
}
}
@@ -173,7 +173,7 @@
if(tep_not_null($host) && tep_not_null($type)) {
@exec("nslookup -type=$type $host", $output);
while(list($k, $line) = each($output)) {
- if(eregi("^$host", $line)) {
+ if(preg_match("/^$host/i", $line)) {
return true;
}
}
catalog/includes/functions/general.php
@@ -58,9 +58,9 @@
}
function tep_sanitize_string($string) {
- $string = ereg_replace(' +', ' ', trim($string));
-
- return preg_replace("/[<>]/", '_', $string);
+ $patterns = array ('/ +/','/[<>]/');
+ $replace = array (' ', '_');
+ return preg_replace($patterns, $replace, trim($string));
}
////
@@ -584,7 +584,7 @@
if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
} else {
- return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second,
$month, $day, 2037)));
+ return preg_replace('/2037$/', $year, date(DATE_FORMAT, mktime($hour, $minute, $second,
$month, $day, 2037)));
}
}
@@ -594,7 +594,7 @@
$search_str = trim(strtolower($search_str));
// Check for one possible exception to the rule. That there is a single quoted word.
if (substr($pieces[$k], -1 ) == '"') {
@@ -685,7 +685,7 @@
$piece onto the tail of the string, push the $tmpstring onto the $haves,
kill the $tmpstring, turn the $flag "off", and return.
*/
- $tmpstring .= ' ' . trim(ereg_replace('"', ' ', $pieces[$k]));
+ $tmpstring .= ' ' . trim(preg_replace('/"/', ' ', $pieces[$k]));
return sizeof($temp_array);
}
@@ -1053,7 +1053,7 @@
@@ -1300,7 +1300,7 @@
// nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n)
function tep_convert_linefeeds($from, $to, $string) {
if ((PHP_VERSION < "4.0.5") && is_array($from)) {
- return ereg_replace('(' . implode('|', $from) . ')', $to, $string);
+ return preg_replace('/(' . implode('|', $from) . ')/', $to, $string);
} else {
return str_replace($from, $to, $string);
}
catalog/includes/functions/validations.php
@@ -43,22 +43,22 @@
function tep_validate_email($email) {
$valid_address = true;
- $mail_pat = '^(.+)@(.+)$';
+ $mail_pat = '/^(.+)@(.+)$/i';
$valid_chars = "[(AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP v5.3^]
\(\)<>@,;:\.\\\"\[]";
$atom = "$valid_chars+";
$quoted_user='(\"[(AC) (COMPAT) Use Perl-Compatible Regular Expressions for PHP v5.3^\"
]*\")';
$word = "($atom|$quoted_user)";
- $user_pat = "^$word(\.$word)*$";
- $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
- $domain_pat = "^$atom(\.$atom)*$";
+ $user_pat = "/^$word(\.$word)*$/i";
+ $ip_domain_pat='/^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$/i';
+ $domain_pat = "/^$atom(\.$atom)*$/i";
@@ -188,7 +188,7 @@
}
}
Add a customer session token to forms to protect against Cross-Site Request Forgeries (CSRF).
Affected Files
catalog/account_edit.php
catalog/account_newsletters.php
catalog/account_notifications.php
catalog/account_password.php
catalog/address_book_process.php
catalog/checkout_payment.php
catalog/checkout_payment_address.php
catalog/checkout_shipping.php
catalog/checkout_shipping_address.php
catalog/create_account.php
catalog/includes/application_top.php
catalog/includes/functions/html_output.php
catalog/login.php
catalog/password_forgotten.php
catalog/product_reviews_write.php
catalog/tell_a_friend.php
catalog/account_edit.php
@@ -20,7 +20,7 @@
// needs to be included earlier to set the success message in the messageStack
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_EDIT);
catalog/account_newsletters.php
@@ -23,7 +23,7 @@
$newsletter_query = tep_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . "
where customers_id = '" . (int)$customer_id . "'");
$newsletter = tep_db_fetch_array($newsletter_query);
catalog/account_notifications.php
@@ -23,7 +23,7 @@
$global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO
. " where customers_info_id = '" . (int)$customer_id . "'");
$global = tep_db_fetch_array($global_query);
catalog/account_password.php
@@ -20,7 +20,7 @@
// needs to be included earlier to set the success message in the messageStack
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_PASSWORD);
catalog/address_book_process.php
@@ -20,7 +20,7 @@
// needs to be included earlier to set the success message in the messageStack
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
@@ -270,7 +270,7 @@
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
- <td width="100%" valign="top"><?php if (!isset($HTTP_GET_VARS['delete'])) echo
tep_draw_form('addressbook', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS,
(isset($HTTP_GET_VARS['edit']) ? 'edit=' . $HTTP_GET_VARS['edit'] : ''), 'SSL'), 'post',
'onSubmit="return check_form(addressbook);"'); ?><table border="0" width="100%" cellspacing="0"
cellpadding="0">
+ <td width="100%" valign="top"><?php if (!isset($HTTP_GET_VARS['delete'])) echo
tep_draw_form('addressbook', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS,
(isset($HTTP_GET_VARS['edit']) ? 'edit=' . $HTTP_GET_VARS['edit'] : ''), 'SSL'), 'post',
'onSubmit="return check_form(addressbook);"', true); ?><table border="0" width="100%" cellspacing=
"0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
@@ -329,7 +329,7 @@
<tr>
<td width= "10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1');
?></td>
<td><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '"
>' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
- <td align= "right"><?php echo '<a href="' .
tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'] .
'&action=deleteconfirm', 'SSL') . '">' . tep_image_button('button_delete.gif',
IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
+ <td align= "right"><?php echo '<a href="' .
tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'] .
'&action=deleteconfirm&formid=' . md5($sessiontoken), 'SSL') . '">' .
tep_image_button('button_delete.gif', IMAGE_BUTTON_DELETE) . '</a>'; ?></td>
<td width= "10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1');
?></td>
</tr>
</table></td>
catalog/checkout_payment.php
@@ -138,7 +138,7 @@ function rowOutEffect(object) {
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
- <td width="100%" valign="top"><?php echo tep_draw_form('checkout_payment',
tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"
'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <td width="100%" valign="top"><?php echo tep_draw_form('checkout_payment',
tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"
', true); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
catalog/checkout_payment_address.php
@@ -28,7 +28,7 @@
$error = false;
$process = false;
- if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit')) {
+ if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit') &&
isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
// process a new billing address
if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) &&
tep_not_null($HTTP_POST_VARS['street_address'])) {
$process = true;
@@ -263,7 +263,7 @@ function check_form_optional(form_name) {
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
- <td width="100%" valign="top"><?php echo tep_draw_form('checkout_address',
tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return
check_form_optional(checkout_address);"'); ?><table border="0" width="100%" cellspacing="0"
cellpadding="0">
+ <td width="100%" valign="top"><?php echo tep_draw_form('checkout_address',
tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return
check_form_optional(checkout_address);"', true); ?><table border="0" width="100%" cellspacing="0"
cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
catalog/checkout_shipping.php
@@ -95,7 +95,7 @@
}
catalog/checkout_shipping_address.php
@@ -41,7 +41,7 @@
$error = false;
$process = false;
- if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit')) {
+ if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit') &&
isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
// process a new shipping address
if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) &&
tep_not_null($HTTP_POST_VARS['street_address'])) {
$process = true;
@@ -275,7 +275,7 @@ function check_form_optional(form_name) {
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
- <td width="100%" valign="top"><?php echo tep_draw_form('checkout_address',
tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return
check_form_optional(checkout_address);"'); ?><table border="0" width="100%" cellspacing="0"
cellpadding="0">
+ <td width="100%" valign="top"><?php echo tep_draw_form('checkout_address',
tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL'), 'post', 'onSubmit="return
check_form_optional(checkout_address);"', true); ?><table border="0" width="100%" cellspacing="0"
cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
catalog/create_account.php
@@ -16,7 +16,7 @@
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CREATE_ACCOUNT);
$process = false;
- if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process')) {
+ if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') &&
isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
$process = true;
if (ACCOUNT_GENDER == 'true') {
@@ -226,6 +226,9 @@
tep_session_register('customer_country_id');
tep_session_register('customer_zone_id');
@@ -274,7 +277,7 @@
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
- <td width="100%" valign="top"><?php echo tep_draw_form('create_account',
tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return
check_form(create_account);"') . tep_draw_hidden_field('action', 'process'); ?><table border="0"
width="100%" cellspacing="0" cellpadding="0">
+ <td width="100%" valign="top"><?php echo tep_draw_form('create_account',
tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'), 'post', 'onSubmit="return
check_form(create_account);"', true) . tep_draw_hidden_field('action', 'process'); ?><table
border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
catalog/includes/application_top.php
@@ -199,6 +199,12 @@
extract($_SESSION, EXTR_OVERWRITE+EXTR_REFS);
}
catalog/includes/functions/html_output.php
@@ -145,13 +145,19 @@
////
// Output a form
- function tep_draw_form($name, $action, $method = 'post', $parameters = '') {
+ function tep_draw_form($name, $action, $method = 'post', $parameters = '', $tokenize = false) {
+ global $sessiontoken;
+
$form = '<form name="' . tep_output_string($name) . '" action="' . tep_output_string($action)
. '" method="' . tep_output_string($method) . '"';
$form .= '>';
catalog/login.php
@@ -20,7 +20,7 @@
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
$error = false;
- if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
+ if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') &&
isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
@@ -54,6 +54,9 @@
catalog/password_forgotten.php
@@ -14,7 +14,7 @@
catalog/product_reviews_write.php
@@ -27,7 +27,7 @@
$customer_query = tep_db_query("select customers_firstname, customers_lastname from " .
TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$customer = tep_db_fetch_array($customer_query);
catalog/tell_a_friend.php
@@ -33,7 +33,7 @@
$to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
@@ -115,7 +115,7 @@
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
- <td width="100%" valign="top"><?php echo tep_draw_form('email_friend',
tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&products_id=' .
$HTTP_GET_VARS['products_id'])); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
+ <td width="100%" valign="top"><?php echo tep_draw_form('email_friend',
tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&products_id=' .
$HTTP_GET_VARS['products_id']), 'post', '', true); ?><table border="0" width="100%" cellspacing=
"0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
Validate the address being deleted is not assigned as the customers default address.
Affected Files
catalog/address_book_process.php
catalog/address_book_process.php
@@ -21,9 +21,13 @@
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
Sanitize parameters.
Affected Files
catalog/account_edit.php
catalog/address_book_process.php
catalog/admin/includes/classes/phplot.php
catalog/admin/includes/functions/compatibility.php
catalog/admin/includes/functions/html_output.php
catalog/admin/login.php
catalog/checkout_confirmation.php
catalog/checkout_payment_address.php
catalog/checkout_process.php
catalog/create_account.php
catalog/includes/application_top.php
catalog/includes/boxes/currencies.php
catalog/includes/boxes/tell_a_friend.php
catalog/includes/functions/compatibility.php
catalog/includes/functions/general.php
catalog/includes/functions/html_output.php
catalog/product_info.php
catalog/tell_a_friend.php
catalog/account_edit.php
@@ -52,7 +52,7 @@
}
if (ACCOUNT_DOB == 'true') {
- if (!checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2),
substr(tep_date_raw($dob), 0, 4))) {
+ if ((is_numeric(tep_date_raw($dob)) == false) || (@checkdate(substr(tep_date_raw($dob), 4,
2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false)) {
$error = true;
$messageStack->add('account_edit', ENTRY_DATE_OF_BIRTH_ERROR);
catalog/address_book_process.php
@@ -21,7 +21,7 @@
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
catalog/admin/includes/classes/phplot.php
@@ -672,12 +672,12 @@
$which_xpos, $which_ypos, $which_color, $which_font, $which_text);
} else {
if ($which_valign == 'top') {
- $which_ypos = $which_ypos - ImageFontHeight($which_font);
+ $which_ypos = $which_ypos - ImageFontHeight((int)$which_font);
}
$which_text = preg_replace("/\r/","",$which_text);
$str = explode("\n",$which_text); //multiple lines submitted by Remi Ricard
- $height = ImageFontHeight($which_font);
- $width = ImageFontWidth($which_font);
+ $height = ImageFontHeight((int)$which_font);
+ $width = ImageFontWidth((int)$which_font);
if ($which_angle == 90) { //Vertical Code Submitted by Marlin Viss
for($i=0;$i<count($str);$i++) {
ImageStringUp($this->img, $which_font, ($i*$height + $which_xpos), $which_ypos, $str[$i],
$which_color);
@@ -686,9 +686,9 @@
for($i=0;$i<count($str);$i++) {
if ($which_halign == 'center') {
$xpos = $which_xpos - strlen($str[$i]) * $width/2;
- ImageString($this->img, $which_font, $xpos, ($i*$height + $which_ypos), $str[$i],
$which_color);
+ ImageString($this->img, (int)$which_font, $xpos, ($i*$height + $which_ypos), $str[$i],
$which_color);
} else {
- ImageString($this->img, $which_font, $which_xpos, ($i*$height + $which_ypos), $str[$i],
$which_color);
+ ImageString($this->img, (int)$which_font, $which_xpos, ($i*$height + $which_ypos),
$str[$i], $which_color);
}
}
}
catalog/admin/includes/functions/compatibility.php
@@ -85,7 +85,7 @@
if (!function_exists('checkdnsrr')) {
function checkdnsrr($host, $type) {
if(tep_not_null($host) && tep_not_null($type)) {
- @exec("nslookup -type=$type $host", $output);
+ @exec("nslookup -type=" . escapeshellarg($type) . " " . escapeshellarg($host), $output);
while(list($k, $line) = each($output)) {
if(preg_match("/^$host/i", $line)) {
return true;
catalog/admin/includes/functions/html_output.php
@@ -13,6 +13,8 @@
////
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
+ $page = tep_output_string($page);
+
if ($page == '') {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"
><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>Function
used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection .
'\')</b>');
}
@@ -30,7 +32,7 @@
if ($parameters == '') {
$link = $link . $page . '?' . SID;
} else {
- $link = $link . $page . '?' . $parameters . '&' . SID;
+ $link = $link . $page . '?' . tep_output_string($parameters) . '&' . SID;
}
catalog/admin/login.php
@@ -69,7 +69,7 @@
$username = tep_db_prepare_input($HTTP_POST_VARS['username']);
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
tep_redirect(tep_href_link(FILENAME_LOGIN));
catalog/checkout_confirmation.php
@@ -52,7 +52,7 @@
$payment_modules->update_status();
catalog/checkout_payment_address.php
@@ -166,7 +166,7 @@
$billto = $HTTP_POST_VARS['address'];
if ($check_address['total'] == '1') {
catalog/checkout_process.php
@@ -68,7 +68,7 @@
$payment_modules->update_status();
catalog/create_account.php
@@ -77,7 +77,7 @@
}
if (ACCOUNT_DOB == 'true') {
- if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2),
substr(tep_date_raw($dob), 0, 4)) == false) {
+ if ((is_numeric(tep_date_raw($dob)) == false) || (@checkdate(substr(tep_date_raw($dob), 4,
2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false)) {
$error = true;
$messageStack->add('create_account', ENTRY_DATE_OF_BIRTH_ERROR);
catalog/includes/application_top.php
@@ -93,6 +93,7 @@
$GET_array = array();
$PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);
$vars = explode('/', substr(getenv('PATH_INFO'), 1));
+ do_magic_quotes_gpc($vars);
for ($i=0, $n=sizeof($vars); $i<$n; $i++) {
if (strpos($vars[$i], '[]')) {
$GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];
catalog/includes/boxes/currencies.php
@@ -30,7 +30,7 @@
$hidden_get_variables = '';
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
- if ( ($key != 'currency') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y')
) {
+ if ( is_string($value) && ($key != 'currency') && ($key != tep_session_name()) && ($key !=
'x') && ($key != 'y') ) {
$hidden_get_variables .= tep_draw_hidden_field($key, $value);
}
}
catalog/includes/boxes/tell_a_friend.php
@@ -22,7 +22,7 @@
$info_box_contents = array();
$info_box_contents[] = array('form' => tep_draw_form('tell_a_friend',
tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false), 'get'),
'align' => 'center',
- 'text' => tep_draw_input_field('to_email_address', '', 'size="10"
') . ' ' . tep_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) .
tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id() .
'<br>' . BOX_TELL_A_FRIEND_TEXT);
+ 'text' => tep_draw_input_field('to_email_address', '', 'size="10"
') . ' ' . tep_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) .
tep_draw_hidden_field('products_id', (int)$HTTP_GET_VARS['products_id']) . tep_hide_session_id() .
'<br>' . BOX_TELL_A_FRIEND_TEXT);
new infoBox($info_box_contents);
?>
catalog/includes/functions/compatibility.php
@@ -171,7 +171,7 @@
if (!function_exists('checkdnsrr')) {
function checkdnsrr($host, $type) {
if(tep_not_null($host) && tep_not_null($type)) {
- @exec("nslookup -type=$type $host", $output);
+ @exec("nslookup -type=" . escapeshellarg($type) . " " . escapeshellarg($host), $output);
while(list($k, $line) = each($output)) {
if(preg_match("/^$host/i", $line)) {
return true;
catalog/includes/functions/general.php
@@ -160,7 +160,7 @@
if (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) {
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
- if ( (strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') &&
(!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {
+ if ( is_string($value) && (strlen($value) > 0) && ($key != tep_session_name()) && ($key
!= 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {
$get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&';
}
}
@@ -914,7 +914,7 @@
// Return a product ID with attributes
function tep_get_uprid($prid, $params) {
if (is_numeric($prid)) {
- $uprid = $prid;
+ $uprid = (int)$prid;
if (is_numeric($pieces[0])) {
- return $pieces[0];
+ return (int)$pieces[0];
} else {
return false;
}
catalog/includes/functions/html_output.php
@@ -15,6 +15,8 @@
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id =
true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;
+ $page = tep_output_string($page);
+
if (!tep_not_null($page)) {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"
><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}
catalog/product_info.php
@@ -139,7 +139,7 @@
}
}
- if
(isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])
{
+ if (is_string($HTTP_GET_VARS['products_id']) &&
isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]))
{
$selected_attribute =
$cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
} else {
$selected_attribute = false;
catalog/tell_a_friend.php
@@ -28,7 +28,7 @@
}
if ($valid_product == false) {
- tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .
$HTTP_GET_VARS['products_id']));
+ tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int
)$HTTP_GET_VARS['products_id']));
}
$messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT,
$product_info['products_name'], tep_output_string_protected($to_name)), 'success');
- tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' .
$HTTP_GET_VARS['products_id']));
+ tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int
)$HTTP_GET_VARS['products_id']));
}
} elseif (tep_session_is_registered('customer_id')) {
$account_query = tep_db_query("select customers_firstname, customers_lastname,
customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id .
"'");
@@ -91,7 +91,7 @@
$from_email_address = $account['customers_email_address'];
}
Add support for Basic HTTP Authentication to the Administration Tool login routine. Administrator accounts can be saved in htpasswd files
using the Apache APR-MD5 algorithm. Upon successful Basic HTTP Authentication, an automatic login occurs if the authentication password
matches the administrator password stored in the database.
Affected Files
This changeset includes an update to an English language definition file. Please perform similar changes to other
languages that are also installed.
catalog/admin/administrators.php
@@ -12,6 +12,37 @@
require('includes/application_top.php');
+ $htaccess_array = null;
+ $htpasswd_array = null;
+
+ $authuserfile_array = array('##### OSCOMMERCE ADMIN PROTECTION - BEGIN #####',
+ 'AuthType Basic',
+ 'AuthName "osCommerce Online Merchant Administration Tool"',
+ 'AuthUserFile ' . DIR_FS_ADMIN . '.htpasswd_oscommerce',
+ 'Require valid-user',
+ '##### OSCOMMERCE ADMIN PROTECTION - END #####');
+
+ if (file_exists(DIR_FS_ADMIN . '.htpasswd_oscommerce') && is_writable(DIR_FS_ADMIN .
'.htpasswd_oscommerce') && file_exists(DIR_FS_ADMIN . '.htaccess') && is_writable(DIR_FS_ADMIN .
'.htaccess')) {
+ $htaccess_array = array();
+ $htpasswd_array = array();
+
+ if (filesize(DIR_FS_ADMIN . '.htaccess') > 0) {
+ $fg = fopen(DIR_FS_ADMIN . '.htaccess', 'rb');
+ $data = fread($fg, filesize(DIR_FS_ADMIN . '.htaccess'));
+ fclose($fg);
+
+ $htaccess_array = explode("\n", $data);
+ }
+
+ if (filesize(DIR_FS_ADMIN . '.htpasswd_oscommerce') > 0) {
+ $fg = fopen(DIR_FS_ADMIN . '.htpasswd_oscommerce', 'rb');
+ $data = fread($fg, filesize(DIR_FS_ADMIN . '.htpasswd_oscommerce'));
+ fclose($fg);
+
+ $htpasswd_array = explode("\n", $data);
+ }
+ }
+
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
if (tep_not_null($action)) {
@@ -26,6 +57,38 @@
if (tep_db_num_rows($check_query) < 1) {
tep_db_query( "insert into " . TABLE_ADMINISTRATORS . " (user_name, user_password)
values ('" . tep_db_input($username) . "', '" . tep_db_input(tep_encrypt_password($password)) .
"')");
+
+ if (is_array($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htpasswd_array); $i<$n; $i++) {
+ list($ht_username, $ht_password) = explode(':', $htpasswd_array[$i], 2);
+
+ if ($ht_username == $username) {
+ unset($htpasswd_array[$i]);
+ }
+ }
+
+ if (isset($HTTP_POST_VARS['htaccess']) && ($HTTP_POST_VARS['htaccess'] == 'true')) {
+ $htpasswd_array[] = $username . ':' . tep_crypt_apr_md5($password);
+ }
+
+ $fp = fopen(DIR_FS_ADMIN . '.htpasswd_oscommerce', 'w');
+ fwrite($fp, implode( "\n", $htpasswd_array));
+ fclose($fp);
+
+ if (!in_array('AuthUserFile ' . DIR_FS_ADMIN . '.htpasswd_oscommerce',
$htaccess_array) && !empty($htpasswd_array)) {
+ array_splice($htaccess_array, sizeof($htaccess_array), 0, $authuserfile_array);
+ } elseif (empty($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htaccess_array); $i<$n; $i++) {
+ if (in_array($htaccess_array[$i], $authuserfile_array)) {
+ unset($htaccess_array[$i]);
+ }
+ }
+ }
+
+ $fp = fopen(DIR_FS_ADMIN . '.htaccess', 'w');
+ fwrite($fp, implode( "\n", $htaccess_array));
+ fclose($fp);
+ }
} else {
$messageStack->add_session(ERROR_ADMINISTRATOR_EXISTS, 'error');
}
@@ -38,17 +101,75 @@
$username = tep_db_prepare_input($HTTP_POST_VARS['username']);
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
- if ($admin['id'] == $check['id']) {
+// update username in current session if changed
+ if ( ($check['id'] == $admin['id']) && ($check['user_name'] != $admin['username']) ) {
$admin['username'] = $username;
}
if (tep_not_null($password)) {
+// update password in htpasswd
+ if (is_array($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htpasswd_array); $i<$n; $i++) {
+ list($ht_username, $ht_password) = explode(':', $htpasswd_array[$i], 2);
+
+ if ($ht_username == $username) {
+ unset($htpasswd_array[$i]);
+ }
+ }
+
+ if (isset($HTTP_POST_VARS['htaccess']) && ($HTTP_POST_VARS['htaccess'] == 'true')) {
+ $htpasswd_array[] = $username . ':' . tep_crypt_apr_md5($password);
+ }
+ }
+
tep_db_query( "update " . TABLE_ADMINISTRATORS . " set user_password = '" .
tep_db_input(tep_encrypt_password($password)) . "' where id = '" . (int)$HTTP_GET_VARS['aID'] .
"'");
+ } elseif (!isset($HTTP_POST_VARS['htaccess']) || ($HTTP_POST_VARS['htaccess'] != 'true'))
{
+ if (is_array($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htpasswd_array); $i<$n; $i++) {
+ list($ht_username, $ht_password) = explode(':', $htpasswd_array[$i], 2);
+
+ if ($ht_username == $username) {
+ unset($htpasswd_array[$i]);
+ }
+ }
+ }
+ }
+
+// write new htpasswd file
+ if (is_array($htpasswd_array)) {
+ $fp = fopen(DIR_FS_ADMIN . '.htpasswd_oscommerce', 'w');
+ fwrite($fp, implode( "\n", $htpasswd_array));
+ fclose($fp);
+
+ if (!in_array('AuthUserFile ' . DIR_FS_ADMIN . '.htpasswd_oscommerce', $htaccess_array)
&& !empty($htpasswd_array)) {
+ array_splice($htaccess_array, sizeof($htaccess_array), 0, $authuserfile_array);
+ } elseif (empty($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htaccess_array); $i<$n; $i++) {
+ if (in_array($htaccess_array[$i], $authuserfile_array)) {
+ unset($htaccess_array[$i]);
+ }
+ }
+ }
+
+ $fp = fopen(DIR_FS_ADMIN . '.htaccess', 'w');
+ fwrite($fp, implode( "\n", $htaccess_array));
+ fclose($fp);
}
- if ($id == $check['id']) {
+ if ($admin['id'] == $check['id']) {
tep_session_unregister('admin');
}
tep_db_query("delete from " . TABLE_ADMINISTRATORS . " where id = '" . (int)$id . "'");
+ if (is_array($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htpasswd_array); $i<$n; $i++) {
+ list($ht_username, $ht_password) = explode(':', $htpasswd_array[$i], 2);
+
+ if ($ht_username == $check['user_name']) {
+ unset($htpasswd_array[$i]);
+ }
+ }
+
+ $fp = fopen(DIR_FS_ADMIN . '.htpasswd_oscommerce', 'w');
+ fwrite($fp, implode( "\n", $htpasswd_array));
+ fclose($fp);
+
+ if (empty($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htaccess_array); $i<$n; $i++) {
+ if (in_array($htaccess_array[$i], $authuserfile_array)) {
+ unset($htaccess_array[$i]);
+ }
+ }
+
+ $fp = fopen(DIR_FS_ADMIN . '.htaccess', 'w');
+ fwrite($fp, implode( "\n", $htaccess_array));
+ fclose($fp);
+ }
+ }
+
tep_redirect(tep_href_link(FILENAME_ADMINISTRATORS));
break;
}
}
+
+ $secMessageStack = new messageStack();
+
+ if (is_array($htpasswd_array)) {
+ if (empty($htpasswd_array)) {
+ $secMessageStack->add(sprintf(HTPASSWD_INFO, implode('<br />', $authuserfile_array)),
'error');
+ } else {
+ $secMessageStack->add(HTPASSWD_SECURED, 'success');
+ }
+ } else {
+ $secMessageStack->add(HTPASSWD_PERMISSIONS, 'error');
+ }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
@@ -102,11 +261,19 @@
</table></td>
</tr>
<tr>
+ <td>
+<?php
+ echo $secMessageStack->output();
+?>
+ </td>
+ </tr>
+ <tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign= "top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr class= "dataTableHeadingRow">
<td class= "dataTableHeadingContent"><?php echo TABLE_HEADING_ADMINISTRATORS;
?></td>
+ <td class= "dataTableHeadingContent" align="center"><?php echo
TABLE_HEADING_HTPASSWD; ?></td>
<td class= "dataTableHeadingContent" align="right"><?php echo
TABLE_HEADING_ACTION; ?> </td>
</tr>
<?php
@@ -116,6 +283,19 @@
$aInfo = new objectInfo($admins);
}
+ $htpasswd_secured = tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Not Secured', 10, 10);
+
+ if (is_array($htpasswd_array)) {
+ for ($i=0, $n=sizeof($htpasswd_array); $i<$n; $i++) {
+ list($ht_username, $ht_password) = explode(':', $htpasswd_array[$i], 2);
+
+ if ($ht_username == $admins['user_name']) {
+ $htpasswd_secured = tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', 'Secured', 10,
10);
+ break;
+ }
+ }
+ }
+
if ( (isset($aInfo) && is_object($aInfo)) && ($admins['id'] == $aInfo->id) ) {
echo ' <tr id= "defaultSelected" class="dataTableRowSelected" onmouseover=
"rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' .
tep_href_link(FILENAME_ADMINISTRATORS, 'aID=' . $aInfo->id . '&action=edit') . '\'">' . "\n";
} else {
@@ -123,13 +303,14 @@
}
?>
<td class= "dataTableContent"><?php echo $admins['user_name']; ?></td>
+ <td class= "dataTableContent" align="center"><?php echo $htpasswd_secured; ?></td>
<td class= "dataTableContent" align="right"><?php if ( (isset($aInfo) &&
is_object($aInfo)) && ($admins['id'] == $aInfo->id) ) { echo tep_image(DIR_WS_IMAGES .
'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ADMINISTRATORS,
'aID=' . $admins['id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) .
'</a>'; } ?> </td>
</tr>
<?php
}
?>
<tr>
- <td colspan= "2" align="right"><?php echo '<a href="' .
tep_href_link(FILENAME_ADMINISTRATORS, 'action=new') . '">' .
tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
+ <td colspan= "3" align="right"><?php echo '<a href="' .
tep_href_link(FILENAME_ADMINISTRATORS, 'action=new') . '">' .
tep_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
</tr>
</table></td>
<?php
@@ -140,19 +321,40 @@
case 'new':
$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_ADMINISTRATOR . '</b>');
catalog/admin/includes/application_top.php
@@ -135,6 +135,13 @@
$current_page = basename($PHP_SELF);
+// if the first page request is to the login page, set the current page to the index page
+// so the redirection on a successful login is not made to the login page again
+ if ( ($current_page == FILENAME_LOGIN) && !tep_session_is_registered('redirect_origin') ) {
+ $current_page = FILENAME_DEFAULT;
+ $HTTP_GET_VARS = array();
+ }
+
if ($current_page != FILENAME_LOGIN) {
if (!tep_session_is_registered('redirect_origin')) {
tep_session_register('redirect_origin');
@@ -143,6 +150,14 @@
'get' => $HTTP_GET_VARS);
}
+// try to automatically login with the HTTP Authentication values if it exists
+ if (!tep_session_is_registered('auth_ignore')) {
+ if (isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) &&
!empty($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) &&
!empty($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
+ $redirect_origin['auth_user'] = $HTTP_SERVER_VARS['PHP_AUTH_USER'];
+ $redirect_origin['auth_pw'] = $HTTP_SERVER_VARS['PHP_AUTH_PW'];
+ }
+ }
+
$redirect = true;
}
@@ -151,7 +166,7 @@
}
if ($redirect == true) {
- tep_redirect(tep_href_link(FILENAME_LOGIN));
+ tep_redirect(tep_href_link(FILENAME_LOGIN, (isset($redirect_origin['auth_user']) ?
'action=process' : '')));
}
unset($redirect);
catalog/admin/includes/functions/password_funcs.php
@@ -43,4 +43,67 @@
return $password;
}
+
+////
+// This function produces a crypted string using the APR-MD5 algorithm
+// Source: http://www.php.net/crypt
+ function tep_crypt_apr_md5($password, $salt = null) {
+ if (empty($salt)) {
+ $salt_string = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
+
+ $salt = '';
+
+ for ($i = 0; $i < 8; $i++) {
+ $salt .= $salt_string[rand(0, 61)];
+ }
+ }
+
+ $len = strlen($password);
+
+ $result = $password . '$apr1$' . $salt;
+
+ $bin = pack('H32', md5($password . $salt . $password));
+
+ for ($i=$len; $i>0; $i-=16) {
+ $result .= substr($bin, 0, min(16, $i));
+ }
+
+ for ($i=$len; $i>0; $i>>= 1) {
+ $result .= ($i & 1) ? chr(0) : $password[0];
+ }
+
+ $bin = pack('H32', md5($result));
+
+ for ($i=0; $i<1000; $i++) {
+ $new = ($i & 1) ? $password : $bin;
+
+ if ($i % 3) {
+ $ new .= $salt;
+ }
+
+ if ($i % 7) {
+ $ new .= $password;
+ }
+
+ $new .= ($i & 1) ? $bin : $password;
+
+ $bin = pack('H32', md5($new));
+ }
+
+ for ($i=0; $i<5; $i++) {
+ $k = $i + 6;
+ $j = $i + 12;
+
+ if ($j == 16) {
+ $j = 5;
+ }
+
+ $tmp = $bin[$i] . $bin[$k] . $bin[$j] . $tmp;
+ }
+
+ $tmp = chr(0) . chr(0) . $bin[11] . $tmp;
+ $tmp = strtr(strrev(substr(base64_encode($tmp), 2)),
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
'./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
+
+ return '$apr1$' . $salt . '$' . $tmp;
+ }
?>
catalog/admin/includes/languages/english/administrators.php
@@ -13,6 +13,7 @@
define('HEADING_TITLE', 'Administrators');
define('TABLE_HEADING_ADMINISTRATORS', 'Administrators');
+define('TABLE_HEADING_HTPASSWD', 'Secured by htpasswd');
define('TABLE_HEADING_ACTION', 'Action');
define('TEXT_INFO_INSERT_INTRO', 'Please enter the new administrator with its related data');
@@ -22,6 +23,11 @@ define('TEXT_INFO_HEADING_NEW_ADMINISTRATOR', 'New Administrator');
define('TEXT_INFO_USERNAME', 'Username:');
define('TEXT_INFO_NEW_PASSWORD', 'New Password:');
define('TEXT_INFO_PASSWORD', 'Password:');
+define('TEXT_INFO_PROTECT_WITH_HTPASSWD', 'Protect With htaccess/htpasswd');
catalog/admin/login.php
@@ -17,11 +17,21 @@
+// prepare to logout an active administrator if the login page is accessed again
+ if (tep_session_is_registered('admin')) {
+ $action = 'logoff';
+ }
+
if (tep_not_null($action)) {
switch ($action) {
case 'process':
- $username = tep_db_prepare_input($HTTP_POST_VARS['username']);
- $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+ if (tep_session_is_registered('redirect_origin') && isset($redirect_origin['auth_user']))
{
+ $username = tep_db_prepare_input($redirect_origin['auth_user']);
+ $password = tep_db_prepare_input($redirect_origin['auth_pw']);
+ } else {
+ $username = tep_db_prepare_input($HTTP_POST_VARS['username']);
+ $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
+ }
@@ -58,6 +68,12 @@
case 'logoff':
tep_session_unregister('selected_box');
tep_session_unregister('admin');
+
+ if (isset($HTTP_SERVER_VARS['PHP_AUTH_USER']) &&
!empty($HTTP_SERVER_VARS['PHP_AUTH_USER']) && isset($HTTP_SERVER_VARS['PHP_AUTH_PW']) &&
!empty($HTTP_SERVER_VARS['PHP_AUTH_PW'])) {
+ tep_session_register('auth_ignore');
+ $auth_ignore = true;
+ }
+
tep_redirect(tep_href_link(FILENAME_DEFAULT));
break;
Generare a new shopping cart ID (cartID) when restoring products stored in the database.
Affected Files
catalog/includes/classes/shopping_cart.php
catalog/includes/classes/shopping_cart.php
@@ -56,6 +56,9 @@
}
$this->cleanup();
+
+// assign a temporary unique ID to the order contents to prevent hack attempts during the
checkout procedure
+ $this->cartID = $this->generate_cart_id();
}
Fix a rare instance of the navigation history content being damaged in the session.
Affected Files
catalog/includes/application_top.php
catalog/includes/application_top.php
@@ -306,7 +306,7 @@
}
// navigation history
- if (tep_session_is_registered('navigation')) {
+ if (tep_session_is_registered('navigation') && is_object($navigation)) {
if (PHP_VERSION < 4) {
$broken_navigation = $navigation;
$navigation = new navigationHistory;
Affected Files
catalog/admin/includes/functions/validations.php
catalog/admin/includes/tld.txt --- (deleted)
catalog/includes/functions/validations.php
catalog/includes/tld.txt --- (deleted)
catalog/admin/includes/functions/validations.php
@@ -21,102 +21,53 @@
//
// Description : function for validating email address that conforms to RFC 822 specs
//
- // This function is converted from a JavaScript written by
- // Sandeep V. Tamhankar ([email protected]). The original JavaScript
- // is available at http://javascript.internet.com
+ // This function will first attempt to validate the Email address using the filter
+ // extension for performance. If this extension is not available it will
+ // fall back to a regex based validator which doesn't validate all RFC822
+ // addresses but catches 99.9% of them. The regex is based on the code found at
+ // http://www.regular-expressions.info/email.html
+ //
+ // Optional validation for validating the domain name is also valid is supplied
+ // and can be enabled using the administration tool.
//
// Sample Valid Addresses:
//
// [email protected]
// [email protected]
- // "first last"@host.com
- // "first@last"@host.com
// [email protected]
- // first.last@[123.123.123.123]
+ // [email protected]
//
// Invalid Addresses:
//
// first [email protected]
- //
+ // first@[email protected]
//
////////////////////////////////////////////////////////////////////////////////////////////////
function tep_validate_email($email) {
- $valid_address = true;
-
- $mail_pat = '/^(.+)@(.+)$/i';
- $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
- $atom = "$valid_chars+";
- $quoted_user='(\"[^\"]*\")';
- $word = "($atom|$quoted_user)";
- $user_pat = "/^$word(\.$word)*$/i";
- $ip_domain_pat='/^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$/i';
- $domain_pat = "/^$atom(\.$atom)*$/i";
+ $email = trim($email);
+ if (strlen($email) > 255) {
+ $valid_address = false;
+ } elseif (function_exists('filter_var') && defined('FILTER_VALIDATE_EMAIL')) {
catalog/includes/functions/validations.php
@@ -21,102 +21,55 @@
//
// Description : function for validating email address that conforms to RFC 822 specs
//
- // This function is converted from a JavaScript written by
- // Sandeep V. Tamhankar ([email protected]). The original JavaScript
- // is available at http://javascript.internet.com
+ // This function will first attempt to validate the Email address using the filter
+ // extension for performance. If this extension is not available it will
+ // fall back to a regex based validator which doesn't validate all RFC822
+ // addresses but catches 99.9% of them. The regex is based on the code found at
+ // http://www.regular-expressions.info/email.html
//
+ // Optional validation for validating the domain name is also valid is supplied
+ // and can be enabled using the administration tool.
+ //
// Sample Valid Addresses:
//
// [email protected]
// [email protected]
- // "first last"@host.com
- // "first@last"@host.com
// [email protected]
- // first.last@[123.123.123.123]
+ // [email protected]
//
// Invalid Addresses:
//
// first [email protected]
+ // first@[email protected]
//
- //
////////////////////////////////////////////////////////////////////////////////////////////////
function tep_validate_email($email) {
- $valid_address = true;
+ $email = trim($email);
- $mail_pat = '/^(.+)@(.+)$/i';
- $valid_chars = "[(AC) (UP) Improve Validation of E-Mail Addresses^] \(\)<>@,;:\.\\\"\[]";
- $atom = "$valid_chars+";
- $quoted_user='(\"[(AC) (UP) Improve Validation of E-Mail Addresses^\"]*\")';
- $word = "($atom|$quoted_user)";
- $user_pat = "/^$word(\.$word)*$/i";
- $ip_domain_pat='/^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$/i';
- $domain_pat = "/^$atom(\.$atom)*$/i";
-
- if (preg_match($mail_pat, $email, $components)) {
- $user = $components[1];
- $domain = $components[2];
- // validate user
- if (preg_match($user_pat, $user)) {
- // validate domain
- if (preg_match($ip_domain_pat, $domain, $ip_components)) {
- // this is an IP address
- for ($i=1;$i<=4;$i++) {
- if ($ip_components[$i] > 255) {
- $valid_address = false;
- break;
- }
- }
- }
- else {
- // Domain is a name, not an IP
- if (preg_match($domain_pat, $domain)) {
- /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
- and that there's a hostname preceding the domain or country. */
- $domain_components = explode( ".", $domain);
- // Make sure there's a host name preceding the domain.
- if (sizeof($domain_components) < 2) {
- $valid_address = false;
- } else {
- $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
- // Allow all 2-letter TLDs (ccTLDs)
- if (preg_match('/^[a-z][a-z]$/i', $top_level_domain) != 1) {
- $tld_pattern = '';
- // Get authorized TLDs from text file
- $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
- while (list(,$line) = each($tlds)) {
- // Get rid of comments
- $words = explode('#', $line);
- $tld = trim($words[0]);
- // TLDs should be 3 letters or more
- if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) {
- $tld_pattern .= '^' . $tld . '$|';
- }
- }
- // Remove last '|'
- $tld_pattern = substr($tld_pattern, 0, -1);
- if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) {
- $valid_address = false;
- }
- }
- }
- }
- else {
- $valid_address = false;
- }
- }
+ if ( strlen($email) > 255 ) {
+ $valid_address = false;
+ } elseif ( function_exists('filter_var') && defined('FILTER_VALIDATE_EMAIL') ) {
+ $valid_address = (bool)filter_var($email, FILTER_VALIDATE_EMAIL);
+ } else {
+ if ( substr_count( $email, '@' ) > 1 ) {
+ $valid_address = false;
}
- else {
+
+ if ( preg_match(
"/[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](
, $email) ) {
+ $valid_address = true;
+ } else {
$valid_address = false;
}
}
- else {
- $valid_address = false;
- }
+
if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {
- if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) {
+ $domain = explode('@', $email);
+
+ if ( !checkdnsrr($domain[1], "MX") && !checkdnsrr($domain[1], "A") ) {
$valid_address = false;
}
}
+
return $valid_address;
}
?>
Affected Files
catalog/admin/includes/graphs/banner_infobox.php
catalog/admin/includes/languages/english/modules/index/customers.php
catalog/admin/includes/languages/english/server_info.php
catalog/includes/functions/general.php
catalog/index.php
This changeset includes an update to an English language definition file. Please perform similar changes to other
languages that are also installed.
catalog/admin/includes/graphs/banner_infobox.php
@@ -36,7 +36,7 @@
$graph->SetMarginsPixels(15,15,15,30);
$graph->SetTitleFontSize('4');
- $graph->SetTitle('TEXT_BANNERS_LAST_3_DAYS');
+ $graph->SetTitle(TEXT_BANNERS_LAST_3_DAYS);
$graph->SetDataValues($stats);
$graph->SetDataColors(array('blue','red'),array('blue', 'red'));
catalog/admin/includes/languages/english/modules/index/customers.php
@@ -10,6 +10,6 @@
Released under the GNU General Public License
*/
-define(ADMIN_INDEX_CUSTOMERS_TITLE, 'Customers');
-define(ADMIN_INDEX_CUSTOMERS_DATE, 'Date');
+define('ADMIN_INDEX_CUSTOMERS_TITLE', 'Customers');
+define('ADMIN_INDEX_CUSTOMERS_DATE', 'Date');
?>
catalog/admin/includes/languages/english/server_info.php
catalog/includes/functions/general.php
@@ -1012,7 +1012,7 @@
if (SEND_EMAILS != 'true') return false;
catalog/index.php
@@ -16,8 +16,8 @@
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " .
TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
- $cateqories_products = tep_db_fetch_array($categories_products_query);
- if ($cateqories_products['total'] > 0) {
+ $categories_products = tep_db_fetch_array($categories_products_query);
+ if ($categories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES .
" where parent_id = '" . (int)$current_category_id . "'");
The Administration Tool Define Languages page has been updated to list recursive files containing language definitions. This allows
language definitions for modules to also be updated.
Affected Files
catalog/admin/define_language.php
catalog/admin/includes/languages/english/define_language.php
This changeset includes an update to an English language definition file. Please perform similar changes to other
languages that are also installed.
catalog/admin/define_language.php
@@ -12,38 +12,38 @@
require('includes/application_top.php');
- if (tep_not_null($action)) {
- switch ($action) {
- case 'save':
- if (isset($HTTP_GET_VARS['lngdir']) && isset($HTTP_GET_VARS['filename'])) {
- if ($HTTP_GET_VARS['filename'] == $HTTP_GET_VARS['lngdir'] . '.php') {
- $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
- } else {
- $file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'] . '/' .
$HTTP_GET_VARS['filename'];
- }
+ $result = array();
- if (file_exists($file)) {
- if (file_exists('bak' . $file)) {
- @unlink('bak' . $file);
- }
+ if ($handle = opendir($path)) {
+ while (false !== ($filename = readdir($handle))) {
+ if (!in_array($filename, $exclude_array)) {
+ $file = array('name' => $path . $filename,
+ 'is_dir' => is_dir($path . $filename),
+ 'writable' => is_writable($path . $filename),
+ 'size' => filesize($path . $filename),
+ 'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($path .
$filename)));
if (file_exists($file)) {
$file_array = file($file);
$contents = implode('', $file_array);
$file_writeable = true;
- if (!is_writeable($file)) {
+ if (!is_writable($file)) {
$file_writeable = false;
$messageStack->reset();
$messageStack->add(sprintf(ERROR_FILE_NOT_WRITEABLE, $file), 'error');
@@ -111,12 +137,12 @@
?>
<tr><?php echo tep_draw_form('language', FILENAME_DEFINE_LANGUAGE, 'lngdir=' .
$HTTP_GET_VARS['lngdir'] . '&filename=' . $HTTP_GET_VARS['filename'] . '&action=save'); ?>
- <td><table border= "0" cellspacing="0" cellpadding="2">
+ <td><table border= "0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class= "main"><b><?php echo $HTTP_GET_VARS['filename']; ?></b></td>
</tr>
<tr>
- <td class= "main"><?php echo tep_draw_textarea_field('file_contents', 'soft',
'80', '20', $contents, (($file_writeable) ? '' : 'readonly')); ?></td>
+ <td class= "main"><?php echo tep_draw_textarea_field('file_contents', 'soft',
'80', '25', $contents, (($file_writeable) ? '' : 'readonly') . ' style="width: 100%;"'); ?></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
@@ -126,6 +152,12 @@
</tr>
</table></td>
</form></tr>
+ <tr>
+ <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
+ </tr>
+ <tr>
+ <td class= "main"><?php echo TEXT_EDIT_NOTE; ?></td>
+ </tr>
<?php
} else {
?>
@@ -142,26 +174,31 @@
}
} else {
$filename = $HTTP_GET_VARS['lngdir'] . '.php';
+ $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
?>
<tr>
- <td><table width= "100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td class= "smallText"><a href="<?php echo tep_href_link(FILENAME_DEFINE_LANGUAGE,
'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' . $filename); ?>"><b><?php echo $filename;
?></b></a></td>
+ <td><table border= "0" width="100%" cellspacing="0" cellpadding="2">
+ <tr class= "dataTableHeadingRow">
+ <td class= "dataTableHeadingContent"><?php echo TABLE_HEADING_FILES; ?></td>
+ <td class= "dataTableHeadingContent" align="center"><?php echo
TABLE_HEADING_WRITABLE; ?></td>
+ <td class= "dataTableHeadingContent" align="right"><?php echo
TABLE_HEADING_LAST_MODIFIED; ?></td>
+ </tr>
+ <tr class= "dataTableRow" onmouseover="rowOverEffect(this)" onmouseout=
"rowOutEffect(this)">
+ <td class= "dataTableContent"><a href="<?php echo
tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' .
$filename); ?>"><b><?php echo $filename; ?></b></a></td>
+ <td class= "dataTableContent" align="center"><?php echo tep_image(DIR_WS_IMAGES .
'icons/' . ((is_writable(DIR_FS_CATALOG_LANGUAGES . $filename) == true) ? 'tick.gif' :
'cross.gif')); ?></td>
+ <td class= "dataTableContent" align="right"><?php echo strftime(DATE_TIME_FORMAT,
filemtime(DIR_FS_CATALOG_LANGUAGES . $filename)); ?></td>
+ </tr>
<?php
- $left = false;
- if ($dir = dir(DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir'])) {
- $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
- while ($file = $dir->read()) {
- if (substr($file, strrpos($file, '.')) == $file_extension) {
- echo ' <td class= "smallText"><a href="' .
tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' .
$file) . '">' . $file . '</a></td>' . "\n";
- if (!$left) {
- echo ' </tr>' . "\n" .
- ' <tr>' . "\n";
- }
- $left = !$left;
- }
+ foreach (tep_opendir(DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['lngdir']) as $file) {
+ if (substr($file['name'], strrpos($file['name'], '.')) == $file_extension) {
+ $filename = substr($file['name'], strlen(DIR_FS_CATALOG_LANGUAGES));
+
+ echo ' <tr class= "dataTableRow" onmouseover="rowOverEffect(this)"
onmouseout="rowOutEffect(this)">' .
+ ' <td class= "dataTableContent"><a href="' .
tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' .
$filename) . '">' . substr($filename, strlen($HTTP_GET_VARS['lngdir'] . '/')) . '</a></td>' .
+ ' <td class= "dataTableContent" align="center">' .
tep_image(DIR_WS_IMAGES . 'icons/' . (($file['writable'] == true) ? 'tick.gif' : 'cross.gif')) .
'</td>' .
+ ' <td class= "dataTableContent" align="right">' .
$file['last_modified'] . '</td>' .
+ ' </tr>';
}
- $dir->close();
}
?>
</tr>
catalog/admin/includes/languages/english/define_language.php
@@ -10,7 +10,13 @@
Released under the GNU General Public License
*/
Verify the combination of product attributes when adding products to the shopping cart.
Affected Files
catalog/includes/classes/shopping_cart.php
catalog/includes/classes/shopping_cart.php
@@ -90,14 +90,22 @@
$attributes_pass_check = true;
- if (is_array($attributes)) {
+ if (is_array($attributes) && !empty($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
if (!is_numeric($option) || !is_numeric($value)) {
$attributes_pass_check = false;
break;
+ } else {
+ $check_query = tep_db_query( "select products_attributes_id from " .
TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '"
. (int)$option . "' and options_values_id = '" . (int)$value . "' limit 1");
+ if (tep_db_num_rows($check_query) < 1) {
+ $attributes_pass_check = false;
+ break;
+ }
}
}
+ } elseif (tep_has_product_attributes($products_id)) {
+ $attributes_pass_check = false;
}
Affected Files
catalog/admin/includes/application_top.php
catalog/admin/includes/classes/sessions.php --- (deleted)
catalog/admin/includes/functions/compatibility.php
catalog/admin/includes/functions/general.php
catalog/admin/whos_online.php
catalog/includes/application_top.php
catalog/includes/classes/sessions.php --- (deleted)
catalog/includes/functions/compatibility.php
catalog/admin/includes/application_top.php
@@ -78,15 +78,6 @@
// include shopping cart class
require(DIR_WS_CLASSES . 'shopping_cart.php');
-// check to see if php implemented session management functions - if not, include php3/php4
compatible session class
- if (!function_exists('session_start')) {
- define('PHP_SESSION_NAME', 'osCAdminID');
- define('PHP_SESSION_PATH', '/');
- define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
-
- include(DIR_WS_CLASSES . 'sessions.php');
- }
-
// define how the session functions will be used
require(DIR_WS_FUNCTIONS . 'sessions.php');
catalog/admin/includes/functions/compatibility.php
@@ -54,34 +54,6 @@
date_default_timezone_set(@date_default_timezone_get());
}
- if (!function_exists('is_numeric')) {
- function is_numeric($param) {
- return preg_match("/^[0-9]{1,50}.?[0-9]{0,50}$/", $param);
- }
- }
-
- if (!function_exists('is_uploaded_file')) {
- function is_uploaded_file($filename) {
- if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
- $tmp_file = dirname(tempnam('', ''));
- }
-
- if (strchr($tmp_file, '/')) {
- if (substr($tmp_file, -1) != '/') $tmp_file .= '/';
- } elseif (strchr($tmp_file, '\\')) {
- if (substr($tmp_file, -1) != '\\') $tmp_file .= '\\';
- }
-
- return file_exists($tmp_file . basename($filename));
- }
- }
-
- if (!function_exists('move_uploaded_file')) {
- function move_uploaded_file($file, $target) {
- return copy($file, $target);
- }
- }
-
if (!function_exists('checkdnsrr')) {
function checkdnsrr($host, $type) {
if(tep_not_null($host) && tep_not_null($type)) {
@@ -96,79 +68,6 @@
}
}
- if (!function_exists('in_array')) {
- function in_array($lookup_value, $lookup_array) {
- reset($lookup_array);
- while (list($key, $value) = each($lookup_array)) {
- if ($value == $lookup_value) return true;
- }
-
- return false;
- }
- }
-
- if (!function_exists('array_merge')) {
- function array_merge($array1, $array2, $array3 = '') {
- if ($array3 == '') $array3 = array();
-
- while (list($key, $val) = each($array1)) $array_merged[$key] = $val;
- while (list($key, $val) = each($array2)) $array_merged[$key] = $val;
-
- if (sizeof($array3) > 0) while (list($key, $val) = each($array3)) $array_merged[$key] =
$val;
-
- return (array)$array_merged;
- }
- }
-
- if (!function_exists('array_shift')) {
- function array_shift(&$array) {
- $i = 0;
- $shifted_array = array();
- reset($array);
- while (list($key, $value) = each($array)) {
- if ($i > 0) {
- $shifted_array[$key] = $value;
- } else {
- $ return = $array[$key];
- }
- $i++;
- }
- $array = $shifted_array;
-
- return $return;
- }
- }
-
- if (!function_exists('array_reverse')) {
- function array_reverse($array) {
- $reversed_array = array();
-
- for ($i=sizeof($array)-1; $i>=0; $i--) {
- $reversed_array[] = $array[$i];
- }
-
- return $reversed_array;
- }
- }
-
- if (!function_exists('array_slice')) {
- function array_slice($array, $offset, $length = '0') {
- $length = abs($length);
-
- if ($length == 0) {
- $high = sizeof($array);
- } else {
- $high = $offset+$length;
- }
-
- for ($i=$offset; $i<$high; $i++) {
- $new_array[$i-$offset] = $array[$i];
- }
-
- return $new_array;
- }
- }
-
/*
* http_build_query() natively supported from PHP 5.0
* From Pear::PHP_Compat
catalog/admin/includes/functions/general.php
@@ -1123,12 +1123,7 @@
////
// Wrapper function for round() for php3 compatibility
function tep_round($value, $precision) {
- if (PHP_VERSION < 4) {
- $exp = pow(10, $precision);
- return round($value * $exp) / $exp;
- } else {
- return round($value, $precision);
- }
+ return round($value, $precision);
}
////
@@ -1193,8 +1188,6 @@
function tep_call_function($function, $parameter, $object = '') {
if ($object == '') {
return call_user_func($function, $parameter);
- } elseif (PHP_VERSION < 4) {
- return call_user_method($function, $object, $parameter);
} else {
return call_user_func(array($object, $function), $parameter);
}
catalog/admin/whos_online.php
@@ -112,19 +112,11 @@
}
if ($length = strlen($session_data)) {
- if (PHP_VERSION < 4) {
- $start_id = strpos($session_data, 'customer_id[==]s');
- $start_cart = strpos($session_data, 'cart[==]o');
- $start_currency = strpos($session_data, 'currency[==]s');
- $start_country = strpos($session_data, 'customer_country_id[==]s');
- $start_zone = strpos($session_data, 'customer_zone_id[==]s');
- } else {
- $start_id = strpos($session_data, 'customer_id|s');
- $start_cart = strpos($session_data, 'cart|O');
- $start_currency = strpos($session_data, 'currency|s');
- $start_country = strpos($session_data, 'customer_country_id|s');
- $start_zone = strpos($session_data, 'customer_zone_id|s');
- }
+ $start_id = strpos($session_data, 'customer_id|s');
+ $start_cart = strpos($session_data, 'cart|O');
+ $start_currency = strpos($session_data, 'currency|s');
+ $start_country = strpos($session_data, 'customer_country_id|s');
+ $start_zone = strpos($session_data, 'customer_zone_id|s');
- if (PHP_VERSION < 4) {
- $broken_cart = $cart;
- $cart = new shoppingCart;
- $cart->unserialize($broken_cart);
- }
-
if (is_object($cart)) {
$products = $cart->get_products();
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
catalog/includes/application_top.php
@@ -128,16 +128,6 @@
// include navigation history class
require(DIR_WS_CLASSES . 'navigation_history.php');
-// check if sessions are supported, otherwise use the php3 compatible session class
- if (!function_exists('session_start')) {
- define('PHP_SESSION_NAME', 'osCsid');
- define('PHP_SESSION_PATH', $cookie_path);
- define('PHP_SESSION_DOMAIN', $cookie_domain);
- define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);
-
- include(DIR_WS_CLASSES . 'sessions.php');
- }
-
// define how the session functions will be used
require(DIR_WS_FUNCTIONS . 'sessions.php');
@@ -251,14 +241,8 @@
}
}
-// create the shopping cart & fix the cart if necesary
- if (tep_session_is_registered('cart') && is_object($cart)) {
- if (PHP_VERSION < 4) {
- $broken_cart = $cart;
- $cart = new shoppingCart;
- $cart->unserialize($broken_cart);
- }
- } else {
+// create the shopping cart
+ if (!tep_session_is_registered('cart') || !is_object($cart)) {
tep_session_register('cart');
$cart = new shoppingCart;
}
@@ -306,13 +290,7 @@
}
// navigation history
- if (tep_session_is_registered('navigation') && is_object($navigation)) {
- if (PHP_VERSION < 4) {
- $broken_navigation = $navigation;
- $navigation = new navigationHistory;
- $navigation->unserialize($broken_navigation);
- }
- } else {
+ if (!tep_session_is_registered('navigation') || !is_object($navigation)) {
tep_session_register('navigation');
$navigation = new navigationHistory;
}
@@ -342,22 +320,7 @@
if (in_array($HTTP_POST_VARS['products_id'][$i],
(is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {
$cart->remove($HTTP_POST_VARS['products_id'][$i]);
} else {
- if (PHP_VERSION < 4) {
- // if PHP3, make correction for lack of multidimensional
array.
- reset($HTTP_POST_VARS);
- while (list($key, $value) = each($HTTP_POST_VARS)) {
- if (is_array($value)) {
- while (list($key2, $value2) = each($value)) {
- if (preg_match ("/(.*)\]\[(.*)/", $key2, $var)) {
- $id2[$ var[1]][$var[2]] = $value2;
- }
- }
- }
- }
- $attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ?
$id2[$HTTP_POST_VARS['products_id'][$i]] : '';
- } else {
- $attributes =
($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ?
$HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';
- }
+ $attributes =
($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ?
$HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';
$cart->add_cart($HTTP_POST_VARS['products_id'][$i],
$HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);
}
}
catalog/includes/functions/compatibility.php
@@ -54,120 +54,6 @@
date_default_timezone_set(@date_default_timezone_get());
}
- if (!function_exists('array_splice')) {
- function array_splice(&$array, $maximum) {
- if (sizeof($array) >= $maximum) {
- for ($i=0; $i<$maximum; $i++) {
- $new_array[$i] = $array[$i];
- }
- $array = $new_array;
- }
- }
- }
-
- if (!function_exists('in_array')) {
- function in_array($lookup_value, $lookup_array) {
- reset($lookup_array);
- while (list($key, $value) = each($lookup_array)) {
- if ($value == $lookup_value) return true;
- }
-
- return false;
- }
- }
-
- if (!function_exists('array_reverse')) {
- function array_reverse($array) {
- for ($i=0, $n=sizeof($array); $i<$n; $i++) $array_reversed[$i] = $array[($n-$i-1)];
-
- return $array_reversed;
- }
- }
-
- if (!function_exists('constant')) {
- function constant($constant) {
- eval("\$temp=$constant;");
-
- return $temp;
- }
- }
-
- if (!function_exists('is_null')) {
- function is_null($value) {
- if (is_array($value)) {
- if (sizeof($value) > 0) {
- return false;
- } else {
- return true;
- }
- } else {
- if (($value != '') && ($value != 'NULL') && (strlen(trim($value)) > 0)) {
- return false;
- } else {
- return true;
- }
- }
- }
- }
-
- if (!function_exists('array_merge')) {
- function array_merge($array1, $array2, $array3 = '') {
- if (empty($array3) && !is_array($array3)) $array3 = array();
- while (list($key, $val) = each($array1)) $array_merged[$key] = $val;
- while (list($key, $val) = each($array2)) $array_merged[$key] = $val;
- if (sizeof($array3) > 0) while (list($key, $val) = each($array3)) $array_merged[$key] =
$val;
-
- return (array) $array_merged;
- }
- }
-
- if (!function_exists('is_numeric')) {
- function is_numeric($param) {
- return preg_match('/^[0-9]{1,50}.?[0-9]{0,50}$/', $param);
- }
- }
-
- if (!function_exists('array_slice')) {
- function array_slice($array, $offset, $length = 0) {
- if ($offset < 0 ) {
- $offset = sizeof($array) + $offset;
- }
- $length = ((!$length) ? sizeof($array) : (($length < 0) ? sizeof($array) - $length :
$length + $offset));
- for ($i = $offset; $i<$length; $i++) {
- $tmp[] = $array[$i];
- }
-
- return $tmp;
- }
- }
-
- if (!function_exists('array_map')) {
- function array_map($callback, $array) {
- if (is_array($array)) {
- $_new_array = array();
- reset($array);
- while (list($key, $value) = each($array)) {
- $_new_array[$key] = array_map($callback, $array[$key]);
- }
- return $_new_array;
- } else {
- return $callback($array);
- }
- }
- }
-
- if (!function_exists('str_repeat')) {
- function str_repeat($string, $number) {
- $repeat = '';
-
- for ($i=0; $i<$number; $i++) {
- $repeat .= $string;
- }
-
- return $repeat;
- }
- }
-
if (!function_exists('checkdnsrr')) {
function checkdnsrr($host, $type) {
if(tep_not_null($host) && tep_not_null($type)) {
Improve how IP-Addresses are retrieved and add support for multiple proxy servers.
Affected Files
catalog/admin/includes/functions/general.php
catalog/includes/functions/general.php
catalog/admin/includes/functions/general.php
@@ -1296,4 +1296,64 @@
return $tmp_array;
}
+
+ function tep_validate_ip_address($ip_address) {
+ if (function_exists('filter_var') && defined('FILTER_VALIDATE_IP')) {
+ return filter_var($ip_address, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4));
+ }
+
+ if (preg_match('/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ip_address)) {
+ $parts = explode('.', $ip_address);
+
+ foreach ($parts as $ip_parts) {
+ if ( (intval($ip_parts) > 255) || (intval($ip_parts) < 0) ) {
+ return false; // number is not within 0-255
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ function tep_get_ip_address() {
+ global $HTTP_SERVER_VARS;
+
+ $ip_address = null;
+ $ip_addresses = array();
+
+ if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']) &&
!empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
+ foreach ( array_reverse(explode(',', $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) as $x_ip )
{
+ $x_ip = trim($x_ip);
+
+ if (tep_validate_ip_address($x_ip)) {
+ $ip_addresses[] = $x_ip;
+ }
+ }
+ }
+
+ if (isset($HTTP_SERVER_VARS['HTTP_CLIENT_IP']) &&
!empty($HTTP_SERVER_VARS['HTTP_CLIENT_IP'])) {
+ $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_CLIENT_IP'];
+ }
+
+ if (isset($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP']) &&
!empty($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP'])) {
+ $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP'];
+ }
+
+ if (isset($HTTP_SERVER_VARS['HTTP_PROXY_USER']) &&
!empty($HTTP_SERVER_VARS['HTTP_PROXY_USER'])) {
+ $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_PROXY_USER'];
+ }
+
+ $ip_addresses[] = $HTTP_SERVER_VARS['REMOTE_ADDR'];
+
+ foreach ( $ip_addresses as $ip ) {
+ if (!empty($ip) && tep_validate_ip_address($ip)) {
+ $ip_address = $ip;
+ break;
+ }
+ }
+
+ return $ip_address;
+ }
?>
catalog/includes/functions/general.php
@@ -1227,28 +1227,64 @@
setcookie($name, $value, $expire, $path, (tep_not_null($domain) ? $domain : ''), $secure);
}
+ function tep_validate_ip_address($ip_address) {
+ if (function_exists('filter_var') && defined('FILTER_VALIDATE_IP')) {
+ return filter_var($ip_address, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4));
+ }
+
+ if (preg_match('/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/', $ip_address)) {
+ $parts = explode('.', $ip_address);
+
+ foreach ($parts as $ip_parts) {
+ if ( (intval($ip_parts) > 255) || (intval($ip_parts) < 0) ) {
+ return false; // number is not within 0-255
+ }
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
function tep_get_ip_address() {
global $HTTP_SERVER_VARS;
- if (isset($HTTP_SERVER_VARS)) {
- if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
- $ip = $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'];
- } elseif (isset($HTTP_SERVER_VARS['HTTP_CLIENT_IP'])) {
- $ip = $HTTP_SERVER_VARS['HTTP_CLIENT_IP'];
- } else {
- $ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
+ $ip_address = null;
+ $ip_addresses = array();
+
+ if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']) &&
!empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) {
+ foreach ( array_reverse(explode(',', $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) as $x_ip )
{
+ $x_ip = trim($x_ip);
+
+ if (tep_validate_ip_address($x_ip)) {
+ $ip_addresses[] = $x_ip;
+ }
}
- } else {
- if (getenv('HTTP_X_FORWARDED_FOR')) {
- $ip = getenv('HTTP_X_FORWARDED_FOR');
- } elseif (getenv('HTTP_CLIENT_IP')) {
- $ip = getenv('HTTP_CLIENT_IP');
- } else {
- $ip = getenv('REMOTE_ADDR');
+ }
+
+ if (isset($HTTP_SERVER_VARS['HTTP_CLIENT_IP']) &&
!empty($HTTP_SERVER_VARS['HTTP_CLIENT_IP'])) {
+ $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_CLIENT_IP'];
+ }
+
+ if (isset($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP']) &&
!empty($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP'])) {
+ $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP'];
+ }
+
+ if (isset($HTTP_SERVER_VARS['HTTP_PROXY_USER']) &&
!empty($HTTP_SERVER_VARS['HTTP_PROXY_USER'])) {
+ $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_PROXY_USER'];
+ }
+
+ $ip_addresses[] = $HTTP_SERVER_VARS['REMOTE_ADDR'];
+
+ foreach ( $ip_addresses as $ip ) {
+ if (!empty($ip) && tep_validate_ip_address($ip)) {
+ $ip_address = $ip;
+ break;
}
}
- return $ip;
+ return $ip_address;
}
function tep_count_customer_orders($id = '', $check_session = true) {
Affected Files
catalog/admin/includes/classes/box.php
catalog/admin/includes/classes/box.php
@@ -52,7 +52,7 @@
$this->heading = $this->tableBlock($heading);
$this->table_data_parameters = 'class="menuBoxContent"';
- $this->contents = $this->tableBlock($contents);
+ $this->contents = (!empty($contents) ? $this->tableBlock($contents) : '');
Affected Files
Affected Files
catalog/includes/functions/general.php
View Changes Online
catalog/includes/functions/general.php
@@ -311,6 +311,7 @@
// TABLES: tax_rates, zones_to_geo_zones
function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {
global $customer_zone_id, $customer_country_id;
+ static $tax_rates = array();
////
// Return the tax description for a zone / class
// TABLES: tax_rates;
function tep_get_tax_description($class_id, $country_id, $zone_id) {
- $tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join "
. TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " .
TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or
za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is
null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int
)$class_id . "' order by tr.tax_priority");
- if (tep_db_num_rows($tax_query)) {
- $tax_description = '';
- while ($tax = tep_db_fetch_array($tax_query)) {
- $tax_description .= $tax['tax_description'] . ' + ';
- }
- $tax_description = substr($tax_description, 0, -3);
+ static $tax_rates = array();
+
+ if (!isset($tax_rates[$class_id][$country_id][$zone_id]['description'])) {
+ $tax_query = tep_db_query("select tax_description from " . TABLE_TAX_RATES . " tr left join
" . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " .
TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or
za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is
null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int
)$class_id . "' order by tr.tax_priority");
+ if (tep_db_num_rows($tax_query)) {
+ $tax_description = '';
+ while ($tax = tep_db_fetch_array($tax_query)) {
+ $tax_description .= $tax['tax_description'] . ' + ';
+ }
+ $tax_description = substr($tax_description, 0, -3);
- return $tax_description;
- } else {
- return TEXT_UNKNOWN_TAX_RATE;
+ $tax_rates[$class_id][$country_id][$zone_id]['description'] = $tax_description;
+ } else {
+ $tax_rates[$class_id][$country_id][$zone_id]['description'] = TEXT_UNKNOWN_TAX_RATE;
+ }
}
+
+ return $tax_rates[$class_id][$country_id][$zone_id]['description'];
}
////
Affected Files
catalog/admin/includes/application_top.php
catalog/includes/application_top.php
catalog/admin/includes/application_top.php
@@ -93,6 +93,8 @@
ini_set('session.cookie_path', DIR_WS_ADMIN);
}
catalog/includes/application_top.php
@@ -144,6 +144,8 @@
ini_set('session.cookie_domain', $cookie_domain);
}
Don't delete manufacturer images when editing a manufacturer and no manufacturer image was provided.
Affected Files
catalog/admin/manufacturers.php
catalog/admin/manufacturers.php
@@ -38,8 +38,11 @@
tep_db_perform(TABLE_MANUFACTURERS, $sql_data_array, 'update', "manufacturers_id = '" .
(int)$manufacturers_id . "'");
}
$languages = tep_get_languages();
Affected Files
catalog/admin/includes/languages/english/modules.php
catalog/admin/modules.php
This changeset includes an update to an English language definition file. Please perform similar changes to other
languages that are also installed.
catalog/admin/includes/languages/english/modules.php
define('TEXT_INFO_VERSION', 'Version:');
define('TEXT_INFO_ONLINE_STATUS', 'online status');
+define('TEXT_INFO_API_VERSION', 'API Version:');
catalog/admin/modules.php
@@ -144,7 +144,8 @@
'title' => $module->title,
'description' => $module->description,
'status' => $module->check(),
- 'signature' => (isset($module->signature) ? $module->signature :
null));
+ 'signature' => (isset($module->signature) ? $module->signature :
null),
+ 'api_version' => (isset($module->api_version) ? $module->api_version
: null));
$module_keys = $module->keys();
@@ -257,6 +258,10 @@
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'icon_info.gif',
IMAGE_ICON_INFO) . ' <b>' . TEXT_INFO_VERSION . '</b> ' . $sversion . ' (<a href="http:
//sig.oscommerce.com/' . $mInfo->signature . '" target="_blank">' . TEXT_INFO_ONLINE_STATUS .
'</a>)');
}
+ if (isset($mInfo->api_version)) {
+ $contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'icon_info.gif',
IMAGE_ICON_INFO) . ' <b>' . TEXT_INFO_API_VERSION . '</b> ' . $mInfo->api_version);
+ }
+
$contents[] = array('text' => '<br>' . $mInfo->description);
$contents[] = array('text' => '<br>' . $keys);
} else {
@@ -266,6 +271,10 @@
$contents[] = array('text' => '<br>' . tep_image(DIR_WS_IMAGES . 'icon_info.gif',
IMAGE_ICON_INFO) . ' <b>' . TEXT_INFO_VERSION . '</b> ' . $sversion . ' (<a href="http:
//sig.oscommerce.com/' . $mInfo->signature . '" target="_blank">' . TEXT_INFO_ONLINE_STATUS .
'</a>)');
}
+ if (isset($mInfo->api_version)) {
+ $contents[] = array('text' => tep_image(DIR_WS_IMAGES . 'icon_info.gif',
IMAGE_ICON_INFO) . ' <b>' . TEXT_INFO_API_VERSION . '</b> ' . $mInfo->api_version);
+ }
+
$contents[] = array('text' => '<br>' . $mInfo->description);
}
break;
(C) (UP) Hide Currencies and Languages Info Boxes for Single Currencies and
Languages
(C) (UP) Hide Currencies and Languages Info Boxes for Single Currencies and Languages
Hide the currencies and languages info boxes if only one currency or language is available.
Affected Files
catalog/includes/boxes/currencies.php
catalog/includes/boxes/languages.php
catalog/includes/boxes/currencies.php
@@ -10,7 +10,7 @@
Released under the GNU General Public License
*/
catalog/includes/boxes/languages.php
@@ -9,6 +9,13 @@
Affected Files
catalog/admin/index.php
catalog/admin/login.php
catalog/admin/index.php
@@ -51,7 +51,17 @@
<td><table border="0" width="100%" cellspacing="0" cellpadding="2" height="40">
<tr>
<td class= "pageHeading"><?php echo STORE_NAME; ?></td>
+
+<?php
+ if (sizeof($languages_array) > 1) {
+?>
+
<td class= "pageHeading" align="right"><?php echo tep_draw_form('adminlanguage',
FILENAME_DEFAULT, '', 'get') . tep_draw_pull_down_menu('language', $languages_array,
$languages_selected, 'onChange="this.form.submit();"') . tep_hide_session_id() . '</form>';
?></td>
+
+<?php
+ }
+?>
+
</tr>
</table></td>
</tr>
catalog/admin/login.php
@@ -130,7 +130,17 @@
<td><table border="0" width="100%" cellspacing="0" cellpadding="0" height="40">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
+
+<?php
+ if (sizeof($languages_array) > 1) {
+?>
+
<td class="pageHeading" align="right"><?php echo tep_draw_form('adminlanguage',
FILENAME_DEFAULT, '', 'get') . tep_draw_pull_down_menu('language', $languages_array,
$languages_selected, 'onChange="this.form.submit();"') . tep_hide_session_id() . '</form>';
?></td>
+
+<?php
+ }
+?>
+
</tr>
</table></td>
</tr>
Affected Files
catalog/includes/functions/general.php
catalog/includes/functions/general.php
@@ -96,7 +96,7 @@
// Return a product's special price (returns nothing if there is no offer)
// TABLES: products
function tep_get_products_special_price($product_id) {
- $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . "
where products_id = '" . (int)$product_id . "' and status");
+ $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . "
where products_id = '" . (int)$product_id . "' and status = 1");
$product = tep_db_fetch_array($product_query);
return $product['specials_new_products_price'];
Affected Files
catalog/admin/includes/modules/newsletters/newsletter.php
catalog/admin/includes/modules/newsletters/product_notification.php
catalog/admin/mail.php
catalog/admin/includes/modules/newsletters/newsletter.php
@@ -59,8 +59,16 @@
function send($newsletter_id) {
$mail_query = tep_db_query("select customers_firstname, customers_lastname,
customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
catalog/admin/includes/modules/newsletters/product_notification.php
@@ -200,8 +200,16 @@ function selectAll(FormName, SelectBox) {
}
}
reset($audience);
catalog/admin/mail.php
@@ -38,8 +38,15 @@
Affected Files
catalog/admin/modules.php
catalog/admin/modules.php
@@ -43,6 +43,7 @@
if (tep_not_null($action)) {
switch ($action) {
case 'save':
+ reset($HTTP_POST_VARS['configuration']);
while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
tep_db_query( "update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value
. "' where configuration_key = '" . $key . "'");
}
Add a list of pre-populated currencies to choose from when adding new currencies.
Affected Files
catalog/admin/currencies.php
catalog/admin/includes/languages/english.php
catalog/admin/includes/languages/english/currencies.php
catalog/includes/languages/english.php
This changeset includes updates to English language definition files. Please perform similar changes to other languages
that are also installed.
catalog/admin/currencies.php
@@ -109,6 +109,39 @@
break;
}
}
+
+ $currency_select = array('USD' => array('title' => 'U.S. Dollar', 'code' => 'USD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'EUR' => array('title' => 'Euro', 'code' => 'EUR', 'symbol_left' =>
'', 'symbol_right' => '€', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' =>
'2'),
+ 'JPY' => array('title' => 'Japanese Yen', 'code' => 'JPY',
'symbol_left' => '¥', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'GBP' => array('title' => 'Pounds Sterling', 'code' => 'GBP',
'symbol_left' => '£', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'CHF' => array('title' => 'Swiss Franc', 'code' => 'CHF',
'symbol_left' => '', 'symbol_right' => 'CHF', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
+ 'AUS' => array('title' => 'Australian Dollar', 'code' => 'AUS',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'CAD' => array('title' => 'Canadian Dollar', 'code' => 'CAD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'SEK' => array('title' => 'Swedish Krona', 'code' => 'SEK',
'symbol_left' => '', 'symbol_right' => 'kr', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
+ 'HKD' => array('title' => 'Hong Kong Dollar', 'code' => 'HKD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'NOK' => array('title' => 'Norwegian Krone', 'code' => 'NOK',
'symbol_left' => 'kr', 'symbol_right' => '', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
+ 'NZD' => array('title' => 'New Zealand Dollar', 'code' => 'NZD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'MXN' => array('title' => 'Mexican Peso', 'code' => 'MXN',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'SGD' => array('title' => 'Singapore Dollar', 'code' => 'SGD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'BRL' => array('title' => 'Brazilian Real', 'code' => 'BRL',
'symbol_left' => 'R$', 'symbol_right' => '', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
+ 'CNY' => array('title' => 'Chinese RMB', 'code' => 'CNY',
'symbol_left' => '', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'CZK' => array('title' => 'Czech Koruna', 'code' => 'CZK',
'symbol_left' => '', 'symbol_right' => 'K', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
+ 'DKK' => array('title' => 'Danish Krone', 'code' => 'DKK',
'symbol_left' => '', 'symbol_right' => 'kr', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
+ 'HUF' => array('title' => 'Hungarian Forint', 'code' => 'HUF',
'symbol_left' => '', 'symbol_right' => 'Ft', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'ILS' => array('title' => 'Israeli New Shekel', 'code' => 'ILS',
'symbol_left' => '', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'INR' => array('title' => 'Indian Rupee', 'code' => 'INR',
'symbol_left' => 'Rs.', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'MYR' => array('title' => 'Malaysian Ringgit', 'code' => 'MYR',
'symbol_left' => 'RM', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'PHP' => array('title' => 'Philippine Peso', 'code' => 'PHP',
'symbol_left' => 'Php', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'PLN' => array('title' => 'Polish Zloty', 'code' => 'PLN',
'symbol_left' => '', 'symbol_right' => 'z', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
+ 'THB' => array('title' => 'Thai Baht', 'code' => 'THB', 'symbol_left'
=> '', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',', 'decimal_places' =>
'2'),
+ 'TWD' => array('title' => 'Taiwan New Dollar', 'code' => 'TWD',
'symbol_left' => 'NT$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'));
+
+ $currency_select_array = array(array('id' => '', 'text' => TEXT_INFO_COMMON_CURRENCIES));
+ foreach ($currency_select as $cs) {
+ if (!isset($currencies->currencies[$cs['code']])) {
+ $currency_select_array[] = array('id' => $cs['code'], 'text' => '[' . $cs['code'] . '] ' .
$cs['title']);
+ }
+ }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
@@ -123,6 +156,30 @@
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->
+<script type="text/javascript">
+var currency_select = new Array();
+<?php
+ foreach ($currency_select_array as $cs) {
+ if (!empty($cs['id'])) {
+ echo 'currency_select["' . $cs['id'] . '"] = new Array("' .
$currency_select[$cs['id']]['title'] . '", "' . $currency_select[$cs['id']]['symbol_left'] . '",
"' . $currency_select[$cs['id']]['symbol_right'] . '", "' .
$currency_select[$cs['id']]['decimal_point'] . '", "' .
$currency_select[$cs['id']]['thousands_point'] . '", "' .
$currency_select[$cs['id']]['decimal_places'] . '");' . "\n";
+ }
+ }
+?>
+
+function updateForm() {
+ var cs = document.forms["currencies"].cs[document.forms["currencies"].cs.selectedIndex].value;
+
+ document.forms["currencies"].title.value = currency_select[cs][0];
+ document.forms["currencies"].code.value = cs;
+ document.forms["currencies"].symbol_left.value = currency_select[cs][1];
+ document.forms["currencies"].symbol_right.value = currency_select[cs][2];
+ document.forms["currencies"].decimal_point.value = currency_select[cs][3];
+ document.forms["currencies"].thousands_point.value = currency_select[cs][4];
+ document.forms["currencies"].decimal_places.value = currency_select[cs][5];
+ document.forms["currencies"].value.value = 1;
+}
+</script>
+
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<tr>
@@ -208,6 +265,7 @@
catalog/admin/includes/languages/english.php
// page title
define('TITLE', 'osCommerce Online Merchant Administration Tool');
catalog/admin/includes/languages/english/currencies.php
catalog/includes/languages/english.php
// page title
define('TITLE', STORE_NAME);
Introduce new Security Directory Permissions feature to list all directories and show which are writable and which whitelisted directories
should be writable.
Affected Files
catalog/admin/includes/boxes/tools.php
catalog/admin/includes/database_tables.php
catalog/admin/includes/filenames.php
catalog/admin/includes/languages/english.php
catalog/admin/includes/languages/english/sec_dir_permissions.php --- (new file)
catalog/admin/sec_dir_permissions.php --- (new file)
SQL Queries
CREATE TABLE sec_directory_whitelist (
id int NOT NULL auto_increment,
directory varchar(255) NOT NULL,
PRIMARY KEY (id)
);
This changeset includes updates to English language definition files. Please perform similar changes to other languages
that are also installed.
catalog/admin/includes/boxes/tools.php
@@ -28,6 +28,7 @@
'<a href= "' . tep_href_link(FILENAME_FILE_MANAGER) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_FILE_MANAGER . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_MAIL) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_MAIL . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_NEWSLETTERS) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_NEWSLETTER_MANAGER . '</a><br>' .
+ '<a href= "' . tep_href_link(FILENAME_SEC_DIR_PERMISSIONS) . '"
class="menuBoxContentLink">' . BOX_TOOLS_SEC_DIR_PERMISSIONS . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_SERVER_INFO) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_SERVER_INFO . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_WHOS_ONLINE) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_WHOS_ONLINE . '</a>');
}
catalog/admin/includes/database_tables.php
@@ -48,6 +48,7 @@
define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
define('TABLE_REVIEWS', 'reviews');
define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description');
+ define('TABLE_SEC_DIRECTORY_WHITELIST', 'sec_directory_whitelist');
define('TABLE_SESSIONS', 'sessions');
define('TABLE_SPECIALS', 'specials');
define('TABLE_TAX_CLASS', 'tax_class');
catalog/admin/includes/filenames.php
@@ -40,6 +40,7 @@
define('FILENAME_PRODUCTS_ATTRIBUTES', 'products_attributes.php');
define('FILENAME_PRODUCTS_EXPECTED', 'products_expected.php');
define('FILENAME_REVIEWS', 'reviews.php');
+ define('FILENAME_SEC_DIR_PERMISSIONS', 'sec_dir_permissions.php');
define('FILENAME_SERVER_INFO', 'server_info.php');
define('FILENAME_SHIPPING_MODULES', 'shipping_modules.php');
define('FILENAME_SPECIALS', 'specials.php');
catalog/admin/includes/languages/english.php
@@ -105,6 +105,7 @@ define('BOX_TOOLS_DEFINE_LANGUAGE', 'Define Languages');
define('BOX_TOOLS_FILE_MANAGER', 'File Manager');
define('BOX_TOOLS_MAIL', 'Send Email');
define('BOX_TOOLS_NEWSLETTER_MANAGER', 'Newsletter Manager');
+define('BOX_TOOLS_SEC_DIR_PERMISSIONS', 'Security Directory Permissions');
define('BOX_TOOLS_SERVER_INFO', 'Server Info');
define('BOX_TOOLS_WHOS_ONLINE', 'Who\'s Online');
Introduce new modular Action Recorder feature to log certain actions. This includes the following action recorder modules:
Contact Us
Tell a Friend
Administration Tool Login
Affected Files
SQL Queries
CREATE TABLE action_recorder (
id int NOT NULL auto_increment,
module varchar(255) NOT NULL,
user_id int,
user_name varchar(255),
identifier varchar(255) NOT NULL,
success char(1),
date_added datetime NOT NULL,
PRIMARY KEY (id),
KEY idx_action_recorder_module (module),
KEY idx_action_recorder_user_id (user_id),
KEY idx_action_recorder_identifier (identifier),
KEY idx_action_recorder_date_added (date_added)
);
This changeset includes updates to English language definition files. Please perform similar changes to other languages
that are also installed.
catalog/admin/includes/application_top.php
@@ -199,6 +199,9 @@
// file uploading class
require(DIR_WS_CLASSES . 'upload.php');
catalog/admin/includes/boxes/modules.php
@@ -23,7 +23,8 @@
if ($selected_box == 'modules') {
$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_MODULES, 'set=payment',
'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_PAYMENT . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_MODULES, 'set=shipping',
'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_SHIPPING . '</a><br>' .
- '<a href= "' . tep_href_link(FILENAME_MODULES,
'set=ordertotal', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_ORDER_TOTAL . '</a>');
+ '<a href= "' . tep_href_link(FILENAME_MODULES,
'set=ordertotal', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_ORDER_TOTAL .
'</a><br>' .
+ '<a href= "' . tep_href_link(FILENAME_MODULES,
'set=actionrecorder', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_ACTION_RECORDER .
'</a>');
}
catalog/admin/includes/boxes/tools.php
@@ -18,10 +18,11 @@
$contents = array();
if ($selected_box == 'tools') {
- $contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_BACKUP) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_BACKUP . '</a><br>' .
+ $contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_ACTION_RECORDER) . '"
class="menuBoxContentLink">' . BOX_TOOLS_ACTION_RECORDER . '</a><br>' .
+ '<a href= "' . tep_href_link(FILENAME_BACKUP) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_BACKUP . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_BANNER_MANAGER) . '"
class="menuBoxContentLink">' . BOX_TOOLS_BANNER_MANAGER . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_CACHE) . '" class=
"menuBoxContentLink">' . BOX_TOOLS_CACHE . '</a><br>' .
'<a href= "' . tep_href_link(FILENAME_DEFINE_LANGUAGE) . '"
class="menuBoxContentLink">' . BOX_TOOLS_DEFINE_LANGUAGE . '</a><br>' .
catalog/admin/includes/database_tables.php
@@ -11,6 +11,7 @@
*/
catalog/admin/includes/filenames.php
@@ -11,6 +11,7 @@
*/
catalog/admin/includes/languages/english.php
catalog/admin/includes/languages/english/login.php
define('BUTTON_LOGIN', 'Login');
define('BUTTON_CREATE_ADMINISTRATOR', 'Create Administrator');
+
+define('ERROR_ACTION_RECORDER', 'Error: The maximum number of login attempts has been reached.
Please try again in %s minutes.');
?>
catalog/admin/includes/languages/english/modules.php
@@ -13,6 +13,7 @@
define('HEADING_TITLE_MODULES_PAYMENT', 'Payment Modules');
define('HEADING_TITLE_MODULES_SHIPPING', 'Shipping Modules');
define('HEADING_TITLE_MODULES_ORDER_TOTAL', 'Order Total Modules');
+define('HEADING_TITLE_MODULES_ACTION_RECORDER', 'Action Recorder Modules');
define('TABLE_HEADING_MODULES', 'Modules');
define('TABLE_HEADING_SORT_ORDER', 'Sort Order');
catalog/admin/login.php
@@ -33,35 +33,46 @@
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
}
- if (tep_db_num_rows($check_query) == 1) {
- $check = tep_db_fetch_array($check_query);
+ if ($actionRecorder->canPerform()) {
+ $check_query = tep_db_query( "select id, user_name, user_password from " .
TABLE_ADMINISTRATORS . " where user_name = '" . tep_db_input($username) . "'");
- if (tep_validate_password($password, $check['user_password'])) {
- tep_session_register('admin');
+ if (tep_db_num_rows($check_query) == 1) {
+ $check = tep_db_fetch_array($check_query);
- if (tep_session_is_registered('redirect_origin')) {
- $page = $redirect_origin['page'];
- $get_string = '';
+ $admin = array('id' => $check['id'],
+ 'username' => $check['user_name']);
- if (function_exists('http_build_query')) {
- $get_string = http_build_query($redirect_origin['get']);
- }
+ $actionRecorder->_user_id = $admin['id'];
+ $actionRecorder->record();
+
+ if (tep_session_is_registered('redirect_origin')) {
+ $page = $redirect_origin['page'];
+ $get_string = '';
+
+ if (function_exists('http_build_query')) {
+ $get_string = http_build_query($redirect_origin['get']);
+ }
- tep_session_unregister('redirect_origin');
+ tep_session_unregister('redirect_origin');
- tep_redirect(tep_href_link($page, $get_string));
- } else {
- tep_redirect(tep_href_link(FILENAME_DEFAULT));
+ tep_redirect(tep_href_link($page, $get_string));
+ } else {
+ tep_redirect(tep_href_link(FILENAME_DEFAULT));
+ }
}
}
+
+ $messageStack->add(ERROR_INVALID_ADMINISTRATOR, 'error');
+ } else {
+ $messageStack->add(sprintf(ERROR_ACTION_RECORDER,
(defined('MODULE_ACTION_RECORDER_ADMIN_LOGIN_MINUTES') ? (int
)MODULE_ACTION_RECORDER_ADMIN_LOGIN_MINUTES : 5)));
}
- $messageStack->add(ERROR_INVALID_ADMINISTRATOR, 'error');
+ $actionRecorder->record(false);
break;
catalog/admin/modules.php
@@ -28,6 +28,12 @@
$module_key = 'MODULE_ORDER_TOTAL_INSTALLED';
define('HEADING_TITLE', HEADING_TITLE_MODULES_ORDER_TOTAL);
break;
+ case 'actionrecorder':
+ $module_type = 'action_recorder';
+ $module_directory = DIR_FS_CATALOG_MODULES . 'action_recorder/';
+ $module_key = 'MODULE_ACTION_RECORDER_INSTALLED';
+ define('HEADING_TITLE', HEADING_TITLE_MODULES_ACTION_RECORDER);
+ break;
case 'payment':
default:
$module_type = 'payment';
catalog/contact_us.php
@@ -14,21 +14,35 @@
- $error = false;
if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') &&
isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
+ $error = false;
+
$name = tep_db_prepare_input($HTTP_POST_VARS['name']);
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
- if (tep_validate_email($email_address)) {
- tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name,
$email_address);
-
- tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
- } else {
+ if (!tep_validate_email($email_address)) {
$error = true;
$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
+
+ $actionRecorder = new actionRecorder('ar_contact_us',
(tep_session_is_registered('customer_id') ? $customer_id : null), $name);
+ if (!$actionRecorder->canPerform()) {
+ $error = true;
+
+ $actionRecorder->record(false);
+
+ $messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER,
(defined('MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES') ? (int
)MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES : 15)));
+ }
+
+ if ($error == false) {
+ tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name,
$email_address);
+
+ $actionRecorder->record();
+
+ tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
+ }
}
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
catalog/includes/application_top.php
@@ -298,6 +298,9 @@
}
$navigation->add_current_page();
catalog/includes/database_tables.php
@@ -11,6 +11,7 @@
*/
catalog/includes/languages/english/contact_us.php
catalog/includes/languages/english/tell_a_friend.php
@@ -34,4 +34,5 @@ define('ERROR_TO_NAME', 'Error: Your friends name must not be empty.');
define('ERROR_TO_ADDRESS', 'Error: Your friends e-mail address must be a valid e-mail address.');
define('ERROR_FROM_NAME', 'Error: Your name must not be empty.');
define('ERROR_FROM_ADDRESS', 'Error: Your e-mail address must be a valid e-mail address.');
+define('ERROR_ACTION_RECORDER', 'Error: An e-mail has already been sent. Please try again in %s
minutes.');
?>
catalog/tell_a_friend.php
@@ -66,6 +66,15 @@
$messageStack->add('friend', ERROR_TO_ADDRESS);
}
+ $actionRecorder->record();
+
$messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT,
$product_info['products_name'], tep_output_string_protected($to_name)), 'success');
catalog/admin/customers.php
catalog/admin/includes/languages/english.php
catalog/includes/languages/english.php
catalog/admin/customers.php
catalog/admin/includes/languages/english.php
@@ -169,11 +169,9 @@ define('ENTRY_EMAIL_ADDRESS_ERROR', ' <span class="errorText">min ' .
ENTRY
define('ENTRY_EMAIL_ADDRESS_CHECK_ERROR', ' <span class="errorText">The email address
doesn\'t appear to be valid!</span>');
define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS', ' <span class="errorText">This email address
already exists!</span>');
define('ENTRY_COMPANY', 'Company name:');
-define('ENTRY_COMPANY_ERROR', '');
define('ENTRY_STREET_ADDRESS', 'Street Address:');
define('ENTRY_STREET_ADDRESS_ERROR', ' <span class="errorText">min ' .
ENTRY_STREET_ADDRESS_MIN_LENGTH . ' chars</span>');
define('ENTRY_SUBURB', 'Suburb:');
-define('ENTRY_SUBURB_ERROR', '');
define('ENTRY_POST_CODE', 'Post Code:');
define('ENTRY_POST_CODE_ERROR', ' <span class="errorText">min ' . ENTRY_POSTCODE_MIN_LENGTH
. ' chars</span>');
define('ENTRY_CITY', 'City:');
@@ -181,15 +179,13 @@ define('ENTRY_CITY_ERROR', ' <span class="errorText">min ' .
ENTRY_CITY_MIN
define('ENTRY_STATE', 'State:');
define('ENTRY_STATE_ERROR', ' <span class="errorText">required</span>');
define('ENTRY_COUNTRY', 'Country:');
-define('ENTRY_COUNTRY_ERROR', '');
+define('ENTRY_COUNTRY_ERROR', 'You must select a country from the Countries pull down menu.');
define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
define('ENTRY_TELEPHONE_NUMBER_ERROR', ' <span class="errorText">min ' .
ENTRY_TELEPHONE_MIN_LENGTH . ' chars</span>');
define('ENTRY_FAX_NUMBER', 'Fax Number:');
-define('ENTRY_FAX_NUMBER_ERROR', '');
define('ENTRY_NEWSLETTER', 'Newsletter:');
define('ENTRY_NEWSLETTER_YES', 'Subscribed');
define('ENTRY_NEWSLETTER_NO', 'Unsubscribed');
-define('ENTRY_NEWSLETTER_ERROR', '');
// images
define('IMAGE_ANI_SEND_EMAIL', 'Sending E-Mail');
catalog/includes/languages/english.php
@@ -160,7 +160,6 @@ define('CATEGORY_OPTIONS', 'Options');
define('CATEGORY_PASSWORD', 'Your Password');
Move installation checks to new Security Checks modules. Installation messages shown on the Catalog side have been moved to the
Administration Tool Index Summary page.
Affected Files
This changeset includes updates to English language definition files. Please perform similar changes to other languages
that are also installed.
catalog/admin/includes/application_top.php
@@ -233,18 +233,4 @@
array('title' => TEXT_CACHE_MANUFACTURERS, 'code' => 'manufacturers',
'file' => 'manufacturers_box-language.cache', 'multiple' => true),
array('title' => TEXT_CACHE_ALSO_PURCHASED, 'code' => 'also_purchased',
'file' => 'also_purchased-language.cache', 'multiple' => true)
);
-
-// check if a default currency is set
- if (!defined('DEFAULT_CURRENCY')) {
- $messageStack->add(ERROR_NO_DEFAULT_CURRENCY_DEFINED, 'error');
- }
-
-// check if a default language is set
- if (!defined('DEFAULT_LANGUAGE')) {
- $messageStack->add(ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
- }
-
- if (function_exists('ini_get') && ((bool)ini_get('file_uploads') == false) ) {
- $messageStack->add(WARNING_FILE_UPLOADS_DISABLED, 'warning');
- }
?>
catalog/admin/includes/configure.php
@@ -36,6 +36,8 @@
define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
+ define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
+ define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
catalog/admin/includes/languages/english.php
catalog/includes/application_top.php
@@ -475,11 +475,4 @@
// initialize the message stack for output messages
require(DIR_WS_CLASSES . 'message_stack.php');
$messageStack = new messageStack;
-
-// set which precautions should be checked
- define('WARN_INSTALL_EXISTENCE', 'true');
- define('WARN_CONFIG_WRITEABLE', 'true');
- define('WARN_SESSION_DIRECTORY_NOT_WRITEABLE', 'true');
- define('WARN_SESSION_AUTO_START', 'true');
- define('WARN_DOWNLOAD_DIRECTORY_NOT_READABLE', 'true');
?>
catalog/includes/header.php
@@ -10,44 +10,6 @@
Released under the GNU General Public License
*/
-// check if the 'install' directory exists, and warn of its existence
- if (WARN_INSTALL_EXISTENCE == 'true') {
- if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) {
- $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning');
- }
- }
-
-// check if the configure.php file is writeable
- if (WARN_CONFIG_WRITEABLE == 'true') {
- if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php'))
&& (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) {
- $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning');
- }
- }
-
-// check if the session folder is writeable
- if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') {
- if (STORE_SESSIONS == '') {
- if (!is_dir(tep_session_save_path())) {
- $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning');
- } elseif (!is_writeable(tep_session_save_path())) {
- $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning');
- }
- }
- }
-
-// check session.auto_start is disabled
- if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
- if (ini_get('session.auto_start') == '1') {
- $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
- }
- }
-
- if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
- if (!is_dir(DIR_FS_DOWNLOAD)) {
- $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
- }
- }
-
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
catalog/includes/languages/english.php
@@ -299,12 +299,6 @@ define('TEXT_UNKNOWN_TAX_RATE', 'Unknown tax rate');
define('TEXT_REQUIRED', '<span class="errorText">Required</span>');
define('TEXT_CCVAL_ERROR_INVALID_DATE', 'The expiry date entered for the credit card is invalid.
Please check the date and try again.');
define('TEXT_CCVAL_ERROR_INVALID_NUMBER', 'The credit card number entered is invalid. Please
check the number and try again.');
Affected Files
catalog/admin/administrators.php
catalog/admin/backup.php
catalog/admin/banner_manager.php
catalog/admin/banner_statistics.php
catalog/admin/cache.php
catalog/admin/categories.php
catalog/admin/define_language.php
catalog/admin/includes/classes/upload.php
catalog/admin/includes/functions/general.php
catalog/admin/includes/modules/security_check/config_file_catalog.php
catalog/admin/includes/modules/security_check/session_storage.php
catalog/admin/sec_dir_permissions.php
catalog/admin/administrators.php
@@ -22,7 +22,7 @@
'Require valid-user',
'##### OSCOMMERCE ADMIN PROTECTION - END #####');
catalog/admin/backup.php
@@ -317,7 +317,7 @@
// check if the backup directory exists
$dir_ok = false;
if (is_dir(DIR_FS_BACKUP)) {
- if (is_writeable(DIR_FS_BACKUP)) {
+ if (tep_is_writable(DIR_FS_BACKUP)) {
$dir_ok = true;
} else {
$messageStack->add(ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');
catalog/admin/banner_manager.php
@@ -125,7 +125,7 @@
$banner = tep_db_fetch_array($banner_query);
if (is_file(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
- if (is_writeable(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
+ if (tep_is_writable(DIR_FS_CATALOG_IMAGES . $banner['banners_image'])) {
unlink(DIR_FS_CATALOG_IMAGES . $banner['banners_image']);
} else {
$messageStack->add_session(ERROR_IMAGE_IS_NOT_WRITEABLE, 'error');
@@ -140,25 +140,25 @@
catalog/admin/banner_statistics.php
@@ -20,7 +20,7 @@
$dir_ok = false;
if (function_exists('imagecreate') && tep_not_null($banner_extension)) {
if (is_dir(DIR_WS_IMAGES . 'graphs')) {
- if (is_writeable(DIR_WS_IMAGES . 'graphs')) {
+ if (tep_is_writable(DIR_WS_IMAGES . 'graphs')) {
$dir_ok = true;
} else {
$messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error');
catalog/admin/cache.php
@@ -24,7 +24,7 @@
catalog/admin/categories.php
@@ -327,7 +327,7 @@
catalog/admin/define_language.php
@@ -24,7 +24,7 @@
if (!in_array($filename, $exclude_array)) {
$file = array('name' => $path . $filename,
'is_dir' => is_dir($path . $filename),
- 'writable' => is_writable($path . $filename),
+ 'writable' => tep_is_writable($path . $filename),
'size' => filesize($path . $filename),
'last_modified' => strftime(DATE_TIME_FORMAT, filemtime($path .
$filename)));
@@ -72,7 +72,7 @@
if (isset($HTTP_GET_VARS['lngdir']) && isset($HTTP_GET_VARS['filename'])) {
$file = DIR_FS_CATALOG_LANGUAGES . $HTTP_GET_VARS['filename'];
$file_writeable = true;
- if (!is_writable($file)) {
+ if (!tep_is_writable($file)) {
$file_writeable = false;
$messageStack->reset();
$messageStack->add(sprintf(ERROR_FILE_NOT_WRITEABLE, $file), 'error');
@@ -185,7 +185,7 @@
</tr>
<tr class= "dataTableRow" onmouseover="rowOverEffect(this)" onmouseout=
"rowOutEffect(this)">
<td class= "dataTableContent"><a href="<?php echo
tep_href_link(FILENAME_DEFINE_LANGUAGE, 'lngdir=' . $HTTP_GET_VARS['lngdir'] . '&filename=' .
$filename); ?>"><b><?php echo $filename; ?></b></a></td>
- <td class= "dataTableContent" align="center"><?php echo tep_image(DIR_WS_IMAGES .
'icons/' . ((is_writable(DIR_FS_CATALOG_LANGUAGES . $filename) == true) ? 'tick.gif' :
'cross.gif')); ?></td>
+ <td class= "dataTableContent" align="center"><?php echo tep_image(DIR_WS_IMAGES .
'icons/' . ((tep_is_writable(DIR_FS_CATALOG_LANGUAGES . $filename) == true) ? 'tick.gif' :
'cross.gif')); ?></td>
<td class= "dataTableContent" align="right"><?php echo strftime(DATE_TIME_FORMAT,
filemtime(DIR_FS_CATALOG_LANGUAGES . $filename)); ?></td>
</tr>
<?php
catalog/admin/includes/classes/upload.php
@@ -139,7 +139,7 @@
function check_destination() {
global $messageStack;
- if (!is_writeable($this->destination)) {
+ if (!tep_is_writable($this->destination)) {
if (is_dir($this->destination)) {
if ($this->message_location == 'direct') {
$messageStack->add(sprintf(ERROR_DESTINATION_NOT_WRITEABLE, $this->destination),
'error');
catalog/admin/includes/functions/general.php
@@ -1010,7 +1010,7 @@
$dir = dir($source);
while ($file = $dir->read()) {
if ( ($file != '.') && ($file != '..') ) {
- if (is_writeable($source . '/' . $file)) {
+ if (tep_is_writable($source . '/' . $file)) {
tep_remove($source . '/' . $file);
} else {
$messageStack->add(sprintf(ERROR_FILE_NOT_REMOVEABLE, $source . '/' . $file),
'error');
@@ -1020,14 +1020,14 @@
}
$dir->close();
- if (is_writeable($source)) {
+ if (tep_is_writable($source)) {
rmdir($source);
} else {
$messageStack->add(sprintf(ERROR_DIRECTORY_NOT_REMOVEABLE, $source), 'error');
$tep_remove_error = true;
}
} else {
- if (is_writeable($source)) {
+ if (tep_is_writable($source)) {
unlink($source);
} else {
$messageStack->add(sprintf(ERROR_FILE_NOT_REMOVEABLE, $source), 'error');
@@ -1356,4 +1356,35 @@
return $ip_address;
}
+
+////
+// Wrapper function for is_writable() for Windows compatibility
+ function tep_is_writable($file) {
+ if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
+ if (file_exists($file)) {
+ $file = realpath($file);
+ if (is_dir($file)) {
+ $result = @tempnam($file, 'osc');
+ if (is_string($result) && file_exists($result)) {
+ unlink($result);
+ return (strpos($result, $file) === 0) ? true : false;
+ }
+ } else {
+ $handle = @fopen($file, 'r+');
+ if (is_resource($handle)) {
+ fclose($handle);
+ return true;
+ }
+ }
+ } else{
+ $dir = dirname($file);
+ if (file_exists($dir) && is_dir($dir) && tep_is_writable($dir)) {
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return is_writable($file);
+ }
+ }
?>
catalog/admin/includes/modules/security_check/config_file_catalog.php
@@ -20,7 +20,7 @@
}
function pass() {
- return (file_exists(DIR_FS_CATALOG . 'includes/configure.php') &&
!is_writable(DIR_FS_CATALOG . 'includes/configure.php'));
+ return (file_exists(DIR_FS_CATALOG . 'includes/configure.php') &&
!tep_is_writable(DIR_FS_CATALOG . 'includes/configure.php'));
}
function getMessage() {
catalog/admin/includes/modules/security_check/session_storage.php
@@ -20,14 +20,14 @@
}
function pass() {
- return ((STORE_SESSIONS != '') || (is_dir(tep_session_save_path()) &&
is_writable(tep_session_save_path())));
+ return ((STORE_SESSIONS != '') || (is_dir(tep_session_save_path()) &&
tep_is_writable(tep_session_save_path())));
}
function getMessage() {
if (STORE_SESSIONS == '') {
if (!is_dir(tep_session_save_path())) {
return WARNING_SESSION_DIRECTORY_NON_EXISTENT;
- } elseif (!is_writable(tep_session_save_path())) {
+ } elseif (!tep_is_writable(tep_session_save_path())) {
return WARNING_SESSION_DIRECTORY_NOT_WRITEABLE;
}
}
catalog/admin/sec_dir_permissions.php
@@ -24,7 +24,7 @@
if (!in_array($filename, $exclude_array)) {
$file = array('name' => $path . $filename,
'is_dir' => is_dir($path . $filename),
- 'writable' => is_writable($path . $filename));
+ 'writable' => tep_is_writable($path . $filename));
$result[] = $file;
Affected Files
catalog/admin/administrators.php
catalog/admin/administrators.php
@@ -14,6 +14,7 @@
$htaccess_array = null;
$htpasswd_array = null;
+ $is_iis = stripos($HTTP_SERVER_VARS['SERVER_SOFTWARE'], 'iis');
@@ -225,7 +226,7 @@
} else {
$secMessageStack->add(HTPASSWD_SECURED, 'success');
}
- } else {
+ } else if (!$is_iis) {
$secMessageStack->add(HTPASSWD_PERMISSIONS, 'error');
}
?>
@@ -283,8 +284,13 @@
$aInfo = new objectInfo($admins);
}
+
$htpasswd_secured = tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', 'Not Secured', 10, 10);
+ if ($is_iis) {
+ $htpasswd_secured = 'N/A';
+ }
+
if (is_array($htpasswd_array)) {
for ($i=0, $n=sizeof($htpasswd_array); $i<$n; $i++) {
list($ht_username, $ht_password) = explode(':', $htpasswd_array[$i], 2);
Affected Files
catalog/admin/includes/application_top.php
catalog/includes/application_top.php
catalog/admin/includes/application_top.php
@@ -34,7 +34,7 @@
require(DIR_WS_FUNCTIONS . 'compatibility.php');
catalog/includes/application_top.php
@@ -43,7 +43,7 @@
$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
if ($request_type == 'NONSSL') {
define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
Introduce a new Administration Tool section to easily allow a new store logo to be uploaded.
Affected Files
catalog/admin/includes/boxes/configuration.php
catalog/admin/includes/filenames.php
catalog/admin/includes/languages/english.php
catalog/admin/includes/languages/english/store_logo.php --- (new file)
catalog/admin/store_logo.php --- (new file)
This changeset includes updates to English language definition files. Please perform similar changes to other languages
that are also installed.
catalog/admin/includes/boxes/configuration.php
@@ -21,7 +21,8 @@
'link' => tep_href_link(FILENAME_CONFIGURATION,
'gID=1&selected_box=configuration'));
if ($selected_box == 'configuration') {
- $cfg_groups = '<a href="' . tep_href_link(FILENAME_ADMINISTRATORS, '', 'NONSSL') . '" class=
"menuBoxContentLink">' . BOX_CONFIGURATION_ADMINISTRATORS . '</a><br>';
+ $cfg_groups = '<a href="' . tep_href_link(FILENAME_ADMINISTRATORS, '', 'NONSSL') . '" class=
"menuBoxContentLink">' . BOX_CONFIGURATION_ADMINISTRATORS . '</a><br>' .
+ '<a href= "' . tep_href_link(FILENAME_STORE_LOGO, '', 'NONSSL') . '" class=
"menuBoxContentLink">' . BOX_CONFIGURATION_STORE_LOGO . '</a><br>';
$configuration_groups_query = tep_db_query("select configuration_group_id as cgID,
configuration_group_title as cgTitle from " . TABLE_CONFIGURATION_GROUP . " where visible = '1'
order by sort_order");
while ($configuration_groups = tep_db_fetch_array($configuration_groups_query)) {
$cfg_groups .= '<a href="' . tep_href_link(FILENAME_CONFIGURATION, 'gID=' .
$configuration_groups['cgID'], 'NONSSL') . '" class="menuBoxContentLink">' .
$configuration_groups['cgTitle'] . '</a><br>';
catalog/admin/includes/filenames.php
@@ -48,6 +48,7 @@
define('FILENAME_STATS_CUSTOMERS', 'stats_customers.php');
define('FILENAME_STATS_PRODUCTS_PURCHASED', 'stats_products_purchased.php');
define('FILENAME_STATS_PRODUCTS_VIEWED', 'stats_products_viewed.php');
+ define('FILENAME_STORE_LOGO', 'store_logo.php');
define('FILENAME_TAX_CLASSES', 'tax_classes.php');
define('FILENAME_TAX_RATES', 'tax_rates.php');
define('FILENAME_VERSION_CHECK', 'version_check.php');
catalog/admin/includes/languages/english.php
Update password hashing to Phpass for increased security. Existing customer and administrator passwords are automatically and
transparently hashed with Phpass when the customer or administrator logs in.
Affected Files
SQL Queries
catalog/admin/includes/functions/password_funcs.php
@@ -11,10 +11,31 @@
*/
////
-// This funstion validates a plain text password with an
-// encrpyted password
+// This function validates a plain text password with a
+// salted or phpass password
function tep_validate_password($plain, $encrypted) {
if (tep_not_null($plain) && tep_not_null($encrypted)) {
+ if (tep_password_type($encrypted) == 'salt') {
+ return tep_validate_old_password($plain, $encrypted);
+ }
+
+ if (!class_exists('PasswordHash')) {
+ include(DIR_WS_CLASSES . 'passwordhash.php');
+ }
+
+ $hasher = new PasswordHash(10, true);
+
+ return $hasher->CheckPassword($plain, $encrypted);
+ }
+
+ return false;
+ }
+
+////
+// This function validates a plain text password with a
+// salted password
+ function tep_validate_old_password($plain, $encrypted) {
+ if (tep_not_null($plain) && tep_not_null($encrypted)) {
// split apart the hash / salt
$stack = explode(':', $encrypted);
@@ -29,8 +50,22 @@
}
////
-// This function makes a new password from a plaintext password.
+// This function encrypts a phpass password from a plaintext
+// password.
function tep_encrypt_password($plain) {
+ if (!class_exists('PasswordHash')) {
+ include(DIR_WS_CLASSES . 'passwordhash.php');
+ }
+
+ $hasher = new PasswordHash(10, true);
+
+ return $hasher->HashPassword($plain);
+ }
+
+////
+// This function encrypts a salted password from a plaintext
+// password.
+ function tep_encrypt_old_password($plain) {
$password = '';
////
+// This function returns the type of the encrpyted password
+// (phpass or salt)
+ function tep_password_type($encrypted) {
+ if (preg_match('/^[A-Z0-9]{32}\:[A-Z0-9]{2}$/i', $encrypted) === 1) {
+ return 'salt';
+ }
+
+ return 'phpass';
+ }
+
+////
// This function produces a crypted string using the APR-MD5 algorithm
// Source: http://www.php.net/crypt
function tep_crypt_apr_md5($password, $salt = null) {
catalog/admin/login.php
@@ -42,6 +42,11 @@
$check = tep_db_fetch_array($check_query);
if (tep_validate_password($password, $check['user_password'])) {
+// migrate old hashed password to new phpass password
+ if (tep_password_type($check['user_password']) != 'phpass') {
+ tep_db_query( "update " . TABLE_ADMINISTRATORS . " set user_password = '" .
tep_encrypt_password($password) . "' where id = '" . (int)$check['id'] . "'");
+ }
+
tep_session_register('admin');
catalog/includes/functions/password_funcs.php
@@ -11,10 +11,31 @@
*/
////
-// This funstion validates a plain text password with an
-// encrpyted password
+// This function validates a plain text password with a
+// salted or phpass password
function tep_validate_password($plain, $encrypted) {
if (tep_not_null($plain) && tep_not_null($encrypted)) {
+ if (tep_password_type($encrypted) == 'salt') {
+ return tep_validate_old_password($plain, $encrypted);
+ }
+
+ if (!class_exists('PasswordHash')) {
+ include(DIR_WS_CLASSES . 'passwordhash.php');
+ }
+
+ $hasher = new PasswordHash(10, true);
+
+ return $hasher->CheckPassword($plain, $encrypted);
+ }
+
+ return false;
+ }
+
+////
+// This function validates a plain text password with a
+// salted password
+ function tep_validate_old_password($plain, $encrypted) {
+ if (tep_not_null($plain) && tep_not_null($encrypted)) {
// split apart the hash / salt
$stack = explode(':', $encrypted);
@@ -29,8 +50,22 @@
}
////
-// This function makes a new password from a plaintext password.
+// This function encrypts a phpass password from a plaintext
+// password.
function tep_encrypt_password($plain) {
+ if (!class_exists('PasswordHash')) {
+ include(DIR_WS_CLASSES . 'passwordhash.php');
+ }
+
+ $hasher = new PasswordHash(10, true);
+
+ return $hasher->HashPassword($plain);
+ }
+
+////
+// This function encrypts a salted password from a plaintext
+// password.
+ function tep_encrypt_old_password($plain) {
$password = '';
return $password;
}
-?>
+
+////
+// This function returns the type of the encrpyted password
+// (phpass or salt)
+ function tep_password_type($encrypted) {
+ if (preg_match('/^[A-Z0-9]{32}\:[A-Z0-9]{2}$/i', $encrypted) === 1) {
+ return 'salt';
+ }
+
+ return 'phpass';
+ }
+?>
catalog/login.php
@@ -38,6 +38,11 @@
tep_session_recreate();
}
Affected Files
catalog/account_password.php
catalog/includes/form_check.js.php
catalog/account_password.php
@@ -27,11 +27,7 @@
$error = false;
$messageStack->add('account_password', ENTRY_PASSWORD_NEW_ERROR);
catalog/includes/form_check.js.php
@@ -73,25 +73,6 @@ function check_password(field_name_1, field_name_2, field_size, message_1,
messa
}
}
if (error == true) {
alert(error_message);
(C) (BUG) Fix Notice When Products Without Attributes are Added to the Shopping
Cart
(C) (BUG) Fix Notice When Products Without Attributes are Added to the Shopping Cart
Fix a PHP notice when products without attributes are added to the shopping cart.
Affected Files
catalog/includes/application_top.php
catalog/includes/application_top.php
@@ -333,7 +333,8 @@
break;
// customer adds a product from the products page
case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) &&
is_numeric($HTTP_POST_VARS['products_id'])) {
- $cart->add_cart($HTTP_POST_VARS['products_id'],
$cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1,
$HTTP_POST_VARS['id']);
+ $attributes = isset($HTTP_POST_VARS['id']) ?
$HTTP_POST_VARS['id'] : '';
+ $cart->add_cart($HTTP_POST_VARS['products_id'],
$cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);
}
tep_redirect(tep_href_link($ goto,
tep_get_all_get_params($parameters)));
break;
Affected Files
catalog/includes/application_top.php
catalog/includes/application_top.php
@@ -287,7 +287,7 @@
if (isset($HTTP_GET_VARS['currency']) && $currencies->is_set($HTTP_GET_VARS['currency'])) {
$currency = $HTTP_GET_VARS['currency'];
} else {
- $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY :
DEFAULT_CURRENCY;
+ $currency = ((USE_DEFAULT_LANGUAGE_CURRENCY == 'true') &&
$currencies->is_set(LANGUAGE_CURRENCY)) ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
}
}
Affected Files
catalog/advanced_search_result.php
catalog/includes/functions/general.php
catalog/advanced_search_result.php
@@ -48,7 +48,7 @@
}
if (isset($HTTP_GET_VARS['keywords'])) {
- $keywords = $HTTP_GET_VARS['keywords'];
+ $keywords = tep_db_prepare_input($HTTP_GET_VARS['keywords']);
}
$date_check_error = false;
@@ -300,7 +300,7 @@
$where_str .= " group by p.products_id, tr.tax_priority";
}
catalog/includes/functions/general.php
@@ -654,7 +654,7 @@
// Turn the flag off for future iterations
$flag = 'off';
- $objects[] = trim($pieces[$k]);
+ $objects[] = trim(preg_replace('/"/', ' ', $pieces[$k]));
v2.3.0 to v2.3.1
(C) (UP) Confirm New Product Reviews — Importance: Medium | Difficulty: Easy
(C) (A) (BUG) Fix a PHP Notice in Phpass — Importance: Medium | Difficulty: Easy
(C) (BUG) Fix Reviews Box Language Definition — Importance: High | Difficulty: Easy
(A) (BUG) Fix Pre-Defined Australian Dollar Currency Code — Importance: High | Difficulty: Easy
(A) (UP) Label the HTML Content field for Large Product Images — Importance: Low | Difficulty: Easy
(C) (UP) XHTML Fixes for Popup Pages — Importance: Low | Difficulty: Easy
(C) (UP) Update Version to v2.3.1 — Importance: High | Difficulty: Easy
Display a success message to the customer when a new product review has been created.
Affected Files
catalog/includes/languages/english/product_reviews_write.php
catalog/product_reviews.php
catalog/product_reviews_write.php
catalog/includes/languages/english/product_reviews_write.php
+define('TEXT_REVIEW_RECEIVED', 'Thank you for your review. It has been submitted to the store
owner for approval and should appear shortly.');
+
define('TEXT_CLICK_TO_ENLARGE', 'Click to enlarge');
?>
catalog/product_reviews.php
@@ -42,6 +42,12 @@
require(DIR_WS_INCLUDES . 'template_top.php');
?>
+<?php
+ if ($messageStack->size('product_reviews') > 0) {
+ echo $messageStack->output('product_reviews');
+ }
+?>
+
<div>
<h1 style="float: right;"><?php echo $products_price; ?></h1>
<h1><?php echo $products_name; ?></h1>
catalog/product_reviews_write.php
@@ -12,6 +12,8 @@
require('includes/application_top.php');
require(DIR_WS_INCLUDES . 'template_top.php');
Affected Files
catalog/admin/includes/classes/passwordhash.php
catalog/includes/classes/passwordhash.php
catalog/admin/includes/classes/passwordhash.php
@@ -3,6 +3,7 @@
# Portable PHP password hashing framework.
#
# Version 0.3 / genuine.
+# Version 0.3 / osCommerce (silenced @is_readable('/dev/urandom'))
#
# Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
# the public domain. Revised in subsequent years, still public domain.
@@ -48,7 +49,7 @@ class PasswordHash {
function get_random_bytes($count)
{
$output = '';
- if (is_readable('/dev/urandom') &&
+ if (@is_readable('/dev/urandom') &&
($fh = @fopen('/dev/urandom', 'rb'))) {
$output = fread($fh, $count);
fclose($fh);
catalog/includes/classes/passwordhash.php
@@ -3,6 +3,7 @@
# Portable PHP password hashing framework.
#
# Version 0.3 / genuine.
+# Version 0.3 / osCommerce (silenced @is_readable('/dev/urandom'))
#
# Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
# the public domain. Revised in subsequent years, still public domain.
@@ -48,7 +49,7 @@ class PasswordHash {
function get_random_bytes($count)
{
$output = '';
- if (is_readable('/dev/urandom') &&
+ if (@is_readable('/dev/urandom') &&
($fh = @fopen('/dev/urandom', 'rb'))) {
$output = fread($fh, $count);
fclose($fh);
Affected Files
catalog/includes/modules/boxes/bm_reviews.php
catalog/includes/modules/boxes/bm_reviews.php
@@ -55,7 +55,7 @@
$reviews_box_contents .= '<table border="0" cellspacing="0" cellpadding="2" class=
"ui-widget-content infoBoxContents"><tr><td><a href="' .
tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '"
>' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) .
'</a></td><td><a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' .
$HTTP_GET_VARS['products_id']) . '">' . MODULE_BOXES_REVIEWS_BOX_WRITE_REVIEW
.'</a></td></tr></table>';
} else {
// display 'no reviews' box
- $reviews_box_contents .= '<div class="ui-widget-content infoBoxContents">' .
MODULE_BOXES_REVIEWS_BOX_REVIEWS_NO_REVIEWS . '</div>';
+ $reviews_box_contents .= '<div class="ui-widget-content infoBoxContents">' .
MODULE_BOXES_REVIEWS_BOX_NO_REVIEWS . '</div>';
}
Affected Files
catalog/admin/currencies.php
catalog/admin/currencies.php
@@ -115,7 +115,7 @@
'JPY' => array('title' => 'Japanese Yen', 'code' => 'JPY',
'symbol_left' => '¥', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
'GBP' => array('title' => 'Pounds Sterling', 'code' => 'GBP',
'symbol_left' => '£', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
'CHF' => array('title' => 'Swiss Franc', 'code' => 'CHF',
'symbol_left' => '', 'symbol_right' => 'CHF', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
- 'AUS' => array('title' => 'Australian Dollar', 'code' => 'AUS',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
+ 'AUD' => array('title' => 'Australian Dollar', 'code' => 'AUD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
'CAD' => array('title' => 'Canadian Dollar', 'code' => 'CAD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
'SEK' => array('title' => 'Swedish Krona', 'code' => 'SEK',
'symbol_left' => '', 'symbol_right' => 'kr', 'decimal_point' => ',', 'thousands_point' => '.',
'decimal_places' => '2'),
'HKD' => array('title' => 'Hong Kong Dollar', 'code' => 'HKD',
'symbol_left' => '$', 'symbol_right' => '', 'decimal_point' => '.', 'thousands_point' => ',',
'decimal_places' => '2'),
(A) (UP) Label the HTML Content field for Large Product Images
(A) (UP) Label the HTML Content field for Large Product Images
Affected Files
catalog/admin/categories.php
catalog/admin/includes/languages/english/categories.php
catalog/admin/categories.php
var piDelConfirmId = 0;
catalog/admin/includes/languages/english/categories.php
Affected Files
catalog/info_shopping_cart.php
catalog/popup_image.php
catalog/popup_search_help.php
catalog/info_shopping_cart.php
@@ -16,13 +16,13 @@
catalog/popup_image.php
@@ -17,12 +17,12 @@
$products_query = tep_db_query("select pd.products_name, p.products_image from " .
TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id =
pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] .
"' and pd.language_id = '" . (int)$languages_id . "'");
$products = tep_db_fetch_array($products_query);
?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
+<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
<title><?php echo $products['products_name']; ?></title>
-<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG;
?>">
+<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG;
?>" />
<script type="text/javascript"><!--
var i=0;
function resize() {
catalog/popup_search_help.php
@@ -16,13 +16,13 @@
Affected Files
catalog/includes/version.php
catalog/includes/version.php
@@ -1 +1 @@
-2.3
+2.3.1