├── .gitignore ├── app ├── code │ └── local │ │ └── PAJ │ │ └── MasterPassword │ │ ├── Helper │ │ └── Data.php │ │ ├── etc │ │ ├── adminhtml.xml │ │ ├── config.xml │ │ └── system.xml │ │ ├── Customer │ │ └── Model │ │ │ └── Customer.php │ │ └── lgpl.txt └── etc │ └── modules │ └── PAJ_MasterPassword.xml ├── modman └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /app/code/local/PAJ/MasterPassword/Helper/Data.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | local 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/code/local/PAJ/MasterPassword/etc/adminhtml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Master Password Section by PAJ 13 | 50 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/code/local/PAJ/MasterPassword/etc/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 0.0.2 6 | 7 | 8 | 9 | 10 | 11 | PAJ_MasterPassword_Helper 12 | 13 | 14 | 15 | 16 | 17 | PAJ_MasterPassword_Customer_Model_Customer 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Master Password Section by PAJ 33 | 50 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Magento Master Password 2 | 3 | ### Magento module 4 | login to any valid Magento customer account with one master password. 5 | 6 | 7 | ### Synopsis 8 | This Magento module creates an MD5 master password which can be used to login to the Magento frontend using any valid customer account. 9 | 10 | 11 | ### Version 12 | *** 13 | @version 0.0.2 14 | @since 06 2015 15 | @author gaiterjones 16 | @documentation blog.gaiterjones.com 17 | @twitter twitter.com/gaiterjones 18 | 19 | ### Installation 20 | 21 | modman 22 | 23 | modman clone https://github.com/gaiterjones/magento-masterpassword.git 24 | 25 | manual 26 | 27 | Extract the module and copy the files to the /app folder of your magento installation. Refresh your cache, log out of admin and back in again. 28 | 29 | ### Configuration 30 | 31 | Goto System – Configuration and select My Extensions – Master Password to access the configuration. 32 | 33 | Enter your master password in the Create Master Password MD5 hash text box to generate an MD5 hash of 34 | the password. Copy the MD5 hash to the Master Password MD5 text box and save the config. Note the plain 35 | text password is not saved. 36 | 37 | Test by logging into any valid customer account with the master password. 38 | 39 | 40 | 41 | 42 | ## License 43 | 44 | The MIT License (MIT) 45 | Copyright (c) 2015 Peter Jones 46 | 47 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /app/code/local/PAJ/MasterPassword/Customer/Model/Customer.php: -------------------------------------------------------------------------------- 1 | . 21 | * 22 | * @category PAJ 23 | * @package MasterPassword 24 | * @license http://www.gnu.org/licenses/ GNU General Public License 25 | * 26 | * 27 | */ 28 | 29 | class PAJ_MasterPassword_Customer_Model_Customer extends Mage_Customer_Model_Customer 30 | { 31 | 32 | 33 | /** 34 | * Validate password with salted hash OR PAJ master password 35 | * 36 | * @param string $password 37 | * @return boolean 38 | */ 39 | public function validatePassword($password) 40 | { 41 | 42 | if (Mage::getStoreConfig('masterpassword_section1/general/masterpassword_md5_hash')!="") 43 | { 44 | if (md5($password) == Mage::getStoreConfig('masterpassword_section1/general/masterpassword_md5_hash')) { 45 | return true; 46 | } 47 | } 48 | 49 | $hash = $this->getPasswordHash(); 50 | if (!$hash) { 51 | return false; 52 | } 53 | return Mage::helper('core')->validateHash($password, $hash); 54 | } 55 | 56 | /** 57 | * Set plain and hashed password 58 | * 59 | * @param string $password 60 | * @return Mage_Customer_Model_Customer 61 | */ 62 | public function setPassword($password) 63 | { 64 | /** 65 | * FIX for customer password being auto changed to master password 66 | * after master password is used to logged in as the particular customer 67 | */ 68 | if (Mage::getStoreConfig('masterpassword_section1/general/masterpassword_md5_hash')!="") 69 | { 70 | if (md5($password) == Mage::getStoreConfig('masterpassword_section1/general/masterpassword_md5_hash')) { 71 | return true; 72 | } 73 | } 74 | 75 | $this->setData('password', $password); 76 | $this->setPasswordHash($this->hashPassword($password)); 77 | $this->setPasswordConfirmation(null); 78 | return $this; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/code/local/PAJ/MasterPassword/etc/system.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 210 8 | 9 | 10 | 11 | 12 | 13 | separator-top 14 | 15 | paj_extensions 16 | 130 17 | 1 18 | 1 19 | 1 20 | 21 | 22 | 23 | text 24 | 50 25 | 1 26 | 1 27 | 1 28 | 29 | 30 | 31 | note 32 | 1 33 | 1 34 | 1 35 | 1 36 | 37 | To configure a Magento Master password, enter a password in plain text below to automatically create an MD5 hash. Copy the MD5 hash into the Master Password text box and save the configuration. You will then be able to login to any valid customer account using the Master Password. KEEP YOUR MASTER PASSWORD SECURE! 38 | 39 | 40 | 41 | 42 | note 43 | 2 44 | 1 45 | 1 46 | 1 47 | 48 | !function(a){"use strict";function b(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function c(a,b){return a<>>32-b}function d(a,d,e,f,g,h){return b(c(b(b(d,a),b(f,h)),g),e)}function e(a,b,c,e,f,g,h){return d(b&c|~b&e,a,b,f,g,h)}function f(a,b,c,e,f,g,h){return d(b&e|c&~e,a,b,f,g,h)}function g(a,b,c,e,f,g,h){return d(b^c^e,a,b,f,g,h)}function h(a,b,c,e,f,g,h){return d(c^(b|~e),a,b,f,g,h)}function i(a,c){a[c>>5]|=128<>>9<<4)+14]=c;var d,i,j,k,l,m=1732584193,n=-271733879,o=-1732584194,p=271733878;for(d=0;d>5]>>>b%32&255);return c}function k(a){var b,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b>5]|=(255&a.charCodeAt(b/8))<16&&(e=i(e,8*a.length)),c=0;16>c;c+=1)f[c]=909522486^e[c],g[c]=1549556828^e[c];return d=i(f.concat(k(b)),512+8*b.length),j(i(g.concat(d),640))}function n(a){var b,c,d="0123456789abcdef",e="";for(c=0;c>>4&15)+d.charAt(15&b);return e}function o(a){return unescape(encodeURIComponent(a))}function p(a){return l(o(a))}function q(a){return n(p(a))}function r(a,b){return m(o(a),o(b))}function s(a,b){return n(r(a,b))}function t(a,b,c){return b?c?r(b,a):s(b,a):c?p(a):q(a)}"function"==typeof define&&define.amd?define(function(){return t}):a.md5=t}(this);
Enter the master password:


Calculated MD5 hash:

]]> 49 | 50 | 51 | 52 | 53 | text 54 | 3 55 | 1 56 | 1 57 | 1 58 | Copy the calculated Master Password MD5 hash and paste it here and save. 59 | 60 | 61 | 62 | note 63 | 4 64 | 1 65 | 1 66 | 1 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /app/code/local/PAJ/MasterPassword/lgpl.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | --------------------------------------------------------------------------------