Macpain_MasterPassword - Version 0.1.1

Version Notes

Added front end login form.

Download this release

Release Info

Developer Marceli Podstawski
Extension Macpain_MasterPassword
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/code/local/Macpain/MasterPassword/Block/Form/Login.php CHANGED
@@ -1,6 +1,12 @@
1
  <?php
2
 
3
- class Macpain_MasterPassword_Block_Form_Login extends Mage_Core_Block_Template {
 
 
 
 
 
 
4
 
5
  /**
6
  * Get login post url
@@ -21,5 +27,10 @@ class Macpain_MasterPassword_Block_Form_Login extends Mage_Core_Block_Template {
21
  {
22
  return $this->_username = Mage::getSingleton('customer/session')->getUsername(true);
23
  }
 
 
 
 
 
24
 
25
  }
1
  <?php
2
 
3
+ class Macpain_MasterPassword_Block_Form_Login extends Mage_Core_Block_Template
4
+ {
5
+ /**
6
+ * Path to master password enabled option
7
+ * @var constance
8
+ */
9
+ const ENABLED = 'masterpassword/options/enable_login_form';
10
 
11
  /**
12
  * Get login post url
27
  {
28
  return $this->_username = Mage::getSingleton('customer/session')->getUsername(true);
29
  }
30
+
31
+ public function isFrontEndFormEnabled()
32
+ {
33
+ return Mage::getStoreConfig(self::ENABLED);
34
+ }
35
 
36
  }
app/code/local/Macpain/MasterPassword/etc/system.xml CHANGED
@@ -46,6 +46,15 @@
46
  <show_in_store>1</show_in_store>
47
  <comment>Enter salt string to secure and encrypt password.</comment>
48
  </salt>
 
 
 
 
 
 
 
 
 
49
  </fields>
50
  </options>
51
  </groups>
46
  <show_in_store>1</show_in_store>
47
  <comment>Enter salt string to secure and encrypt password.</comment>
48
  </salt>
49
+ <enable_login_form translate="label">
50
+ <label>Enable Front End Login Form</label>
51
+ <frontend_type>select</frontend_type>
52
+ <source_model>adminhtml/system_config_source_yesno</source_model>
53
+ <sort_order>4</sort_order>
54
+ <show_in_default>1</show_in_default>
55
+ <show_in_website>1</show_in_website>
56
+ <show_in_store>1</show_in_store>
57
+ </enable_login_form>
58
  </fields>
59
  </options>
60
  </groups>
app/design/frontend/default/default/template/macpain/masterpassword/form/login.phtml CHANGED
@@ -1,40 +1,41 @@
1
  <div class="master-password-login">
2
  <div class="page-title">
3
- <h1><?php echo $this->__('Login to customer account from admin') ?></h1>
4
  </div>
5
  <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
6
  <div>
7
  <div class="content">
8
- <a href="<?php echo $this->getUrl('adminhtml')?>"><?php echo $this->__('Go back to admin') ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  </div>
10
  </div>
11
- <!--<form action="<?php #echo $this->getLoginPostUrl() ?>" method="post" id="master-password-login-form">
12
- <div>
13
- <div class="content">
14
- <ul class="form-list">
15
- <li>
16
- <label for="email" class="required"><em>*</em><?php #echo $this->__('Email Address') ?></label>
17
- <div class="input-box">
18
- <input type="text" name="login[username]" value="<?php #echo $this->htmlEscape($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php #echo $this->__('Email Address') ?>" />
19
- </div>
20
- </li>
21
- <li>
22
- <label for="pass" class="required"><em>*</em><?php #echo $this->__('Password') ?></label>
23
- <div class="input-box">
24
- <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php #echo $this->__('Password') ?>" />
25
- </div>
26
- </li>
27
- </ul>
28
- <p class="required"><?php #echo $this->__('* Required Fields') ?></p>
29
- </div>
30
- </div>
31
- <div class="buttons-set">
32
- <button type="submit" class="button" title="<?php #echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php #echo $this->__('Login') ?></span></span></button>
33
- </div>
34
- </form>-->
35
- <script type="text/javascript">
36
- //<![CDATA[
37
- //var dataForm = new VarienForm('master-password-login-form', true);
38
- //]]>
39
- </script>
40
  </div>
1
  <div class="master-password-login">
2
  <div class="page-title">
3
+ <h1><?php echo $this->__('Master Password') ?></h1>
4
  </div>
5
  <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
6
  <div>
7
  <div class="content">
8
+ <?php if ($this->isFrontEndFormEnabled()) : ?>
9
+ <form action="<?php echo $this->getLoginPostUrl() ?>" method="post" id="master-password-login-form">
10
+ <div>
11
+ <div class="content">
12
+ <ul class="form-list">
13
+ <li>
14
+ <label for="email" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
15
+ <div class="input-box">
16
+ <input type="text" name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?php echo $this->__('Email Address') ?>" />
17
+ </div>
18
+ </li>
19
+ <li>
20
+ <label for="pass" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
21
+ <div class="input-box">
22
+ <input type="password" name="login[password]" class="input-text required-entry validate-password" id="pass" title="<?php echo $this->__('Password') ?>" />
23
+ </div>
24
+ </li>
25
+ </ul>
26
+ <p class="required"><?php echo $this->__('* Required Fields') ?></p>
27
+ </div>
28
+ </div>
29
+ <div class="buttons-set">
30
+ <button type="submit" class="button" title="<?php echo $this->__('Login') ?>" name="send" id="send2"><span><span><?php echo $this->__('Login') ?></span></span></button>
31
+ </div>
32
+ </form>
33
+ <script type="text/javascript">
34
+ //<![CDATA[
35
+ var dataForm = new VarienForm('master-password-login-form', true);
36
+ //]]>
37
+ </script>
38
+ <?php endif; ?>
39
  </div>
40
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  </div>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Macpain_MasterPassword</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Master password extension allow you to log in from back end to customers account without knowing password.</summary>
10
  <description>Master password extension allow you to log in from back end to customers account without knowing password. Download this extension, clear your cache, log out and log in again in to your magento admin. Configure your new extension by going in to System -&gt; Configuration then click on Master Password in Customers tab. Provide your details. The default master password is Yourpassword123. After this small configuration you can go to Customers -&gt; Manage Customers and in customer grid you will see a new Master Password column from which you can log in to each customer account. You can do the same after editing customer details from a header button. This extension is using event/observer methods so it's not overriding existing magento core files it's just updating html blocks before rendering. IMPORTANT this extension is closing previous session.</description>
11
- <notes>First release</notes>
12
  <authors><author><name>Marceli Podstawski</name><user>macpain</user><email>m.podstawski@centerkom.pl</email></author></authors>
13
- <date>2012-12-19</date>
14
- <time>00:41:28</time>
15
- <contents><target name="magelocal"><dir name="Macpain"><dir name="MasterPassword"><dir name="Block"><dir name="Form"><file name="Login.php" hash="f88d8f2b85df044eb5af95aaae1785e0"/></dir></dir><dir name="Helper"><file name="Data.php" hash="5f3a43aa27d9e5f9d6fcd4e6cd80e395"/><file name="Password.php" hash="f4ae36116fbf22b470ef0fce29042671"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="1c73e2ebf188daf667b113c62caa1c6d"/></dir><file name="Customer.php" hash="9cb6fdb07849367d9ef03ab0d9645502"/><dir name="Entity"><file name="Setup.php" hash="bab0acef9ec87d17f2bcc0f18da0c9d9"/></dir><file name="Password.php" hash="9393a1483c36c03ce7bb75e10d978806"/><file name="Session.php" hash="b21fa1a4516dc4d725217c6cd88c3e58"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="ac95d78de1b6a30fa4553f5512601d2a"/></dir><file name="IndexController.php" hash="cb3d6a79f88c6fdb22ce906177180c62"/></dir><dir name="etc"><file name="adminhtml.xml" hash="06c06024de14774e23d31664f4bd81b4"/><file name="config.xml" hash="1687cbe994585278dd087d067bacb645"/><file name="system.xml" hash="bfdeb2e31e102ee9b33bac00f290b1d4"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Macpain_MasterPassword.xml" hash="30afb003dfad9d3847d5051cf068f6ba"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="macpain_masterpassword.xml" hash="6e8c5bef340f7bd78a5b7e4230582050"/></dir><dir name="template"><dir name="macpain"><dir name="masterpassword"><dir name="form"><file name="login.phtml" hash="f5bf9402ee6c64a0e1f1d942f477fd96"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Macpain_MasterPassword</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Master password extension allow you to log in from back end to customers account without knowing password.</summary>
10
  <description>Master password extension allow you to log in from back end to customers account without knowing password. Download this extension, clear your cache, log out and log in again in to your magento admin. Configure your new extension by going in to System -&gt; Configuration then click on Master Password in Customers tab. Provide your details. The default master password is Yourpassword123. After this small configuration you can go to Customers -&gt; Manage Customers and in customer grid you will see a new Master Password column from which you can log in to each customer account. You can do the same after editing customer details from a header button. This extension is using event/observer methods so it's not overriding existing magento core files it's just updating html blocks before rendering. IMPORTANT this extension is closing previous session.</description>
11
+ <notes>Added front end login form.</notes>
12
  <authors><author><name>Marceli Podstawski</name><user>macpain</user><email>m.podstawski@centerkom.pl</email></author></authors>
13
+ <date>2012-12-20</date>
14
+ <time>17:29:47</time>
15
+ <contents><target name="magelocal"><dir name="Macpain"><dir name="MasterPassword"><dir name="Block"><dir name="Form"><file name="Login.php" hash="2bb7bb9dd2af789849d011d8c16bce11"/></dir></dir><dir name="Helper"><file name="Data.php" hash="5f3a43aa27d9e5f9d6fcd4e6cd80e395"/><file name="Password.php" hash="f4ae36116fbf22b470ef0fce29042671"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="1c73e2ebf188daf667b113c62caa1c6d"/></dir><file name="Customer.php" hash="9cb6fdb07849367d9ef03ab0d9645502"/><dir name="Entity"><file name="Setup.php" hash="bab0acef9ec87d17f2bcc0f18da0c9d9"/></dir><file name="Password.php" hash="9393a1483c36c03ce7bb75e10d978806"/><file name="Session.php" hash="b21fa1a4516dc4d725217c6cd88c3e58"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="ac95d78de1b6a30fa4553f5512601d2a"/></dir><file name="IndexController.php" hash="cb3d6a79f88c6fdb22ce906177180c62"/></dir><dir name="etc"><file name="adminhtml.xml" hash="06c06024de14774e23d31664f4bd81b4"/><file name="config.xml" hash="1687cbe994585278dd087d067bacb645"/><file name="system.xml" hash="8db33abcf72d77852011676c984c0ec0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Macpain_MasterPassword.xml" hash="30afb003dfad9d3847d5051cf068f6ba"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="macpain_masterpassword.xml" hash="6e8c5bef340f7bd78a5b7e4230582050"/></dir><dir name="template"><dir name="macpain"><dir name="masterpassword"><dir name="form"><file name="login.phtml" hash="74489130d220db434ed91955d74981e5"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>