From 3766c7e4a5deab6ba9b199f5da1c69a66930bbdc Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 11:38:31 +0200 Subject: [PATCH 01/18] Added better README.md --- README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ad90c00..9b286b9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,57 @@ -# FIREGENTO CUSTOMER +FireGento_Customer +================== -Extended version of Core Customer models. New functionalities: +This extension extends the core functionality of the customer module of Magento. + +Branches +-------- +* master => stable version of the extension +* develop => contains new features + +Facts +----- +- Version: check [config.xml](https://github.com/firegento/firegento-customer/blob/master/src/app/code/community/FireGento/Customer/etc/config.xml) +- [Extension auf GitHub](https://github.com/firegento/firegento-customer/) + +Description +----------- +This extension extends the core functionality of the customer module of Magento. The features of this extension are: * Customers can be deactivated. Deactivated customers can be filtered in customer grid. -* Customers are temporarily deactivated if wrong password given too often. \ No newline at end of file +* Customers are temporarily deactivated if wrong password is entered too often. +* Password can be validated and rejected (password strength, password length, ..) + +Requirements +------------ +- PHP >= 5.3.0 + +Compatibility +------------- +- Magento >= 1.6 + +Installation Instructions +------------------------- +1. Install the extension by copying all the extension files into your document root. +2. Clear the cache, logout from the admin panel and then login again. +3. You can now configure the extenion via *System -> Configuration -> Customer -> Customer Configuration -> Password* + +Support +------- +If you have any issues with this extension, open an issue on [GitHub](https://github.com/firegento/firegento-customer/issues). + +Contribution +------------ +Any contribution is highly appreciated. The best way to contribute code is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests). + +Developer +--------- +- Website: [http://firegento.com](http://firegento.com) +- Twitter: [@firegento](https://twitter.com/firegento) + +Licence +------- +[GNU General Public License, version 3 (GPLv3)](http://opensource.org/licenses/gpl-3.0) + +Copyright +--------- +(c) 2013 FireGento From a651a020eef570cfaf669693192f56e13ebd0bf0 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 11:40:00 +0200 Subject: [PATCH 02/18] Minor readme fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b286b9..c09632e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Branches Facts ----- - Version: check [config.xml](https://github.com/firegento/firegento-customer/blob/master/src/app/code/community/FireGento/Customer/etc/config.xml) -- [Extension auf GitHub](https://github.com/firegento/firegento-customer/) +- [Extension on GitHub](https://github.com/firegento/firegento-customer/) Description ----------- From 8494a6106d88ba15f4184a95b19394a5c95d7bf0 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 11:49:34 +0200 Subject: [PATCH 03/18] Added system config options for minimum password length --- .../FireGento/Customer/etc/config.xml | 2 ++ .../FireGento/Customer/etc/system.xml | 21 +++++++++++++++++++ src/app/locale/de_DE/FireGento_Customer.csv | 3 +++ 3 files changed, 26 insertions(+) diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index 82b02f3..3080858 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -114,6 +114,8 @@ 5 900 900 + 1 + 8 diff --git a/src/app/code/community/FireGento/Customer/etc/system.xml b/src/app/code/community/FireGento/Customer/etc/system.xml index 2223a3d..279e496 100644 --- a/src/app/code/community/FireGento/Customer/etc/system.xml +++ b/src/app/code/community/FireGento/Customer/etc/system.xml @@ -49,6 +49,27 @@ 1 0 + + + select + adminhtml/system_config_source_yesno + 1030 + 1 + 1 + 0 + + + + If minimum password lenght is set below or equal to zero the default value of 8 will be used. + text + 1040 + 1 + 1 + 0 + + 1 + + diff --git a/src/app/locale/de_DE/FireGento_Customer.csv b/src/app/locale/de_DE/FireGento_Customer.csv index 28770da..72e768f 100644 --- a/src/app/locale/de_DE/FireGento_Customer.csv +++ b/src/app/locale/de_DE/FireGento_Customer.csv @@ -13,3 +13,6 @@ "Your email address and your password can not be equal.","Ihre E-Mail Adresse darf nicht mit dem Passwort übereinstimmen." "Your password length must be greater than 8.","Ihr Passwort muss länger mindestens neun Zeichen lang sein." "Your password must contain at least one uppercase character, one lowercase character and one digit.","Ihr Passwort muss mindestens einen Groß- und Kleinbuchstaben, sowie mindestens eine Ziffer enthalten." +"Check minimum Password length?","Überprüfe Mindest-Passwortlänge?" +"Minimum Password length","Mindest-Passwortlänge" +"If minimum password lenght is set below or equal to zero the default value of 8 will be used.","Wenn die Mindest-Passwortlänge kleiner oder gleich 0 ist, wird der Standardwert von 8 verwendet." From f1d31cd64b61dd5f187413ba8a0299109ab089d1 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 11:56:25 +0200 Subject: [PATCH 04/18] Added system config options for password complexity --- .../code/community/FireGento/Customer/etc/config.xml | 1 + .../code/community/FireGento/Customer/etc/system.xml | 10 ++++++++++ src/app/locale/de_DE/FireGento_Customer.csv | 2 ++ 3 files changed, 13 insertions(+) diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index 3080858..c1092c0 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -116,6 +116,7 @@ 900 1 8 + 1 diff --git a/src/app/code/community/FireGento/Customer/etc/system.xml b/src/app/code/community/FireGento/Customer/etc/system.xml index 279e496..f36e874 100644 --- a/src/app/code/community/FireGento/Customer/etc/system.xml +++ b/src/app/code/community/FireGento/Customer/etc/system.xml @@ -70,6 +70,16 @@ 1 + + + If activated, password must contain at least one uppercase character, one lowercase character and one digit. + select + adminhtml/system_config_source_yesno + 1050 + 1 + 1 + 0 + diff --git a/src/app/locale/de_DE/FireGento_Customer.csv b/src/app/locale/de_DE/FireGento_Customer.csv index 72e768f..b87140a 100644 --- a/src/app/locale/de_DE/FireGento_Customer.csv +++ b/src/app/locale/de_DE/FireGento_Customer.csv @@ -16,3 +16,5 @@ "Check minimum Password length?","Überprüfe Mindest-Passwortlänge?" "Minimum Password length","Mindest-Passwortlänge" "If minimum password lenght is set below or equal to zero the default value of 8 will be used.","Wenn die Mindest-Passwortlänge kleiner oder gleich 0 ist, wird der Standardwert von 8 verwendet." +"Check password complexity?","Überprüfe Passwort-Komplexität?" +"If activated, password must contain at least one uppercase character, one lowercase character and one digit.","Wenn aktiviert, muss das Passwort muss mindestens einen Groß- und Kleinbuchstaben, sowie mindestens eine Ziffer enthalten." From f6090a8afbf3c70f2c2b5b1cd29324d53609bad9 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 12:08:47 +0200 Subject: [PATCH 05/18] Implemented system config values in observer --- .../FireGento/Customer/Model/Observer.php | 55 +++++++++++-------- src/app/locale/de_DE/FireGento_Customer.csv | 2 +- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/app/code/community/FireGento/Customer/Model/Observer.php b/src/app/code/community/FireGento/Customer/Model/Observer.php index e7ea975..438af1f 100644 --- a/src/app/code/community/FireGento/Customer/Model/Observer.php +++ b/src/app/code/community/FireGento/Customer/Model/Observer.php @@ -31,9 +31,12 @@ */ class FireGento_Customer_Model_Observer { - const XML_PATH_LOGIN_ATTEMPTS = 'customer/password/login_attempts'; + const XML_PATH_LOGIN_ATTEMPTS = 'customer/password/login_attempts'; const XML_PATH_LOGIN_ATTEMPT_SPAN = 'customer/password/login_attempt_span'; - const XML_PATH_LOGIN_LOCK_TIME = 'customer/password/login_lock_time'; + const XML_PATH_LOGIN_LOCK_TIME = 'customer/password/login_lock_time'; + const XML_PATH_CHECK_PASSWORD_MIN_LENGTH = 'customer/password/check_password_min_length'; + const XML_PATH_PASSWORD_MIN_LENGTH = 'customer/password/password_min_length'; + const XML_PATH_CHECK_PASSWORD_COMPLEXITY = 'customer/password/check_password_complexity'; /** * Retrieve the helper class @@ -276,6 +279,7 @@ public function checkPasswordStrengthAtOnepageRegistration(Varien_Event_Observer Mage::helper('core')->jsonEncode($error) ); } + return $this; } @@ -284,9 +288,9 @@ public function checkPasswordStrengthAtOnepageRegistration(Varien_Event_Observer * started, if a password was given within the running process. * * @throws FireGento_Customer_Exception - * @param string $email Email Address - * @param string $password Password - * @return FireGento_Customer_Model_Observer Self. + * @param string $email + * @param string $password + * @return FireGento_Customer_Model_Observer */ protected function _validatePassword($email, $password) { @@ -295,32 +299,37 @@ protected function _validatePassword($email, $password) return $this; } - /* - * VALIDATIONS - */ - // password must not be equal to email + // Password must not be equal to email if ($email == $password) { throw new FireGento_Customer_Exception( $this->_getHelper()->__('Your email address and your password can not be equal.') ); } - // minimum password length = 9 - if (strlen($password) < 9) { - throw new FireGento_Customer_Exception( - $this->_getHelper()->__('Your password length must be greater than 8.') - ); + // Validate minimum password length + if (Mage::getStoreConfigFlag(self::XML_PATH_CHECK_PASSWORD_MIN_LENGTH)) { + $minLength = Mage::getStoreConfig(self::XML_PATH_PASSWORD_MIN_LENGTH); + if (!$minLength || $minLength <= 0) { + $minLength = 8; + } + + if (strlen($password) <= $minLength) { + throw new FireGento_Customer_Exception( + $this->_getHelper()->__('Your password length must be greater than %s.', $minLength) + ); + } } - // password must be complex enough - if (preg_match('/[A-Z]/',$password) == 0 - || preg_match('/[a-z]/',$password) == 0 - || preg_match('/[0-9]/',$password) == 0 - ) { - throw new FireGento_Customer_Exception( - $this->_getHelper()->__('Your password must contain at least one uppercase character, one lowercase character and one digit.') - ); + // Validate password complexity + if (Mage::getStoreConfigFlag(self::XML_PATH_CHECK_PASSWORD_COMPLEXITY)) { + if (preg_match('/[A-Z]/', $password) == 0 + || preg_match('/[a-z]/', $password) == 0 + || preg_match('/[0-9]/', $password) == 0 + ) { + throw new FireGento_Customer_Exception( + $this->_getHelper()->__('Your password must contain at least one uppercase character, one lowercase character and one digit.') + ); + } } - return $this; } } diff --git a/src/app/locale/de_DE/FireGento_Customer.csv b/src/app/locale/de_DE/FireGento_Customer.csv index b87140a..f7eaaaf 100644 --- a/src/app/locale/de_DE/FireGento_Customer.csv +++ b/src/app/locale/de_DE/FireGento_Customer.csv @@ -11,7 +11,7 @@ "Your account is currently not active.", "Ihr Konto ist aktuell nicht aktiv." "Your account is locked due to too many failed login attempts.","Ihr Konto wurde aufgrund zu vieler fehlerhafter Login-Versuche leider gesperrt." "Your email address and your password can not be equal.","Ihre E-Mail Adresse darf nicht mit dem Passwort übereinstimmen." -"Your password length must be greater than 8.","Ihr Passwort muss länger mindestens neun Zeichen lang sein." +"Your password length must be greater than %s.","Ihr Passwort muss länger mindestens %s Zeichen lang sein." "Your password must contain at least one uppercase character, one lowercase character and one digit.","Ihr Passwort muss mindestens einen Groß- und Kleinbuchstaben, sowie mindestens eine Ziffer enthalten." "Check minimum Password length?","Überprüfe Mindest-Passwortlänge?" "Minimum Password length","Mindest-Passwortlänge" From d7fe20f331315ac80f9c8dce5a4e4c591375333b Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 12:20:24 +0200 Subject: [PATCH 06/18] Refactoring --- .../FireGento/Customer/Helper/Redirect.php | 40 ++++++++++--------- .../FireGento/Customer/Model/Observer.php | 33 +++++++-------- .../install-0.1.0.php | 6 +-- .../upgrade-0.1.0-0.0.1.1.php | 11 +++-- 4 files changed, 44 insertions(+), 46 deletions(-) diff --git a/src/app/code/community/FireGento/Customer/Helper/Redirect.php b/src/app/code/community/FireGento/Customer/Helper/Redirect.php index e915c4f..fa3c906 100644 --- a/src/app/code/community/FireGento/Customer/Helper/Redirect.php +++ b/src/app/code/community/FireGento/Customer/Helper/Redirect.php @@ -31,7 +31,6 @@ */ class FireGento_Customer_Helper_Redirect extends FireGento_Customer_Helper_Data { - /** * Define target URL and redirect customer after logging in */ @@ -74,9 +73,10 @@ public function _loginPostRedirect() } $this->_redirectUrl($session->getBeforeAuthUrl(true)); } - + /** - * + * Retrieve the current request + * * @return Mage_Core_Controller_Request_Http */ public function getRequest() @@ -84,14 +84,15 @@ public function getRequest() return Mage::app()->getRequest(); } - /** - * - * @return Mage_Core_Controller_Response_Http - */ - public function getResponse() - { - return Mage::app()->getResponse(); - } + /** + * Retrieve the current response + * + * @return Mage_Core_Controller_Response_Http + */ + public function getResponse() + { + return Mage::app()->getResponse(); + } /** * Retrieve customer session model object @@ -102,33 +103,36 @@ public function _getSession() { return Mage::getSingleton('customer/session'); } - + /** * Check url to be used as internal * - * @param string $url - * @return bool + * @param string $url + * @return bool */ public function _isUrlInternal($url) { if (strpos($url, 'http') !== false) { - /** + + /* * Url must start from base secure or base unsecure url */ + if ((strpos($url, Mage::app()->getStore()->getBaseUrl()) === 0) || (strpos($url, Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, true)) === 0) ) { return true; } } + return false; } - + /** * Set redirect url into response * - * @param string $url - * @return Mage_Core_Controller_Varien_Action + * @param string $url + * @return Mage_Core_Controller_Varien_Action */ public function _redirectUrl($url) { diff --git a/src/app/code/community/FireGento/Customer/Model/Observer.php b/src/app/code/community/FireGento/Customer/Model/Observer.php index 438af1f..89bd100 100644 --- a/src/app/code/community/FireGento/Customer/Model/Observer.php +++ b/src/app/code/community/FireGento/Customer/Model/Observer.php @@ -41,7 +41,7 @@ class FireGento_Customer_Model_Observer /** * Retrieve the helper class * - * @return FireGento_Customer_Helper_Data Helper + * @return FireGento_Customer_Helper_Data */ protected function _getHelper() { @@ -61,7 +61,7 @@ protected function _getSession() /** * Retrieve the current website ID * - * @return int Website ID + * @return int */ public function _getWebsiteId() { @@ -72,14 +72,12 @@ public function _getWebsiteId() * Validates the customer password upon save. * * @throws Exception - * @param Varien_Event_Observer $observer Observer - * @return FireGento_Customer_Model_Observer Self. + * @param Varien_Event_Observer $observer */ public function customerSaveBefore(Varien_Event_Observer $observer) { $customer = $observer->getCustomer(); $this->_validatePassword($customer->getEmail(), $customer->getPassword()); - return $this; } /** @@ -88,14 +86,13 @@ public function customerSaveBefore(Varien_Event_Observer $observer) * * Observer for controller_action_predispatch_customer_account_loginPost event. * - * @param Varien_Event_Observer $observer Observer - * @return FireGento_Customer_Model_Observer Self. + * @param Varien_Event_Observer $observer */ public function validateCustomerActivationBeforeLogin(Varien_Event_Observer $observer) { $controller = $observer->getControllerAction(); - try { + try { $loginParams = $controller->getRequest()->getParam('login'); if (isset($loginParams['username'])) { $validator = new Zend_Validate_EmailAddress(); @@ -122,8 +119,7 @@ public function validateCustomerActivationBeforeLogin(Varien_Event_Observer $obs ); } } - } - catch (Exception $e) { + } catch (Exception $e) { $this->_getSession()->addError($this->_getHelper()->__($e->getMessage())); // Set no-dispatch flag @@ -136,15 +132,13 @@ public function validateCustomerActivationBeforeLogin(Varien_Event_Observer $obs // Redirect to login page Mage::helper('firegento_customer/redirect')->_loginPostRedirect(); } - return $this; } /** * Validates if a customer account is active. * * @throws FireGento_Customer_Exception - * @param Mage_Customer_Model_Customer $customer Customer Instance - * @return void + * @param Mage_Customer_Model_Customer $customer */ protected function _validateCustomerActivationStatus($customer) { @@ -158,6 +152,7 @@ protected function _validateCustomerActivationStatus($customer) /* * Check if the last failed login ban is over */ + $now = time(); $lockDuration = Mage::getStoreConfig(self::XML_PATH_LOGIN_LOCK_TIME); $lastAttempt = $customer->getData('customer_last_login_failed'); @@ -171,6 +166,7 @@ protected function _validateCustomerActivationStatus($customer) /* * Check if the login attempts reached the ban limit */ + $loginAttempts = $customer->getData('customer_logins_failed'); $attemptLock = $loginAttempts >= Mage::getStoreConfig(self::XML_PATH_LOGIN_ATTEMPTS); $timeLock = ($now - $lastAttempt < $lockDuration); @@ -193,8 +189,7 @@ protected function _validateCustomerActivationStatus($customer) * * Observer for controller_action_postdispatch_customer_account_loginPost event * - * @param Varien_Event_Observer $observer Observer - * @return FireGento_Customer_Model_Observer Self. + * @param Varien_Event_Observer $observer */ public function countFailedLogins(Varien_Event_Observer $observer) { @@ -232,13 +227,12 @@ public function countFailedLogins(Varien_Event_Observer $observer) } } } - } else { // if (!$this->_getSession()->isLoggedIn()) + } else { $customer = $this->_getSession()->getCustomer(); $customer->setData('customer_logins_failed', 0) ->setData('customer_last_login_failed', 0) ->save(); } - return $this; } /** @@ -246,8 +240,8 @@ public function countFailedLogins(Varien_Event_Observer $observer) * * Observer for controller_action_postdispatch_checkout_onepage_saveBilling event. * - * @param Varien_Event_Observer $observer Observer - * @return FireGento_Customer_Model_Observer Self. + * @param Varien_Event_Observer $observer + * @return FireGento_Customer_Model_Observer */ public function checkPasswordStrengthAtOnepageRegistration(Varien_Event_Observer $observer) { @@ -275,6 +269,7 @@ public function checkPasswordStrengthAtOnepageRegistration(Varien_Event_Observer 'error' => -1, 'message' => $e->getMessage(), ); + $controllerAction->getResponse()->setBody( Mage::helper('core')->jsonEncode($error) ); diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php index ad03cb0..234d8e8 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php @@ -59,8 +59,8 @@ Mage::getSingleton('eav/config') ->getAttribute('customer', $attributeName) - ->setData('used_in_forms', array('adminhtml_customer')) - ->save(); + ->setData('used_in_forms', array('adminhtml_customer')) + ->save(); /* * ATTRIBUTE: customer_logins_failed @@ -98,4 +98,4 @@ ) ); -$installer->endSetup(); \ No newline at end of file +$installer->endSetup(); diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php index 392d2cf..e2efd9d 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php @@ -35,12 +35,11 @@ $installer->startSetup(); // update customers -$model = Mage::getModel("customer/customer")->getCollection(); -foreach($model as $_customer) -{ - Mage::getModel("customer/customer")->load($_customer->getId()) - ->setCustomerActive(1) - ->save(); +$collection = Mage::getModel('customer/customer')->getCollection(); +foreach ($collection as $customer) { + Mage::getModel('customer/customer')->load($customer->getId()) + ->setCustomerActive(1) + ->save(); } $installer->endSetup(); From b4b414ad1448a10cec0d4bb4a9ac502fbcceb6c0 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 12:33:08 +0200 Subject: [PATCH 07/18] Modified Docs --- .../community/FireGento/Customer/Exception.php | 10 +++++----- .../FireGento/Customer/Helper/Data.php | 10 +++++----- .../FireGento/Customer/Helper/Redirect.php | 4 ++-- .../FireGento/Customer/Model/Observer.php | 8 ++++---- .../FireGento/Customer/etc/config.xml | 2 +- .../FireGento/Customer/etc/system.xml | 2 +- .../firegento_customer_setup/install-0.1.0.php | 8 ++++---- .../upgrade-0.1.0-0.0.1.1.php | 8 ++++---- .../base/default/layout/firegento_customer.xml | 17 +++++++++++++++++ src/app/etc/modules/FireGento_Customer.xml | 4 ++-- src/js/firegentocustomer.js | 18 +++++++++++++++++- 11 files changed, 62 insertions(+), 29 deletions(-) diff --git a/src/app/code/community/FireGento/Customer/Exception.php b/src/app/code/community/FireGento/Customer/Exception.php index 6e910ff..e7228a7 100644 --- a/src/app/code/community/FireGento/Customer/Exception.php +++ b/src/app/code/community/FireGento/Customer/Exception.php @@ -15,9 +15,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /** * Custom exception class for password violations @@ -25,11 +25,11 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ class FireGento_Customer_Exception extends Mage_Core_Exception { -} \ No newline at end of file +} diff --git a/src/app/code/community/FireGento/Customer/Helper/Data.php b/src/app/code/community/FireGento/Customer/Helper/Data.php index 7688a46..5d7bea7 100644 --- a/src/app/code/community/FireGento/Customer/Helper/Data.php +++ b/src/app/code/community/FireGento/Customer/Helper/Data.php @@ -15,9 +15,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /** * Helper class @@ -25,11 +25,11 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ class FireGento_Customer_Helper_Data extends Mage_Customer_Helper_Data { - + } diff --git a/src/app/code/community/FireGento/Customer/Helper/Redirect.php b/src/app/code/community/FireGento/Customer/Helper/Redirect.php index fa3c906..3549dc1 100644 --- a/src/app/code/community/FireGento/Customer/Helper/Redirect.php +++ b/src/app/code/community/FireGento/Customer/Helper/Redirect.php @@ -17,7 +17,7 @@ * @author FireGento Team * @copyright 2013 FireGento Team (http://www.firegento.de). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /** * Helper class @@ -27,7 +27,7 @@ * @author FireGento Team * @copyright 2013 FireGento Team (http://www.firegento.de). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ class FireGento_Customer_Helper_Redirect extends FireGento_Customer_Helper_Data { diff --git a/src/app/code/community/FireGento/Customer/Model/Observer.php b/src/app/code/community/FireGento/Customer/Model/Observer.php index 89bd100..f7e6be6 100644 --- a/src/app/code/community/FireGento/Customer/Model/Observer.php +++ b/src/app/code/community/FireGento/Customer/Model/Observer.php @@ -15,9 +15,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /** * Observer @@ -25,9 +25,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ class FireGento_Customer_Model_Observer { diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index c1092c0..fa8bffb 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -12,7 +12,7 @@ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) */ --> diff --git a/src/app/code/community/FireGento/Customer/etc/system.xml b/src/app/code/community/FireGento/Customer/etc/system.xml index f36e874..a75d684 100644 --- a/src/app/code/community/FireGento/Customer/etc/system.xml +++ b/src/app/code/community/FireGento/Customer/etc/system.xml @@ -12,7 +12,7 @@ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) */ --> diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php index 234d8e8..5fff836 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php @@ -15,9 +15,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /** * Setup script @@ -25,9 +25,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /* @var $installer Mage_Eav_Model_Entity_Setup */ diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php index e2efd9d..fff3923 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php @@ -15,9 +15,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /** * Setup script @@ -25,9 +25,9 @@ * @category FireGento * @package FireGento_Customer * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $$Id$$ + * @version $Id:$ */ /* @var $installer Mage_Eav_Model_Entity_Setup */ diff --git a/src/app/design/frontend/base/default/layout/firegento_customer.xml b/src/app/design/frontend/base/default/layout/firegento_customer.xml index a891519..a7cd01c 100644 --- a/src/app/design/frontend/base/default/layout/firegento_customer.xml +++ b/src/app/design/frontend/base/default/layout/firegento_customer.xml @@ -1,4 +1,21 @@ + diff --git a/src/app/etc/modules/FireGento_Customer.xml b/src/app/etc/modules/FireGento_Customer.xml index bfb50ba..742161a 100644 --- a/src/app/etc/modules/FireGento_Customer.xml +++ b/src/app/etc/modules/FireGento_Customer.xml @@ -12,7 +12,7 @@ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * @author FireGento Team - * @copyright 2011 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) */ --> @@ -23,4 +23,4 @@ community - \ No newline at end of file + diff --git a/src/js/firegentocustomer.js b/src/js/firegentocustomer.js index e405a53..8959c85 100644 --- a/src/js/firegentocustomer.js +++ b/src/js/firegentocustomer.js @@ -1,6 +1,22 @@ +/** + * This file is part of the FIREGENTO project. + * + * FireGento_Core is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * This script is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * @author FireGento Team + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ + var validator = Validation.methods['validate-password']; validator.test = function(v) { var pass=v.strip(); /*strip leading and trailing spaces*/ return !(pass.length>0 && pass.length < 9); }; -validator.error = 'Please enter 9 or more characters. Leading or trailing spaces will be ignored.'; \ No newline at end of file +validator.error = 'Please enter 9 or more characters. Leading or trailing spaces will be ignored.'; From 14572af5699057e3a8b213ff56ec98be3df01d1d Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 7 Sep 2013 13:02:45 +0200 Subject: [PATCH 08/18] Moved JS validation to template to allow dynamic password length --- modman | 10 +-- .../FireGento/Customer/Block/Password.php | 71 +++++++++++++++++++ .../FireGento/Customer/etc/config.xml | 5 ++ .../default/layout/firegento_customer.xml | 4 +- .../firegento/customer/password.phtml} | 28 ++++++-- 5 files changed, 105 insertions(+), 13 deletions(-) create mode 100644 src/app/code/community/FireGento/Customer/Block/Password.php rename src/{js/firegentocustomer.js => app/design/frontend/base/default/template/firegento/customer/password.phtml} (52%) diff --git a/modman b/modman index 243ad20..9bb0899 100644 --- a/modman +++ b/modman @@ -1,6 +1,6 @@ -src/app/code/community/FireGento/Customer app/code/community/FireGento/Customer +src/app/code/community/FireGento/Customer app/code/community/FireGento/Customer src/app/design/frontend/base/default/layout/firegento_customer.xml app/design/frontend/base/default/layout/firegento_customer.xml -src/app/etc/modules/FireGento_Customer.xml app/etc/modules/FireGento_Customer.xml -src/app/locale/de_DE/FireGento_Customer.csv app/locale/de_DE/FireGento_Customer.csv -src/app/locale/en_US/FireGento_Customer.csv app/locale/en_US/FireGento_Customer.csv -src/js/firegentocustomer.js js/firegentocustomer.js +src/app/design/frontend/base/default/template/firegento/customer/ app/design/frontend/base/default/template/firegento/customer/ +src/app/etc/modules/FireGento_Customer.xml app/etc/modules/FireGento_Customer.xml +src/app/locale/de_DE/FireGento_Customer.csv app/locale/de_DE/FireGento_Customer.csv +src/app/locale/en_US/FireGento_Customer.csv app/locale/en_US/FireGento_Customer.csv diff --git a/src/app/code/community/FireGento/Customer/Block/Password.php b/src/app/code/community/FireGento/Customer/Block/Password.php new file mode 100644 index 0000000..2072486 --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Block/Password.php @@ -0,0 +1,71 @@ + + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + * @version $Id:$ + */ +/** + * Helper class + * + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team + * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + * @version $Id:$ + */ +class FireGento_Customer_Block_Password extends Mage_Core_Block_Template +{ + /** + * Set the block template + */ + protected function _construct() + { + parent::_construct(); + $this->setTemplate('firegento/customer/password.phtml'); + } + + /** + * Retrieve the minimum password length + * + * @return int + */ + public function getMinimumPasswordLength() + { + $minLength = (int) Mage::getStoreConfig('customer/password/password_min_length'); + if (!$minLength || $minLength <= 0) { + $minLength = 8; + } + + return $minLength; + } + + /** + * Deactivate output if not activated + * + * @return string + */ + protected function _toHtml() + { + if (!Mage::getStoreConfigFlag('customer/password/check_password_min_length')) { + return ''; + } + + return parent::_toHtml(); + } +} diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index fa8bffb..312bf63 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -23,6 +23,11 @@ + + + FireGento_Customer_Block + + FireGento_Customer_Helper diff --git a/src/app/design/frontend/base/default/layout/firegento_customer.xml b/src/app/design/frontend/base/default/layout/firegento_customer.xml index a7cd01c..60923b3 100644 --- a/src/app/design/frontend/base/default/layout/firegento_customer.xml +++ b/src/app/design/frontend/base/default/layout/firegento_customer.xml @@ -18,8 +18,8 @@ --> - - + + diff --git a/src/js/firegentocustomer.js b/src/app/design/frontend/base/default/template/firegento/customer/password.phtml similarity index 52% rename from src/js/firegentocustomer.js rename to src/app/design/frontend/base/default/template/firegento/customer/password.phtml index 8959c85..b2dca2c 100644 --- a/src/js/firegentocustomer.js +++ b/src/app/design/frontend/base/default/template/firegento/customer/password.phtml @@ -1,3 +1,4 @@ + + + From ae03b1d7dfe067c0af3eb82a10ff08fd0b5741ed Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 12:08:51 +0200 Subject: [PATCH 09/18] Fixes + Translation --- .../FireGento/Customer/etc/jstranslator.xml | 6 +++++ .../default/layout/firegento_customer.xml | 2 +- .../firegento/customer/password.phtml | 23 +++++++++++-------- src/app/locale/de_DE/FireGento_Customer.csv | 1 + 4 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 src/app/code/community/FireGento/Customer/etc/jstranslator.xml diff --git a/src/app/code/community/FireGento/Customer/etc/jstranslator.xml b/src/app/code/community/FireGento/Customer/etc/jstranslator.xml new file mode 100644 index 0000000..ef56bbb --- /dev/null +++ b/src/app/code/community/FireGento/Customer/etc/jstranslator.xml @@ -0,0 +1,6 @@ + + + + Please enter %d or more characters. Leading or trailing spaces will be ignored. + + diff --git a/src/app/design/frontend/base/default/layout/firegento_customer.xml b/src/app/design/frontend/base/default/layout/firegento_customer.xml index 60923b3..019cf27 100644 --- a/src/app/design/frontend/base/default/layout/firegento_customer.xml +++ b/src/app/design/frontend/base/default/layout/firegento_customer.xml @@ -18,7 +18,7 @@ --> - + diff --git a/src/app/design/frontend/base/default/template/firegento/customer/password.phtml b/src/app/design/frontend/base/default/template/firegento/customer/password.phtml index b2dca2c..27293aa 100644 --- a/src/app/design/frontend/base/default/template/firegento/customer/password.phtml +++ b/src/app/design/frontend/base/default/template/firegento/customer/password.phtml @@ -22,17 +22,20 @@ ?> diff --git a/src/app/locale/de_DE/FireGento_Customer.csv b/src/app/locale/de_DE/FireGento_Customer.csv index f7eaaaf..8a77300 100644 --- a/src/app/locale/de_DE/FireGento_Customer.csv +++ b/src/app/locale/de_DE/FireGento_Customer.csv @@ -18,3 +18,4 @@ "If minimum password lenght is set below or equal to zero the default value of 8 will be used.","Wenn die Mindest-Passwortlänge kleiner oder gleich 0 ist, wird der Standardwert von 8 verwendet." "Check password complexity?","Überprüfe Passwort-Komplexität?" "If activated, password must contain at least one uppercase character, one lowercase character and one digit.","Wenn aktiviert, muss das Passwort muss mindestens einen Groß- und Kleinbuchstaben, sowie mindestens eine Ziffer enthalten." +"Please enter %d or more characters. Leading or trailing spaces will be ignored.","Bitte geben Sie mehr als %d Zeichen ein. Leerzeichen am Anfang und am Ende werden ignoriert." From edc6696af62625674b650076bd2c82fce24d54c3 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 12:25:29 +0200 Subject: [PATCH 10/18] [+TASK] Code style and code docs --- .../FireGento/Customer/Block/Password.php | 22 +++----- .../FireGento/Customer/Exception.php | 18 +++--- .../FireGento/Customer/Helper/Data.php | 18 +++--- .../FireGento/Customer/Helper/Redirect.php | 31 +++++------ .../FireGento/Customer/Model/Observer.php | 55 +++++++++---------- .../FireGento/Customer/etc/config.xml | 8 ++- .../FireGento/Customer/etc/jstranslator.xml | 19 +++++++ .../FireGento/Customer/etc/system.xml | 8 ++- .../install-0.1.0.php | 19 +++---- .../upgrade-0.1.0-0.0.1.1.php | 18 +++--- .../default/layout/firegento_customer.xml | 8 ++- .../firegento/customer/password.phtml | 8 ++- src/app/etc/modules/FireGento_Customer.xml | 11 +++- 13 files changed, 124 insertions(+), 119 deletions(-) diff --git a/src/app/code/community/FireGento/Customer/Block/Password.php b/src/app/code/community/FireGento/Customer/Block/Password.php index 2072486..eb8addc 100644 --- a/src/app/code/community/FireGento/Customer/Block/Password.php +++ b/src/app/code/community/FireGento/Customer/Block/Password.php @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ */ /** - * Helper class + * Adds the custom password validation rules to the page if activated * - * @category FireGento - * @package FireGento_Customer - * @author FireGento Team - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. - * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team */ class FireGento_Customer_Block_Password extends Mage_Core_Block_Template { @@ -43,7 +39,7 @@ protected function _construct() /** * Retrieve the minimum password length * - * @return int + * @return int Minimum Password length */ public function getMinimumPasswordLength() { @@ -58,7 +54,7 @@ public function getMinimumPasswordLength() /** * Deactivate output if not activated * - * @return string + * @return string Rendered output */ protected function _toHtml() { diff --git a/src/app/code/community/FireGento/Customer/Exception.php b/src/app/code/community/FireGento/Customer/Exception.php index e7228a7..5677916 100644 --- a/src/app/code/community/FireGento/Customer/Exception.php +++ b/src/app/code/community/FireGento/Customer/Exception.php @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ */ /** - * Custom exception class for password violations + * Custom exception class. * - * @category FireGento - * @package FireGento_Customer - * @author FireGento Team - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. - * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team */ class FireGento_Customer_Exception extends Mage_Core_Exception { diff --git a/src/app/code/community/FireGento/Customer/Helper/Data.php b/src/app/code/community/FireGento/Customer/Helper/Data.php index 5d7bea7..ba085b2 100644 --- a/src/app/code/community/FireGento/Customer/Helper/Data.php +++ b/src/app/code/community/FireGento/Customer/Helper/Data.php @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ */ /** - * Helper class + * Helper class for translations, etc. * - * @category FireGento - * @package FireGento_Customer - * @author FireGento Team - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. - * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team */ class FireGento_Customer_Helper_Data extends Mage_Customer_Helper_Data { diff --git a/src/app/code/community/FireGento/Customer/Helper/Redirect.php b/src/app/code/community/FireGento/Customer/Helper/Redirect.php index 3549dc1..3c9f3c8 100644 --- a/src/app/code/community/FireGento/Customer/Helper/Redirect.php +++ b/src/app/code/community/FireGento/Customer/Helper/Redirect.php @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.de). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ */ /** - * Helper class + * Redirect url helper for redirecting the customer if validations returned an error. * - * @category FireGento - * @package FireGento_Customer - * @author FireGento Team - * @copyright 2013 FireGento Team (http://www.firegento.de). All rights served. - * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team */ class FireGento_Customer_Helper_Redirect extends FireGento_Customer_Helper_Data { @@ -71,13 +67,14 @@ public function _loginPostRedirect() $session->setBeforeAuthUrl($session->getAfterAuthUrl(true)); } } + $this->_redirectUrl($session->getBeforeAuthUrl(true)); } /** * Retrieve the current request * - * @return Mage_Core_Controller_Request_Http + * @return Mage_Core_Controller_Request_Http Request Object */ public function getRequest() { @@ -87,7 +84,7 @@ public function getRequest() /** * Retrieve the current response * - * @return Mage_Core_Controller_Response_Http + * @return Mage_Core_Controller_Response_Http Response Object */ public function getResponse() { @@ -97,7 +94,7 @@ public function getResponse() /** * Retrieve customer session model object * - * @return Mage_Customer_Model_Session + * @return Mage_Customer_Model_Session Customer Session */ public function _getSession() { @@ -107,8 +104,8 @@ public function _getSession() /** * Check url to be used as internal * - * @param string $url - * @return bool + * @param string $url Url to check + * @return bool Flag if url is internal */ public function _isUrlInternal($url) { @@ -131,7 +128,7 @@ public function _isUrlInternal($url) /** * Set redirect url into response * - * @param string $url + * @param string $url Redirect URL * @return Mage_Core_Controller_Varien_Action */ public function _redirectUrl($url) diff --git a/src/app/code/community/FireGento/Customer/Model/Observer.php b/src/app/code/community/FireGento/Customer/Model/Observer.php index f7e6be6..2f003d0 100644 --- a/src/app/code/community/FireGento/Customer/Model/Observer.php +++ b/src/app/code/community/FireGento/Customer/Model/Observer.php @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ */ /** - * Observer + * Observer for password validations * - * @category FireGento - * @package FireGento_Customer - * @author FireGento Team - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. - * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team */ class FireGento_Customer_Model_Observer { @@ -41,7 +37,7 @@ class FireGento_Customer_Model_Observer /** * Retrieve the helper class * - * @return FireGento_Customer_Helper_Data + * @return FireGento_Customer_Helper_Data Helper Object */ protected function _getHelper() { @@ -51,7 +47,7 @@ protected function _getHelper() /** * Retrieve customer session model object * - * @return Mage_Customer_Model_Session + * @return Mage_Customer_Model_Session Customer Session */ protected function _getSession() { @@ -61,7 +57,7 @@ protected function _getSession() /** * Retrieve the current website ID * - * @return int + * @return int Current Website ID */ public function _getWebsiteId() { @@ -71,8 +67,7 @@ public function _getWebsiteId() /** * Validates the customer password upon save. * - * @throws Exception - * @param Varien_Event_Observer $observer + * @param Varien_Event_Observer $observer Observer Instance */ public function customerSaveBefore(Varien_Event_Observer $observer) { @@ -86,7 +81,7 @@ public function customerSaveBefore(Varien_Event_Observer $observer) * * Observer for controller_action_predispatch_customer_account_loginPost event. * - * @param Varien_Event_Observer $observer + * @param Varien_Event_Observer $observer Observer Instance */ public function validateCustomerActivationBeforeLogin(Varien_Event_Observer $observer) { @@ -137,8 +132,8 @@ public function validateCustomerActivationBeforeLogin(Varien_Event_Observer $obs /** * Validates if a customer account is active. * + * @param Mage_Customer_Model_Customer $customer Customer Model * @throws FireGento_Customer_Exception - * @param Mage_Customer_Model_Customer $customer */ protected function _validateCustomerActivationStatus($customer) { @@ -189,7 +184,7 @@ protected function _validateCustomerActivationStatus($customer) * * Observer for controller_action_postdispatch_customer_account_loginPost event * - * @param Varien_Event_Observer $observer + * @param Varien_Event_Observer $observer Observer Instance */ public function countFailedLogins(Varien_Event_Observer $observer) { @@ -240,14 +235,14 @@ public function countFailedLogins(Varien_Event_Observer $observer) * * Observer for controller_action_postdispatch_checkout_onepage_saveBilling event. * - * @param Varien_Event_Observer $observer - * @return FireGento_Customer_Model_Observer + * @param Varien_Event_Observer $observer Observer Instance + * @return FireGento_Customer_Model_Observer Self. */ public function checkPasswordStrengthAtOnepageRegistration(Varien_Event_Observer $observer) { $controllerAction = $observer->getControllerAction(); - /** @var Mage_Checkout_Model_Type_Onepage $onepage */ + /* @var $onepage Mage_Checkout_Model_Type_Onepage */ $onepage = $controllerAction->getOnepage(); // Check if customer wants to register @@ -257,8 +252,8 @@ public function checkPasswordStrengthAtOnepageRegistration(Varien_Event_Observer } // Get email and password from request params - $params = $observer->getControllerAction()->getRequest()->getParam('billing'); - $email = $params['email']; + $params = $observer->getControllerAction()->getRequest()->getParam('billing'); + $email = $params['email']; $password = $params['customer_password']; // Validate password and return error if invalid @@ -282,10 +277,10 @@ public function checkPasswordStrengthAtOnepageRegistration(Varien_Event_Observer * Validates the password against some common criterias. The validation is only * started, if a password was given within the running process. * + * @param string $email Customer Email + * @param string $password Customer Password * @throws FireGento_Customer_Exception - * @param string $email - * @param string $password - * @return FireGento_Customer_Model_Observer + * @return FireGento_Customer_Model_Observer Self. */ protected function _validatePassword($email, $password) { @@ -321,9 +316,9 @@ protected function _validatePassword($email, $password) || preg_match('/[a-z]/', $password) == 0 || preg_match('/[0-9]/', $password) == 0 ) { - throw new FireGento_Customer_Exception( - $this->_getHelper()->__('Your password must contain at least one uppercase character, one lowercase character and one digit.') - ); + $msg = 'Your password must contain at least one uppercase character, '; + $msg .= 'one lowercase character and one digit.'; + throw new FireGento_Customer_Exception($this->_getHelper()->__($msg)); } } } diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index 312bf63..5e49221 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -1,9 +1,9 @@ diff --git a/src/app/code/community/FireGento/Customer/etc/jstranslator.xml b/src/app/code/community/FireGento/Customer/etc/jstranslator.xml index ef56bbb..97f8659 100644 --- a/src/app/code/community/FireGento/Customer/etc/jstranslator.xml +++ b/src/app/code/community/FireGento/Customer/etc/jstranslator.xml @@ -1,4 +1,23 @@ + Please enter %d or more characters. Leading or trailing spaces will be ignored. diff --git a/src/app/code/community/FireGento/Customer/etc/system.xml b/src/app/code/community/FireGento/Customer/etc/system.xml index a75d684..e7a7e48 100644 --- a/src/app/code/community/FireGento/Customer/etc/system.xml +++ b/src/app/code/community/FireGento/Customer/etc/system.xml @@ -1,9 +1,9 @@ diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php index 5fff836..a543174 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ */ /** - * Setup script + * Setup Script * - * @category FireGento - * @package FireGento_Customer - * @author FireGento Team - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. - * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team */ + /* @var $installer Mage_Eav_Model_Entity_Setup */ $installer = $this; $installer->startSetup(); diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php index fff3923..20a8783 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ */ /** - * Setup script + * Setup Script * - * @category FireGento - * @package FireGento_Customer - * @author FireGento Team - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. - * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) - * @version $Id:$ + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team */ /* @var $installer Mage_Eav_Model_Entity_Setup */ diff --git a/src/app/design/frontend/base/default/layout/firegento_customer.xml b/src/app/design/frontend/base/default/layout/firegento_customer.xml index 019cf27..b9f6fae 100644 --- a/src/app/design/frontend/base/default/layout/firegento_customer.xml +++ b/src/app/design/frontend/base/default/layout/firegento_customer.xml @@ -1,9 +1,9 @@ diff --git a/src/app/design/frontend/base/default/template/firegento/customer/password.phtml b/src/app/design/frontend/base/default/template/firegento/customer/password.phtml index 27293aa..26b1175 100644 --- a/src/app/design/frontend/base/default/template/firegento/customer/password.phtml +++ b/src/app/design/frontend/base/default/template/firegento/customer/password.phtml @@ -1,8 +1,8 @@ - * @copyright 2013 FireGento Team (http://www.firegento.com). All rights served. + * @copyright 2013 FireGento Team (http://www.firegento.com) * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) */ ?> diff --git a/src/app/etc/modules/FireGento_Customer.xml b/src/app/etc/modules/FireGento_Customer.xml index 742161a..bd0d401 100644 --- a/src/app/etc/modules/FireGento_Customer.xml +++ b/src/app/etc/modules/FireGento_Customer.xml @@ -1,9 +1,9 @@ @@ -21,6 +23,9 @@ true community + + + From 0b8b7f4f1a1d92a113c4321e4846d2f928898efc Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 12:25:43 +0200 Subject: [PATCH 11/18] [+TASK] Added better composer.json --- composer.json | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 924797c..1a17eac 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,16 @@ { - "name": "firegento/customer", - "license": ["GPL-3.0"], - "type": "magento-module", - "description": "Activate/deactivate customers, deactivate customers after max-retry logins.", - "require": { - "magento-hackathon/magento-composer-installer": "*" - } + "name": "firegento/customer", + "license": ["GPL-3.0"], + "type": "magento-module", + "description": "Activate/deactivate customers, deactivate customers after max-retry logins.", + "homepage": "https://github.com/firegento/firegento-customer", + "require": { + "magento-hackathon/magento-composer-installer": "*" + }, + "repositories": [ + { + "type": "composer", + "url": "http://packages.firegento.com" + } + ] } From f63585b8825d951da307daac93ad84f56ea3d4a0 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 12:26:48 +0200 Subject: [PATCH 12/18] [BUGFIX] Renamed upgrade setup scrip --- .../{upgrade-0.1.0-0.0.1.1.php => upgrade-0.1.0-0.1.1.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/{upgrade-0.1.0-0.0.1.1.php => upgrade-0.1.0-0.1.1.php} (100%) diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.1.1.php similarity index 100% rename from src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.0.1.1.php rename to src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.1.1.php From ce82bbe4b7d6b88a9399d03754056d92833e9b2f Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 13:00:24 +0200 Subject: [PATCH 13/18] modified readme --- README.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c09632e..af017a0 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,18 @@ Installation Instructions 2. Clear the cache, logout from the admin panel and then login again. 3. You can now configure the extenion via *System -> Configuration -> Customer -> Customer Configuration -> Password* +Uninstallation +-------------- +1. Remove all extension files from your Magento installation +2. Run the following sql script in your database: + +```sql +DELETE FROM eav_attribute WHERE attribute_code = 'customer_active'; +DELETE FROM eav_attribute WHERE attribute_code = 'customer_logins_failed'; +DELETE FROM eav_attribute WHERE attribute_code = 'customer_last_login_failed'; +``` + + Support ------- If you have any issues with this extension, open an issue on [GitHub](https://github.com/firegento/firegento-customer/issues). @@ -45,13 +57,14 @@ Any contribution is highly appreciated. The best way to contribute code is to op Developer --------- -- Website: [http://firegento.com](http://firegento.com) -- Twitter: [@firegento](https://twitter.com/firegento) +FireGento Team +* Website: [http://firegento.com](http://firegento.com) +* Twitter: [@firegento](https://twitter.com/firegento) -Licence +License ------- [GNU General Public License, version 3 (GPLv3)](http://opensource.org/licenses/gpl-3.0) Copyright --------- -(c) 2013 FireGento +(c) 2013 FireGento Team From 90d536027f44c60c65eaf0c45ce4ef292d36b468 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 13:06:32 +0200 Subject: [PATCH 14/18] [TASK] Code cleanup --- .../FireGento/Customer/etc/config.xml | 3 -- .../install-0.1.0.php | 54 ++++++++++--------- .../upgrade-0.1.0-0.1.1.php | 8 ++- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index 5e49221..4a02dda 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -46,9 +46,6 @@ FireGento_Customer Mage_Eav_Model_Entity_Setup - - core_setup - diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php index a543174..7729878 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/install-0.1.0.php @@ -26,7 +26,6 @@ * @author FireGento Team */ - /* @var $installer Mage_Eav_Model_Entity_Setup */ $installer = $this; $installer->startSetup(); @@ -34,19 +33,20 @@ /* * ATTRIBUTE: customer_active */ + $attributeName = 'customer_active'; $installer->addAttribute('customer', $attributeName, array( - 'type' => 'int', - 'input' => 'select', - 'label' => 'Active', - 'global' => true, - 'visible' => true, - 'required' => false, - 'user_defined' => false, - 'default' => 1, + 'type' => 'int', + 'input' => 'select', + 'label' => 'Active', + 'global' => true, + 'visible' => true, + 'required' => false, + 'user_defined' => false, + 'default' => 1, 'visible_on_front' => false, - 'source' => 'eav/entity_attribute_source_boolean' + 'source' => 'eav/entity_attribute_source_boolean' ) ); @@ -62,17 +62,18 @@ /* * ATTRIBUTE: customer_logins_failed */ + $attributeName = 'customer_logins_failed'; $installer->addAttribute('customer', $attributeName, array( - 'type' => 'int', - 'input' => 'text', - 'label' => 'Last failed login', - 'global' => true, - 'visible' => false, - 'required' => false, - 'user_defined' => false, - 'default' => '1', + 'type' => 'int', + 'input' => 'text', + 'label' => 'Last failed login', + 'global' => true, + 'visible' => false, + 'required' => false, + 'user_defined' => false, + 'default' => '1', 'visible_on_front' => false ) ); @@ -80,17 +81,18 @@ /* * ATTRIBUTE: customer_last_login_failed */ + $attributeName = 'customer_last_login_failed'; $installer->addAttribute('customer', $attributeName, array( - 'type' => 'int', - 'input' => 'text', - 'label' => 'Failed logins', - 'global' => true, - 'visible' => false, - 'required' => false, - 'user_defined' => false, - 'default' => '1', + 'type' => 'int', + 'input' => 'text', + 'label' => 'Failed logins', + 'global' => true, + 'visible' => false, + 'required' => false, + 'user_defined' => false, + 'default' => '1', 'visible_on_front' => false ) ); diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.1.1.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.1.1.php index 20a8783..221c761 100644 --- a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.1.1.php +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.0-0.1.1.php @@ -30,8 +30,12 @@ $installer = $this; $installer->startSetup(); -// update customers -$collection = Mage::getModel('customer/customer')->getCollection(); +/* + * Set all existing customers as active + */ + +/* @var $collection Mage_Customer_Model_Resource_Customer_Collection */ +$collection = Mage::getResourceModel('customer/customer_collection'); foreach ($collection as $customer) { Mage::getModel('customer/customer')->load($customer->getId()) ->setCustomerActive(1) From bcae96b0dac13e61bb53ba5e4728b4feb36c6e38 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 13:39:26 +0200 Subject: [PATCH 15/18] [+FEATURE] Added some basic unit tests --- .../Customer/Test/Block/Password.php | 69 +++++++++++++++++++ .../getMinimumPasswordLength.yaml | 2 + ...etMinimumPasswordLengthWithWrongEntry.yaml | 2 + .../fixtures/getMinimumPasswordLength.yaml | 2 + ...etMinimumPasswordLengthWithWrongEntry.yaml | 2 + .../FireGento/Customer/Test/Config/Main.php | 68 ++++++++++++++++++ .../Main/expectations/testModuleConfig.yaml | 5 ++ .../FireGento/Customer/etc/config.xml | 7 ++ 8 files changed, 157 insertions(+) create mode 100644 src/app/code/community/FireGento/Customer/Test/Block/Password.php create mode 100644 src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLength.yaml create mode 100644 src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLengthWithWrongEntry.yaml create mode 100644 src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLength.yaml create mode 100644 src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLengthWithWrongEntry.yaml create mode 100644 src/app/code/community/FireGento/Customer/Test/Config/Main.php create mode 100644 src/app/code/community/FireGento/Customer/Test/Config/Main/expectations/testModuleConfig.yaml diff --git a/src/app/code/community/FireGento/Customer/Test/Block/Password.php b/src/app/code/community/FireGento/Customer/Test/Block/Password.php new file mode 100644 index 0000000..b70a77f --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Test/Block/Password.php @@ -0,0 +1,69 @@ + + * @copyright 2013 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ +/** + * PHPUnit Test Class + * + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team + */ +class FireGento_Customer_Test_Block_Password extends EcomDev_PHPUnit_Test_Case_Config +{ + /** + * @var FireGento_Customer_Block_Password + */ + protected $_block; + + /** + * Test constructor + */ + protected function setUp() + { + parent::setUp(); + $this->_block = Mage::getSingleton('core/layout')->createBlock('firegento_customer/password'); + } + + /** + * @test + * @loadFixture + * @loadExpectations + */ + public function getMinimumPasswordLength() + { + $this->assertEquals( + $this->expected('result')->getData('min_password_length'), + $this->_block->getMinimumPasswordLength() + ); + } + + /** + * @test + * @loadFixture + * @loadExpectations + */ + public function getMinimumPasswordLengthWithWrongEntry() + { + $this->assertEquals( + $this->expected('result')->getData('min_password_length'), + $this->_block->getMinimumPasswordLength() + ); + } +} diff --git a/src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLength.yaml b/src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLength.yaml new file mode 100644 index 0000000..e3d05af --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLength.yaml @@ -0,0 +1,2 @@ +result: + min_password_length: 10 diff --git a/src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLengthWithWrongEntry.yaml b/src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLengthWithWrongEntry.yaml new file mode 100644 index 0000000..8b9e4c8 --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Test/Block/Password/expectations/getMinimumPasswordLengthWithWrongEntry.yaml @@ -0,0 +1,2 @@ +result: + min_password_length: 8 diff --git a/src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLength.yaml b/src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLength.yaml new file mode 100644 index 0000000..8058eb5 --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLength.yaml @@ -0,0 +1,2 @@ +config: + default/customer/password/password_min_length: 10 diff --git a/src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLengthWithWrongEntry.yaml b/src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLengthWithWrongEntry.yaml new file mode 100644 index 0000000..576be0f --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Test/Block/Password/fixtures/getMinimumPasswordLengthWithWrongEntry.yaml @@ -0,0 +1,2 @@ +config: + default/customer/password/password_min_length: -10 diff --git a/src/app/code/community/FireGento/Customer/Test/Config/Main.php b/src/app/code/community/FireGento/Customer/Test/Config/Main.php new file mode 100644 index 0000000..294237c --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Test/Config/Main.php @@ -0,0 +1,68 @@ + + * @copyright 2013 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ +/** + * PHPUnit Test Class + * + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team + */ +class FireGento_Customer_Test_Config_Main extends EcomDev_PHPUnit_Test_Case_Config +{ + /** + * Check it the installed module has the correct module version + */ + public function testModuleConfig() + { + $this->assertModuleVersion($this->expected('module')->getVersion()); + $this->assertModuleCodePool($this->expected('module')->getCodePool()); + + foreach ($this->expected('module')->getDepends() as $depend) { + $this->assertModuleIsActive('', $depend); + $this->assertModuleDepends($depend); + } + } + + /** + * Check if the block aliases are returning the correct class names + */ + public function testBlockAliases() + { + $this->assertBlockAlias('firegento_customer/password', 'FireGento_Customer_Block_Password'); + } + + /** + * Check if the helper aliases are returning the correct class names + */ + public function testHelperAliases() + { + $this->assertHelperAlias('firegento_customer', 'FireGento_Customer_Helper_Data'); + $this->assertHelperAlias('firegento_customer/redirect', 'FireGento_Customer_Helper_Redirect'); + } + + /** + * Check if the helper aliases are returning the correct class names + */ + public function testModelAliases() + { + $this->assertModelAlias('firegento_customer/observer', 'FireGento_Customer_Model_Observer'); + } +} diff --git a/src/app/code/community/FireGento/Customer/Test/Config/Main/expectations/testModuleConfig.yaml b/src/app/code/community/FireGento/Customer/Test/Config/Main/expectations/testModuleConfig.yaml new file mode 100644 index 0000000..fdea9c7 --- /dev/null +++ b/src/app/code/community/FireGento/Customer/Test/Config/Main/expectations/testModuleConfig.yaml @@ -0,0 +1,5 @@ +module: + version: 0.1.1 + code_pool: community + depends: + - Mage_Customer diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index 4a02dda..d6cede1 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -124,4 +124,11 @@ + + + + + + + From 20e1d7a97ff1fc2797ac0bbadbecad1ba8aedf33 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 13:45:18 +0200 Subject: [PATCH 16/18] [+FEATURE] Added phpDox configuration file --- phpdox.xml.dist | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 phpdox.xml.dist diff --git a/phpdox.xml.dist b/phpdox.xml.dist new file mode 100644 index 0000000..3a14ce3 --- /dev/null +++ b/phpdox.xml.dist @@ -0,0 +1,9 @@ + + + + + + + + + From fdecfeceb73cd22a9c886ee0827869b4102345a4 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 13:47:03 +0200 Subject: [PATCH 17/18] [TASK] Version bump to 1.0.0 for production release --- .../FireGento/Customer/etc/config.xml | 2 +- .../upgrade-0.1.1-1.0.0.php | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.1-1.0.0.php diff --git a/src/app/code/community/FireGento/Customer/etc/config.xml b/src/app/code/community/FireGento/Customer/etc/config.xml index d6cede1..aaef370 100644 --- a/src/app/code/community/FireGento/Customer/etc/config.xml +++ b/src/app/code/community/FireGento/Customer/etc/config.xml @@ -21,7 +21,7 @@ - 0.1.1 + 1.0.0 diff --git a/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.1-1.0.0.php b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.1-1.0.0.php new file mode 100644 index 0000000..04c7719 --- /dev/null +++ b/src/app/code/community/FireGento/Customer/sql/firegento_customer_setup/upgrade-0.1.1-1.0.0.php @@ -0,0 +1,33 @@ + + * @copyright 2013 FireGento Team (http://www.firegento.com) + * @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3) + */ +/** + * Setup Script + * + * @category FireGento + * @package FireGento_Customer + * @author FireGento Team + */ + +/* @var $installer Mage_Eav_Model_Entity_Setup */ +$installer = $this; +$installer->startSetup(); + +$installer->endSetup(); From 1183e4a6ddc11d05526e136a68a9966cd9fc44c6 Mon Sep 17 00:00:00 2001 From: Rouven Alexander Rieker Date: Sat, 26 Oct 2013 13:49:10 +0200 Subject: [PATCH 18/18] [~FEATURE] Generated API documentation --- .../FireGento_Customer_Block_Password.xhtml | 84 +++++ .../FireGento_Customer_Exception.xhtml | 35 ++ .../FireGento_Customer_Helper_Data.xhtml | 35 ++ .../FireGento_Customer_Helper_Redirect.xhtml | 144 ++++++++ .../FireGento_Customer_Model_Observer.xhtml | 252 ++++++++++++++ ...reGento_Customer_Test_Block_Password.xhtml | 90 +++++ .../FireGento_Customer_Test_Config_Main.xhtml | 82 +++++ docs/api/html/css/normalize.css | 326 ++++++++++++++++++ docs/api/html/css/oldie.css | 23 ++ docs/api/html/css/styles.css | 251 ++++++++++++++ docs/api/html/index.xhtml | 60 ++++ .../FireGento_Customer_Block_Password.xml | 28 ++ .../classes/FireGento_Customer_Exception.xml | 11 + .../FireGento_Customer_Helper_Data.xml | 12 + .../FireGento_Customer_Helper_Redirect.xml | 63 ++++ .../FireGento_Customer_Model_Observer.xml | 115 ++++++ ...FireGento_Customer_Test_Block_Password.xml | 40 +++ .../FireGento_Customer_Test_Config_Main.xml | 31 ++ docs/api/xml/index.xml | 12 + docs/api/xml/source.xml | 41 +++ 20 files changed, 1735 insertions(+) create mode 100644 docs/api/html/classes/FireGento_Customer_Block_Password.xhtml create mode 100644 docs/api/html/classes/FireGento_Customer_Exception.xhtml create mode 100644 docs/api/html/classes/FireGento_Customer_Helper_Data.xhtml create mode 100644 docs/api/html/classes/FireGento_Customer_Helper_Redirect.xhtml create mode 100644 docs/api/html/classes/FireGento_Customer_Model_Observer.xhtml create mode 100644 docs/api/html/classes/FireGento_Customer_Test_Block_Password.xhtml create mode 100644 docs/api/html/classes/FireGento_Customer_Test_Config_Main.xhtml create mode 100644 docs/api/html/css/normalize.css create mode 100644 docs/api/html/css/oldie.css create mode 100644 docs/api/html/css/styles.css create mode 100644 docs/api/html/index.xhtml create mode 100644 docs/api/xml/classes/FireGento_Customer_Block_Password.xml create mode 100644 docs/api/xml/classes/FireGento_Customer_Exception.xml create mode 100644 docs/api/xml/classes/FireGento_Customer_Helper_Data.xml create mode 100644 docs/api/xml/classes/FireGento_Customer_Helper_Redirect.xml create mode 100644 docs/api/xml/classes/FireGento_Customer_Model_Observer.xml create mode 100644 docs/api/xml/classes/FireGento_Customer_Test_Block_Password.xml create mode 100644 docs/api/xml/classes/FireGento_Customer_Test_Config_Main.xml create mode 100644 docs/api/xml/index.xml create mode 100644 docs/api/xml/source.xml diff --git a/docs/api/html/classes/FireGento_Customer_Block_Password.xhtml b/docs/api/html/classes/FireGento_Customer_Block_Password.xhtml new file mode 100644 index 0000000..d731491 --- /dev/null +++ b/docs/api/html/classes/FireGento_Customer_Block_Password.xhtml @@ -0,0 +1,84 @@ + + + + + + FireGento_Customer - FireGento_Customer_Block_Password - API Documentation + + + + + + + diff --git a/docs/api/html/classes/FireGento_Customer_Exception.xhtml b/docs/api/html/classes/FireGento_Customer_Exception.xhtml new file mode 100644 index 0000000..969b3e7 --- /dev/null +++ b/docs/api/html/classes/FireGento_Customer_Exception.xhtml @@ -0,0 +1,35 @@ + + + + + + FireGento_Customer - FireGento_Customer_Exception - API Documentation + + + + +
+ + + + diff --git a/docs/api/html/classes/FireGento_Customer_Helper_Data.xhtml b/docs/api/html/classes/FireGento_Customer_Helper_Data.xhtml new file mode 100644 index 0000000..91179ad --- /dev/null +++ b/docs/api/html/classes/FireGento_Customer_Helper_Data.xhtml @@ -0,0 +1,35 @@ + + + + + + FireGento_Customer - FireGento_Customer_Helper_Data - API Documentation + + + + +
+ + + + diff --git a/docs/api/html/classes/FireGento_Customer_Helper_Redirect.xhtml b/docs/api/html/classes/FireGento_Customer_Helper_Redirect.xhtml new file mode 100644 index 0000000..bf530f1 --- /dev/null +++ b/docs/api/html/classes/FireGento_Customer_Helper_Redirect.xhtml @@ -0,0 +1,144 @@ + + + + + + FireGento_Customer - FireGento_Customer_Helper_Redirect - API Documentation + + + + + + + diff --git a/docs/api/html/classes/FireGento_Customer_Model_Observer.xhtml b/docs/api/html/classes/FireGento_Customer_Model_Observer.xhtml new file mode 100644 index 0000000..79318c7 --- /dev/null +++ b/docs/api/html/classes/FireGento_Customer_Model_Observer.xhtml @@ -0,0 +1,252 @@ + + + + + + FireGento_Customer - FireGento_Customer_Model_Observer - API Documentation + + + + +
+ + +
+

