<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Magento Master Password Archives - gj</title>
	<atom:link href="https://blog.gaiterjones.com/tag/magento-master-password/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.gaiterjones.com/tag/magento-master-password/</link>
	<description>gaiterjones</description>
	<lastBuildDate>Wed, 16 Mar 2011 13:19:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>Magento Master Password 5 Minute Fix</title>
		<link>https://blog.gaiterjones.com/magento-master-password/</link>
					<comments>https://blog.gaiterjones.com/magento-master-password/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Mon, 14 Feb 2011 10:35:48 +0000</pubDate>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[5 Minute Fix]]></category>
		<category><![CDATA[Magento Master Password]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=93</guid>

					<description><![CDATA[It can be annoying when you want to troubleshoot a Magento eCommerce site customer login problem, and you must first reset the customers account password to login as the customer...<a class="more-link" href="https://blog.gaiterjones.com/magento-master-password/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p>It can be annoying when you want to troubleshoot a Magento eCommerce site customer login problem, and you must first reset the customers account password to login as the customer and troubleshoot the problem yourself.  It can also be useful to quickly login as the customer to examine their shopping cart or place an order on their behalf. To do this we need a so called &#8220;master password&#8221; to override the customer password in the Magento database and allow us to login to the Magento frontend as the customer.</p>
<p>This is a 5 minute quick fix! All we need is an MD5 hash and one or two  lines of code to configure an encrypted Magento store frontend master password to allow you to login to the frontend of your Magento eCommerce store with any registered users account.</p>
<h2>FREE EXTENSION</h2>
<p>A free extension to implement this solution is now available <a title="FREE Magento Extension – Magento Master Password" href="https://blog.gaiterjones.com/free-magento-extension-magento-master-password/">here</a>.</p>
<h2>DO IT YOURSELF</h2>
<p>First we need a master password, I always recommend using a <span style="text-decoration: underline;"><a href="http://strongpasswordgenerator.com/" target="_blank">Strong Password Generator</a></span> to generate a &#8220;good&#8221; hard to guess / remember password with at least 8 characters, for example lets use : <strong><span style="color: #888888;">Qbc55H8m</span></strong><br />
We don&#8217;t want this password to appear in plain text in our PHP code so lets make a one way MD5 hash of the password. Using the MD5 generator below I can create the MD5 hash by entering my strong password string &#8211; <strong>Qbc55H8m</strong></p>
<div>
<form> Enter a string:<br />
&nbsp;</p>
<p><input style="width: 336px;" onkeyup="this.form.hash.value = MD5(this.form.decoded.value)" name="decoded" type="text" /><br />
Calculated MD5 hash:&nbsp;</p>
<p><input style="width: 336px;" name="hash" type="text" /> </form>
<p><script src="/js/webtoolkit.md5.js" type="text/javascript"></script></p>
</div>
<p>Using the password &#8220;<strong>Qbc55H8m</strong>&#8221; I generated the following MD5 hash:</p>
<pre>acb1bb6a30a54a54f4558f3d3984bda6</pre>
<p>Create your MD5 hash now with your own password.</p>
<p>Now we are all set with our encrypted Magento universal master password, next we need to add two lines of code to the customer password authentication function within the core Magento code. We don&#8217;t want to edit the actual core files as these will be overwritten during an upgrade, so we will create a local copy of the file and make our modifications there.</p>
<p>In your <em><strong>/app/code/local </strong></em>folder create the following folder structure:</p>
<p><em><strong>Mage/Customer/Model</strong></em> (note folder names are case sensitive.)</p>
<p>Now copy the Magento core php file <strong>customer.php</strong> from <em><strong>app/code/core/Mage/Customer/Model </strong></em>to <em><strong>app/code/local/Mage/Customer/Model</strong></em></p>
<p>Open your app/code/local/Mage/Customer/Model local copy of <strong>customer.php</strong> in a text editor and around about line 300 (1.3.x) or 340 (1.4.x) you will see the function <em>validatePassword($password) </em>this is the function that validates the customer login password with the encrypted password in the Magento database. Add the following two lines of code to this function, remember to include the MD5 password you generated above :</p>
<pre class="brush:php">if (md5($password) == 'YOUR GENERATED MD5 PASSWORD') {
return true;
}</pre>
<p>So that your function now looks something like this</p>
<pre class="brush:php">    public function validatePassword($password)
    {
        // Master Password Check - PAJ 14.02.2011
		if (md5($password) == 'YOUR GENERATED MD5 PASSWORD') {
                return true;
        }

        if (!($hash = $this-&gt;getPasswordHash())) {
            return false;
        }
        return Mage::helper('core')-&gt;validateHash($password, $hash);
    }</pre>
<p>Save the file and refresh your Magento cache. Thats it, select a customer account and confirm that you can login with your master password. Remember to keep your master password safe!</p>
<p>Tested with Magento 1.3.3.0, 1.4.2.0, 1.5.0.0</p>
<p>Googled resources used to develop this solution :<br />
<a href="http://www.webtoolkit.info/javascript-md5.html">http://www.webtoolkit.info/javascript-md5.html<br />
</a><a href="http://strongpasswordgenerator.com/">http://strongpasswordgenerator.com/</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/magento-master-password/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
