Remember Me (Automatic Login) — for Zen Cart v1.5.0, v1.5.1, v1.5.2 and v1.5.3
Version 1.4.1
Current Support Thread at Zen Cart Forums: http://www.zen-cart.com/forum/showthread.php?t=57982
What it does
When a customer creates an account or logs in, s/he is offered the option (a "Remember Me?" checkbox) to be automatically logged into your website on subsequent visits. If the customer checks this box, a cookie is set in the customer's browser; that cookie's name is zcrm_xxxx
where "xxxx" is an MD5 hash of your store's name (as set in Configuration->My Store). That cookie remains set (and provides a continued-login to your store) until:
- the customer clicks the Logoff link in your store.
- the cookie expires or is otherwise removed.
Security Note: The customer's password, as stored in the cookie, is a hashed version of customer's Zen Cart hashed password value, so the customer's actual password or password hash is never exposed.
Once you have installed the plugin, the following additional configuration settings are available in Configuration->Customer Details:
- Enable Automatic Login? Controls the overall enabling of the plugin's feature. Set to true (default) or false.
- Automatic Login (Cookie Lifetime) Identifies the number of days that the "Remember Me" cookie should live (default: 14).
- Automatic Login (Secret Key) Contains the "shared secret" used to hash the customer's already hashed password.
Installation
This plugin currently has no core-file overwrites; you should always backup your cart's database and files prior to making any changes. Note: Zen Cart v1.5.3 was used as the Zen Cart basis for all template-override changes.
- Unzip the plugin's package file. Rename the YOUR_ADMIN folder to match your secret admin folder's name and the YOUR_TEMPLATE directory to match your current template's name.
- Use a program like WinMerge or Beyond Compare to compare the plugin's template overrides to your store's current files and merge any changes required.
- Log into your Zen Cart admin.
- Copy the plugin's files to your store's file system.
- /includes/auto_loaders/config.remember_me.php
- /includes/classes/observers/class.remember_me_observer.php
- /includes/languages/english/extra_definitions/remember_me_definitions.php
- /includes/templates/YOUR_TEMPLATE/templates/tpl_login_default.php
- /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_create_account.php
- /YOUR_ADMIN/includes/functions/extra_functions/init_remember_me.php
- Click the "Admin Home" link, then click Configuration->Customer Details to set the Automatic Login options to your liking.
Version History
Authors' History
- Original Code by chris at linuxuser.at
- Optional logoff and admin controls by kuroi
- Packaged by ryk 23 Feb 2007
Versions and Changes
- v1.4.1, 2014-07-09 (lat9):
- Updated template changes to incorporate downwardly-compatible changes introduced in Zen Cart v1.5.3. Changed:
- /includes/templates/YOUR_TEMPLATE/templates/tpl_login_default.php
- /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_create_account.php
- v1.4.0, 2014-06-20 (lat9):
- Incorporate SQL install script into a PHP auto-install script.
- Move run-time language changes into an extra_definitions file so that they're common between the login and create_account page.
- Move processing to a run-time observer, no more core-file overwrites!
- Modified information stored in the cookie and the means of validating the cookie's value.
- Removed customer logoff as an option (for simplification); if the customer chooses to logoff from the store, the "Remember Me" cookie expires.
- v1.3, 2009-11-06 (Linxor):
- Updated script to be compatible with ZC v1.3.8a. This was mainly for changes to core files and tpl_login_default.php
- Removed need to modify core file: includes/modules/pages/index/header_php.php
- Added configuration item to set how long you want to remember the user.
- The cookie is given a new lease when the user revisits the site.
- Changed string in language file from "NB." to "Please Note:" since "NB." is less common vernacular.