\FireGento_Customer_Model_Observer

+
+

Observer for password validations

+
+
    +
  • Author: FireGento Team <team@firegento.com>
  • +
+

Constants

+ +

Methods

+
+ +
+
+ + diff --git a/docs/api/html/classes/FireGento_Customer_Test_Block_Password.xhtml b/docs/api/html/classes/FireGento_Customer_Test_Block_Password.xhtml new file mode 100644 index 0000000..31374ec --- /dev/null +++ b/docs/api/html/classes/FireGento_Customer_Test_Block_Password.xhtml @@ -0,0 +1,90 @@ + + + + + + FireGento_Customer - FireGento_Customer_Test_Block_Password - API Documentation + + + + + + + diff --git a/docs/api/html/classes/FireGento_Customer_Test_Config_Main.xhtml b/docs/api/html/classes/FireGento_Customer_Test_Config_Main.xhtml new file mode 100644 index 0000000..3606469 --- /dev/null +++ b/docs/api/html/classes/FireGento_Customer_Test_Config_Main.xhtml @@ -0,0 +1,82 @@ + + + + + + FireGento_Customer - FireGento_Customer_Test_Config_Main - API Documentation + + + + + + + diff --git a/docs/api/html/css/normalize.css b/docs/api/html/css/normalize.css new file mode 100644 index 0000000..be67505 --- /dev/null +++ b/docs/api/html/css/normalize.css @@ -0,0 +1,326 @@ +/*! normalize.css v2.0.1 | MIT License | git.io/normalize */ +/* edited by Jens Grochtdreis */ + +/* ========================================================================== + Base + ========================================================================== */ + +/* + * 1. Sets default font family to sans-serif. + * 2. Prevents iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-family: sans-serif; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -ms-text-size-adjust: 100%; /* 2 */ +} + +/* + * Removes default margin. + */ + +body { + margin: 0; +} + +/* ========================================================================== + Links + ========================================================================== */ + +/* + * Addresses `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/* + * Improves readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* ========================================================================== + Typography + ========================================================================== */ + +/* + * Addresses `h1` font sizes within `section` and `article` in Firefox 4+, + * Safari 5, and Chrome. + */ + +h1 { + font-size: 2em; +} + +/* + * Addresses styling not present in IE 8/9, Safari 5, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/* + * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/* + * Addresses styling not present in Safari 5 and Chrome. + */ + +dfn { + font-style: italic; +} + +/* + * Addresses styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + + +/* + * Corrects font family set oddly in Safari 5 and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, serif; + font-size: 1em; +} + +/* + * Improves readability of pre-formatted text in all browsers. + */ + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +/* + * Sets consistent quote types. + */ + +q { + quotes: "\201C" "\201D" "\2018" "\2019"; +} + +/* + * Addresses inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/* + * Prevents `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* ========================================================================== + Embedded content + ========================================================================== */ + +/* + * Removes border when inside `a` element in IE 8/9. + */ + +img { + border: 0; +} + +/* + * Corrects overflow displayed oddly in IE 9. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* ========================================================================== + Figures + ========================================================================== */ + +/* + * Addresses margin not present in IE 8/9 and Safari 5. + */ + +figure { + margin: 0; +} + +/* ========================================================================== + Forms + ========================================================================== */ + +/* + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/* + * 1. Corrects color not being inherited in IE 8/9. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ +} + +/* + * 1. Corrects font family not being inherited in all browsers. + * 2. Corrects font size not being inherited in all browsers. + * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome + */ + +button, +input, +select, +textarea { + font-family: inherit; /* 1 */ + font-size: 100%; /* 2 */ + margin: 0; /* 3 */ +} + +/* + * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; +} + +/* + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Corrects inability to style clickable `input` types in iOS. + * 3. Improves usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/* + * Re-set default cursor for disabled elements. + */ + +button[disabled], +input[disabled] { + cursor: default; +} + +/* + * 1. Addresses box sizing set to `content-box` in IE 8/9. + * 2. Removes excess padding in IE 8/9. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/* + * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/* + * Removes inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* + * Removes inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/* + * 1. Removes default vertical scrollbar in IE 8/9. + * 2. Improves readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/* ========================================================================== + Tables + ========================================================================== */ + +/* + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/docs/api/html/css/oldie.css b/docs/api/html/css/oldie.css new file mode 100644 index 0000000..346f5d4 --- /dev/null +++ b/docs/api/html/css/oldie.css @@ -0,0 +1,23 @@ +/* for IE8 and below */ +/* convert rgba-colours in the background into hex with: http://beijingyoung.com/articles/rgba-argb-converter/ */ +/* strip-off the "a" rgba if it is only "color" */ + +.clearfix { *height:1%; } /* trigger hasLayout for IE6 + 7 */ +h1, h2, h3 { color: rgb(0,0,0);} + +.topbar { + filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr='#BF000000', EndColorStr='#BF000000'); + zoom: 1!important; +} + +.btn { + *display: inline; + *zoom: 1; + background-color: transparent\9; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0); +} +.btn:hover, +.btn:focus { + background-color: transparent\9; + filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0); +} \ No newline at end of file diff --git a/docs/api/html/css/styles.css b/docs/api/html/css/styles.css new file mode 100644 index 0000000..8d3fe95 --- /dev/null +++ b/docs/api/html/css/styles.css @@ -0,0 +1,251 @@ +/* styling basics */ +html {padding: 20px 0; background-color: #efefef;} +body {font-family: Arial, sans-serif; font-size: 100.01%;} + +/* clearfix */ +.clearfix:after { clear:both; content:"."; display:block; font-size:0; height:0; visibility:hidden; } +.clearfix { display:block; } /* extra for Safari */ + + +h1, h2, h3, h4, h5, h6 {font-family: Verdana, Arial, Helvetica, sans-serif; } + +/* Topbar */ +.topbar { margin: -20px -20px 2em -20px; padding: 1em 0;} +.topbar a { text-decoration: none;} +.topbar a:hover, .topbar a:focus { text-decoration: underline;} +.topbar h1 { float: left; font-size:1em; margin:0 0 0 2em;} +.topbar .nav { list-style-type:none; float:right; margin:0 2em 0 0;} +.topbar .nav li { float:left;} + +/* page-layout */ +.wrapper { + width: 90%; + max-width: 1200px; + padding: 20px; + margin: 40px auto 0 auto; + background: #fff; + box-shadow: 1px 1px 5px rgba(0,0,0,0.5); +} + +.indexcontent {margin: 1em auto; width: 90%;} + +.navigation {float: left;width: 200px;} +.navigation ul, .navigation li { + list-style-type: none; + padding-left: 0; + margin-left: 0; +} +.navigation a { + display: block; + border-bottom: 1px solid #cecece; + margin-bottom: 0.25em; + padding: 0.5em 0; + text-decoration: none; + color: inherit; + word-wrap: break-word; +} + +.navigation h3 { + clear: both; +} + +.navigation a:hover, .navigation a:focus { + padding-left: 0.75em; + background-color:#f5f5f5; +} + +.content {margin-left: 250px;} + +pre { + display:block; + padding:20px; + margin:0 0 1.5em 0; + font-size: 0.8em; + background-color:#f5f5f5; + border:1px solid #ccc; + border-radius:3px; + white-space:pre; + white-space:pre-wrap; + word-wrap:break-word; + max-width: 700px; +} + +/* ===== Buttons */ +.btn { + display: inline-block; + padding: 4px 14px; + margin-bottom: 0; + line-height: 1.2; + color: #333; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; + background: #e6e6e6; + background: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background: -o-linear-gradient(top, #ffffff, #e6e6e6); + background: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background: linear-gradient(to bottom, #ffffff, #e6e6e6); + border: 1px solid #bbbbbb; + border-color: #e6e6e6 #e6e6e6 #a2a2a2 #bfbfbf; + border-radius: 4px; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); + text-decoration: none; +} + +.btn:hover, +.btn:focus { + background: #e6e6e6; + background: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff)); + background: -webkit-linear-gradient(top, #e6e6e6, #ffffff); + background: -o-linear-gradient(top, #e6e6e6, #ffffff); + background: -moz-linear-gradient(top, #e6e6e6, #ffffff); + background: linear-gradient(to bottom, #e6e6e6, #ffffff); +} + +.btn:focus { + outline: thin dotted #333; + outline: 5px auto -webkit-focus-ring-color; + outline-offset: -2px; +} + +.btn:active { + background-color: #e6e6e6; + outline: 0; + -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.btn.large { + padding: 9px 14px; +} + +/* ========= linklists */ + +.linklist {list-style-type: none;padding-left: 0;margin-left: 0;} +.linklist li {margin: 0 0 0.3em 0;} +.linkbox {float: left;width: 30%;margin-right: 3%;} + + +/* ======== inheritance */ +ul.inheritance {list-style-type:none;} +ul.inheritance li:before {content:"↪ ";} +ul.inheritance li:first-child:before {content:"";} +/* looks strange but is CSS3-selector simulated for oldIE :-) */ +ul.inheritance li + li + li {margin-left: 1em;} +ul.inheritance li + li + li + li {margin-left: 1.5em;} +ul.inheritance li + li + li + li + li {margin-left: 2em;} +ul.inheritance li + li + li + li + li + li {margin-left: 2.5em;} +ul.inheritance li + li + li + li + li + li + li {margin-left: 3em;} + +/* ======== method:param, method:return, method:trows */ +ul.param, ul.return, ul.throws {list-style-type:none;} +h4.param {margin-bottom: 0px;} + +/* ======== method:return, method:trows */ +h4.return, h4.throws {margin-top: 0px; margin-bottom: 0px;} + +/* ========= Footer */ +.footer {clear:both;margin:2em 0 1em 0;padding:0.5em 1em;border-top:2px solid #cecece;font-size: 0.85em;} + +/* =========== + the content ========================================== */ + +/* different labels */ +.label {padding: 0.25em 0.5em; border-radius: 3px;text-transform: uppercase;font-size: 0.5em; color: #fff;} + .private {background-color: #a20000;} + .protected {background-color: #efba00;} + .public {background-color: #00b25c;} + +/* the name of the member-variable */ +.var-member {font-weight: bold;} + +/* which variable type? */ +.var-type {font-style:italic;} + +.label, .var-member, .var-type {display: inline-block;margin-right: 0.5em;} + +/* short description of the variable */ +.var-desc { margin-top: 0.25em;} + +/* optional long description of the variable */ +.var-longdesc{ background-color:#f5f5f5; border:1px solid #ccc; padding:0.4em; margin-top:0.25em;} + +/* list with infos and with vars */ +.extendlist, .varlist, .varinfos {list-style-type: none;} +.varinfos { border-bottom: 1px solid #cecece; padding-bottom: 1em; margin-bottom: 1em;} + +@media only screen and (max-width: 800px) { + .navigation, .content {float: none; position: relative; margin-left: 0; width: auto;} + .navigation h2, .content {clear: both;} + .navigation ul, .navigation li {float: left;} + .navigation h2 {margin-bottom: 0;} + .navigation ul {overflow: hidden;margin-top: 0;} + .navigation a {border-bottom: none; margin-right: 0.5em;padding: 0.4em 0.75em; background-color: #f4f4f4;border-radius: 5px;} + .navigation a:hover, .navigation a:focus {background-color: #cecece;} + .linkbox {float: none;width: auto; margin-right: 0;} +} + + +/* ================== + animations ======================================================= */ + +@media only screen and (min-width: 801px) { + .navigation a { + -webkit-transition: padding-left 0.2s ease-in, background-color 0.2s ease-in; + -moz-transition: padding-left 0.2s ease-in, background-color 0.2s ease-in; + -o-transition: padding-left 0.2s ease-in, background-color 0.2s ease-in; + transition: padding-left 0.2s ease-in, background-color 0.2s ease-in; + } +} + +h4:target { + -webkit-animation: target-fade 2s 1; + -moz-animation: target-fade 2s 1; + -ms-animation: target-fade 2s 1; + animation: target-fade 2s 1; +} + +@-webkit-keyframes target-fade { + 0% { background-color: #ffffff;} + 75% { background-color: #f7d484;} + 100% { background-color: #ffffff;} +} + +@-moz-keyframes target-fade { + 0% { background-color: #ffffff;} + 75% { background-color: #f7d484;} + 100% { background-color: #ffffff;} +} + +@-ms-keyframes target-fade { + 0% { background-color: #ffffff;} + 75% { background-color: #f7d484;} + 100% { background-color: #ffffff;} +} + +@keyframes target-fade { + 0% { background-color: #ffffff;} + 75% { background-color: #f7d484;} + 100% { background-color: #ffffff;} +}​ + + +/* =================== + main colours ======================================== */ + +/* if the background-color is rgba please provide an alternative for oldIE in oldie.css */ +h1, h2, h3 {color: rgba(255,147,30,1);} +.topbar { background-color: rgba(33,40,48,0.75);} +.topbar a {color: #fff;} + +.extendlist a, .linklist a, .var-member a {color: #354225;} + +.extendlist a:hover, .extendlist a:focus, +.linklist a:hover, .linklist a:focus, +.var-member a:hover, .var-member a:focus {color: #5c7340;} + +.param-type { + font-weight:normal; +} diff --git a/docs/api/html/index.xhtml b/docs/api/html/index.xhtml new file mode 100644 index 0000000..9657c64 --- /dev/null +++ b/docs/api/html/index.xhtml @@ -0,0 +1,60 @@ + + + + + FireGento_Customer - API Documentation + + + + +
+ +
+

FireGento_Customer

+

Welcome to the API documentation page. Please select one of the listed classes, interfaces or traits to learn more about the indivdual item. You can navigate back to this page by use of the top navigation bar.

+ +

Classes

+
+ + + diff --git a/docs/api/xml/classes/FireGento_Customer_Block_Password.xml b/docs/api/xml/classes/FireGento_Customer_Block_Password.xml new file mode 100644 index 0000000..2898fd9 --- /dev/null +++ b/docs/api/xml/classes/FireGento_Customer_Block_Password.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/xml/classes/FireGento_Customer_Exception.xml b/docs/api/xml/classes/FireGento_Customer_Exception.xml new file mode 100644 index 0000000..dea3b4c --- /dev/null +++ b/docs/api/xml/classes/FireGento_Customer_Exception.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/docs/api/xml/classes/FireGento_Customer_Helper_Data.xml b/docs/api/xml/classes/FireGento_Customer_Helper_Data.xml new file mode 100644 index 0000000..4f1d867 --- /dev/null +++ b/docs/api/xml/classes/FireGento_Customer_Helper_Data.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/docs/api/xml/classes/FireGento_Customer_Helper_Redirect.xml b/docs/api/xml/classes/FireGento_Customer_Helper_Redirect.xml new file mode 100644 index 0000000..398e5db --- /dev/null +++ b/docs/api/xml/classes/FireGento_Customer_Helper_Redirect.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/xml/classes/FireGento_Customer_Model_Observer.xml b/docs/api/xml/classes/FireGento_Customer_Model_Observer.xml new file mode 100644 index 0000000..db13270 --- /dev/null +++ b/docs/api/xml/classes/FireGento_Customer_Model_Observer.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Observer for controller_action_predispatch_customer_account_loginPost event. + + + + + + + + + + + + + + + + + + + + + Validate the controller postDispatch action of customer_account_loginPost. + +If user is not logged in at this point in time but login parameters given, +the user had wrong credentials -> so increment the number of failed logins. +If otherwise the user is logged in successfully, we can forget about +previous login failures. + +Observer for controller_action_postdispatch_customer_account_loginPost event + + + + + + + + + + + Observer for controller_action_postdispatch_checkout_onepage_saveBilling event. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/xml/classes/FireGento_Customer_Test_Block_Password.xml b/docs/api/xml/classes/FireGento_Customer_Test_Block_Password.xml new file mode 100644 index 0000000..8b5021e --- /dev/null +++ b/docs/api/xml/classes/FireGento_Customer_Test_Block_Password.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/xml/classes/FireGento_Customer_Test_Config_Main.xml b/docs/api/xml/classes/FireGento_Customer_Test_Config_Main.xml new file mode 100644 index 0000000..0c9bd64 --- /dev/null +++ b/docs/api/xml/classes/FireGento_Customer_Test_Config_Main.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/api/xml/index.xml b/docs/api/xml/index.xml new file mode 100644 index 0000000..3d4abf9 --- /dev/null +++ b/docs/api/xml/index.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/docs/api/xml/source.xml b/docs/api/xml/source.xml new file mode 100644 index 0000000..46086a9 --- /dev/null +++ b/docs/api/xml/source.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +