Version Notes
- 2.0.7: update MageTrashApp, fix some bug in specific case during checkout process
- 2.0.5: remove test text
- 2.0.4: fix of "username exists" error message
- 2.0.3: fix bad Observer merge
- 2.0.1 / 2.0.2:
- Add composer, modman, MageTrashApp support to help installing and uninstalling this module
- Move template to design base package
- Fix several bugs like saving username from frontend, checkout process as guest, etc
- Follow best practices for module setup
- Version 1.5.0: update for Magento 1.7
- Version 1.4.0: fix a problem to enable and disable a customer account from Customer Management in backend
- Version 1.3.0: new features. Configurable options: display username in Manage Customer Grid, allow customer to edit or not username in frontend My Account, define maximum and minimum length of username for the forms, define what kind of validation desired (letters, digits, both or both " _-)
- Version 1.2.1: fix customer account layout
- Version 1.2.0: fix problem with case sensitive OS, limit the number of characters possible (now it's between 6 and 30 letters), allow only some characters, try to provide compatibility update for users who had the old Jfusion_Username module, generate a username for old customers who don't have it, based on email address and a random id, improve the german translation, tested on 1.6.2 and 1.5.1
- Version 1.1.0: change the module name from Jfusion_Customer to Diglin_Username, fix bugs with checkout frontend and backend and with old customers
- Version 1.0.2 - fix a bug with the installation
- Version 1.0.1 - fix bug in sql query during installation on prefixed tables, add german translation, do package for Magento version prior to 1.5 and version 1.5.x
- Version 1.0.0 - stable version
Release Info
Developer | Magento Core Team |
Extension | Diglin_Username |
Version | 2.0.7 |
Comparing to | |
See all releases |
Code changes from version 2.0.5 to 2.0.7
- app/code/community/Diglin/Username/Model/Form.php +9 -2
- app/code/community/Diglin/Username/controllers/AccountController.php +4 -2
- app/code/community/Diglin/Username/data/username_setup/data-install-2.0.0.php +7 -4
- app/code/community/Diglin/Username/etc/config.xml +1 -1
- app/code/community/Hackathon/MageTrashApp/etc/adminhtml.xml +1 -1
- app/code/community/Hackathon/MageTrashApp/etc/config.xml +1 -1
- app/code/community/Hackathon/MageTrashApp/etc/system.xml +1 -1
- package.xml +6 -5
@@ -31,7 +31,7 @@ class Diglin_Username_Model_Form extends Mage_Customer_Model_Form
|
|
31 |
{
|
32 |
$errors = parent::validateData($data);
|
33 |
|
34 |
-
if (
|
35 |
$model = Mage::getModel('customer/customer');
|
36 |
|
37 |
$customerId = Mage::app()->getFrontController()
|
@@ -42,10 +42,17 @@ class Diglin_Username_Model_Form extends Mage_Customer_Model_Form
|
|
42 |
$customerId = Mage::app()->getFrontController()
|
43 |
->getRequest()
|
44 |
->getParam('id');
|
45 |
-
}
|
|
|
|
|
46 |
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
47 |
}
|
48 |
|
|
|
|
|
|
|
|
|
|
|
49 |
if (isset($data['website_id']) && $data['website_id'] !== false) {
|
50 |
$websiteId = $data['website_id'];
|
51 |
} elseif ($customerId) {
|
31 |
{
|
32 |
$errors = parent::validateData($data);
|
33 |
|
34 |
+
if (!empty($data['username'])) {
|
35 |
$model = Mage::getModel('customer/customer');
|
36 |
|
37 |
$customerId = Mage::app()->getFrontController()
|
42 |
$customerId = Mage::app()->getFrontController()
|
43 |
->getRequest()
|
44 |
->getParam('id');
|
45 |
+
}
|
46 |
+
|
47 |
+
if (!$customerId && !Mage::app()->getStore()->isAdmin()) {
|
48 |
$customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
|
49 |
}
|
50 |
|
51 |
+
// Prevent possible errors
|
52 |
+
if (empty($customerId)) {
|
53 |
+
return $errors;
|
54 |
+
}
|
55 |
+
|
56 |
if (isset($data['website_id']) && $data['website_id'] !== false) {
|
57 |
$websiteId = $data['website_id'];
|
58 |
} elseif ($customerId) {
|
@@ -33,7 +33,9 @@ class Diglin_Username_AccountController extends Mage_Customer_AccountController
|
|
33 |
return;
|
34 |
} else if (!$customer->getId()) {
|
35 |
// Load by Email if username not found and email seems to be valid
|
36 |
-
$customer
|
|
|
|
|
37 |
}
|
38 |
|
39 |
if ($customer->getId()) {
|
@@ -57,4 +59,4 @@ class Diglin_Username_AccountController extends Mage_Customer_AccountController
|
|
57 |
return;
|
58 |
}
|
59 |
}
|
60 |
-
}
|
33 |
return;
|
34 |
} else if (!$customer->getId()) {
|
35 |
// Load by Email if username not found and email seems to be valid
|
36 |
+
$customer
|
37 |
+
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
|
38 |
+
->loadByEmail($email);
|
39 |
}
|
40 |
|
41 |
if ($customer->getId()) {
|
59 |
return;
|
60 |
}
|
61 |
}
|
62 |
+
}
|
@@ -23,20 +23,23 @@ $select = $installer->getConnection()->select()
|
|
23 |
$ids = $installer->getConnection()->fetchCol($select);
|
24 |
|
25 |
$select = $installer->getConnection()->select()
|
26 |
-
->from(array('c' => $this->getTable('customer_entity')), 'email');
|
27 |
|
28 |
if (!empty($ids)) {
|
29 |
$select->joinLeft(array('cev' => $this->getTable('customer_entity_varchar')), 'c.entity_id = cev.entity_id')
|
30 |
-
|
31 |
}
|
32 |
|
|
|
|
|
33 |
// Create username for old customers to prevent problem when creating an order as a guest
|
34 |
$customers = $installer->getConnection()->fetchAll($select);
|
35 |
-
foreach ($customers as $customer){
|
36 |
$customer['attribute_id'] = $usernameAttribute->getId();
|
37 |
$email = $customer['email'];
|
38 |
$pos = strpos($email, '@');
|
39 |
-
$customer['value'] = substr($email, 0, $pos) . substr(uniqid(), 0, 5);
|
|
|
40 |
unset($customer['email']);
|
41 |
unset($customer['value_id']);
|
42 |
|
23 |
$ids = $installer->getConnection()->fetchCol($select);
|
24 |
|
25 |
$select = $installer->getConnection()->select()
|
26 |
+
->from(array('c' => $this->getTable('customer_entity')), array('email', 'entity_id', 'entity_type_id'));
|
27 |
|
28 |
if (!empty($ids)) {
|
29 |
$select->joinLeft(array('cev' => $this->getTable('customer_entity_varchar')), 'c.entity_id = cev.entity_id')
|
30 |
+
->where('cev.entity_id NOT IN ('. implode(',', $ids) . ')');
|
31 |
}
|
32 |
|
33 |
+
// @todo - add support for Customer Website Share option (check that the username doesn't already exist in other websites)
|
34 |
+
|
35 |
// Create username for old customers to prevent problem when creating an order as a guest
|
36 |
$customers = $installer->getConnection()->fetchAll($select);
|
37 |
+
foreach ($customers as $customer) {
|
38 |
$customer['attribute_id'] = $usernameAttribute->getId();
|
39 |
$email = $customer['email'];
|
40 |
$pos = strpos($email, '@');
|
41 |
+
$customer['value'] = substr($email, 0, $pos) . substr(uniqid(), 0, 5) . $customer['entity_id'];
|
42 |
+
|
43 |
unset($customer['email']);
|
44 |
unset($customer['value_id']);
|
45 |
|
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Diglin_Username>
|
5 |
-
<version>2.0.
|
6 |
</Diglin_Username>
|
7 |
</modules>
|
8 |
<default>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Diglin_Username>
|
5 |
+
<version>2.0.7</version>
|
6 |
</Diglin_Username>
|
7 |
</modules>
|
8 |
<default>
|
@@ -8,7 +8,7 @@
|
|
8 |
<children>
|
9 |
<config>
|
10 |
<children>
|
11 |
-
<magetrashapp translate="title" module="
|
12 |
<title>Mage Trash App</title>
|
13 |
</magetrashapp>
|
14 |
</children>
|
8 |
<children>
|
9 |
<config>
|
10 |
<children>
|
11 |
+
<magetrashapp translate="title" module="magetrashapp">
|
12 |
<title>Mage Trash App</title>
|
13 |
</magetrashapp>
|
14 |
</children>
|
@@ -10,7 +10,7 @@
|
|
10 |
|
11 |
<modules>
|
12 |
<Hackathon_MageTrashApp>
|
13 |
-
<version>1.0.
|
14 |
</Hackathon_MageTrashApp>
|
15 |
</modules>
|
16 |
|
10 |
|
11 |
<modules>
|
12 |
<Hackathon_MageTrashApp>
|
13 |
+
<version>1.0.1</version>
|
14 |
</Hackathon_MageTrashApp>
|
15 |
</modules>
|
16 |
|
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
<config>
|
4 |
<sections>
|
5 |
-
<magetrashapp translate="label">
|
6 |
<label>Mage Trash App</label>
|
7 |
<tab>advanced</tab>
|
8 |
<frontend_type>text</frontend_type>
|
2 |
|
3 |
<config>
|
4 |
<sections>
|
5 |
+
<magetrashapp translate="label" module="magetrashapp">
|
6 |
<label>Mage Trash App</label>
|
7 |
<tab>advanced</tab>
|
8 |
<frontend_type>text</frontend_type>
|
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Diglin_Username</name>
|
4 |
-
<version>2.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -25,7 +25,8 @@ Allow to disable an account from backend. The user will be blocked if the option
|
|
25 |
- NEW - support username into the template of the persistent module
|
26 |

|
27 |
Use MageTrashApp to uninstall this module correctly: https://github.com/magento-hackathon/MageTrashApp</description>
|
28 |
-
<notes>- 2.0.
|
|
|
29 |
- 2.0.4: fix of "username exists" error message
|
30 |
- 2.0.3: fix bad Observer merge
|
31 |
- 2.0.1 / 2.0.2:
|
@@ -43,9 +44,9 @@ Use MageTrashApp to uninstall this module correctly: https://github.com/magento-
|
|
43 |
- Version 1.0.1 - fix bug in sql query during installation on prefixed tables, add german translation, do package for Magento version prior to 1.5 and version 1.5.x
|
44 |
- Version 1.0.0 - stable version</notes>
|
45 |
<authors><author><name>diglin</name><user>auto-converted</user><email>sly@diglin.com</email></author></authors>
|
46 |
-
<date>2013-
|
47 |
-
<time>
|
48 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Diglin_Username.xml" hash="79603fae3def6dd098d4be51897e1ec6"/><file name="Hackathon_MageTrashApp.xml" hash="247c6b5278c3681efe24f504c5b48970"/></dir></target><target name="magecommunity"><dir name="Diglin"><dir name="Username"><dir name="Block"><dir name="Overwrite"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Hint.php" hash="85edae9eec85d06b63a8c259cb787b23"/></dir></dir><file name="Grid.php" hash="fa13010ac51260cf515fd8710af9abea"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="803f067b0eb5ff5629a113c6d723e54d"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Inputvalidation.php" hash="cfe26f69418559c14f1b8b6ca3eabc93"/></dir><file name="Share.php" hash="8258ff3fd56df05dec26529e785cf1a5"/></dir><dir name="Entity"><file name="Customer.php" hash="2999c400148c03e5f11d075ef505211a"/><file name="Setup.php" hash="73fbe07ed6383c4bda8be73e9c43c923"/></dir><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="1cfb9b92dfeff58dffe5329aefe5beb0"/></dir></dir><file name="Customer.php" hash="75c540a2fca3469c2318f4f649e1eb21"/><file name="Form.php" hash="
|
49 |
<compatible/>
|
50 |
<dependencies/>
|
51 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Diglin_Username</name>
|
4 |
+
<version>2.0.7</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
25 |
- NEW - support username into the template of the persistent module
|
26 |

|
27 |
Use MageTrashApp to uninstall this module correctly: https://github.com/magento-hackathon/MageTrashApp</description>
|
28 |
+
<notes>- 2.0.7: update MageTrashApp, fix some bug in specific case during checkout process
|
29 |
+
- 2.0.5: remove test text
|
30 |
- 2.0.4: fix of "username exists" error message
|
31 |
- 2.0.3: fix bad Observer merge
|
32 |
- 2.0.1 / 2.0.2:
|
44 |
- Version 1.0.1 - fix bug in sql query during installation on prefixed tables, add german translation, do package for Magento version prior to 1.5 and version 1.5.x
|
45 |
- Version 1.0.0 - stable version</notes>
|
46 |
<authors><author><name>diglin</name><user>auto-converted</user><email>sly@diglin.com</email></author></authors>
|
47 |
+
<date>2013-07-01</date>
|
48 |
+
<time>22:35:30</time>
|
49 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Diglin_Username.xml" hash="79603fae3def6dd098d4be51897e1ec6"/><file name="Hackathon_MageTrashApp.xml" hash="247c6b5278c3681efe24f504c5b48970"/></dir></target><target name="magecommunity"><dir name="Diglin"><dir name="Username"><dir name="Block"><dir name="Overwrite"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Hint.php" hash="85edae9eec85d06b63a8c259cb787b23"/></dir></dir><file name="Grid.php" hash="fa13010ac51260cf515fd8710af9abea"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="803f067b0eb5ff5629a113c6d723e54d"/></dir><dir name="Model"><dir name="Config"><dir name="Source"><file name="Inputvalidation.php" hash="cfe26f69418559c14f1b8b6ca3eabc93"/></dir><file name="Share.php" hash="8258ff3fd56df05dec26529e785cf1a5"/></dir><dir name="Entity"><file name="Customer.php" hash="2999c400148c03e5f11d075ef505211a"/><file name="Setup.php" hash="73fbe07ed6383c4bda8be73e9c43c923"/></dir><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="1cfb9b92dfeff58dffe5329aefe5beb0"/></dir></dir><file name="Customer.php" hash="75c540a2fca3469c2318f4f649e1eb21"/><file name="Form.php" hash="22c77322bba791b9c875f552271fd1d6"/><file name="Observer.php" hash="30dff0af4237ff39444f6853498a2d51"/></dir><dir name="controllers"><file name="AccountController.php" hash="3aabd7765687ffcb6a6ef8c3f007b7f4"/></dir><dir name="data"><dir name="username_setup"><file name="data-install-2.0.0.php" hash="0771d8baa20610af6e8f53b50fbd8fd3"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="8eaa2843438b116e9d0425fcdd2ccabf"/><file name="config.xml" hash="41c9e7b9d9465d8b99361dcdb38c99db"/><file name="system.xml" hash="fadc30d87b96cf220854af18f8788f77"/><file name="uninstall.txt" hash="70ce51e6ea76f07394760ca567cd6294"/></dir><dir name="sql"><dir name="username_setup"><file name="install-2.0.0.php" hash="6c827f26e94876a82012a91f6b74370d"/><file name="mysql4-install-1.0.0.php" hash="deaa6e702bd0a6b83c41a10fbcc5cce9"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="fe759e361a65fc51eb6dc8a50b9605e8"/><file name="mysql4-upgrade-1.1.0-1.2.0.php" hash="21cdb85ec6ad08fac97252a604ca17ba"/><file name="mysql4-upgrade-1.3.0-1.4.0.php" hash="93f4d880243152b75ed2be2b26084e3d"/><file name="mysql4-upgrade-1.4.0-2.0.0.php" hash="cbe2c4027c846567eb45f757193f4edc"/><file name="uninstall.php" hash="379f87574ab4d0e95e3aace302bd572a"/></dir></dir></dir></dir><dir name="Hackathon"><dir name="MageTrashApp"><dir name="Adminhtml"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Modules"><file name="MageTrashApp.php" hash="8dc018926d9478d2ee12b505033e312a"/></dir></dir></dir></dir></dir></dir></dir><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Fieldset"><dir name="Modules"><file name="MageTrashApp.php" hash="190b72529aa16a61b6bc2490774304e3"/><file name="Rewind.php" hash="6a7d8004e79fd2f5226b2ca6f1a32d48"/></dir></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="6ea1f755b3470cd8254fec25977f08bd"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="Config"><file name="Data.php" hash="666da6fe6343b0bf38ac6313242871bc"/></dir></dir><dir name="Resource"><file name="Resource.php" hash="ba46996c23e6c17db231fcfd7eeee1cd"/><file name="Setup.php" hash="01c3a067fb830edd7c2783b9a9b2d2bb"/></dir><file name="CoreResource.php" hash="48faa17486cbdb58b5b58e26a892bc8a"/><file name="Observer.php" hash="4edb98984908198865fd9a73fe15ccab"/><file name="PearWrapper.php" hash="5bfc49da1c0c4b8801217e1ece28b7e9"/><file name="Uninstall.php" hash="e8fe01333bae1d1c187b7eb95568e903"/></dir><dir name="Test"><dir name="Config"><file name="Config.php" hash="71d4e2715f295ac097316e02736fc986"/></dir><dir name="Helper"><file name="DataTest.php" hash="7bfebdb2953dc220457240fd01503ab7"/></dir><dir name="Model"><file name="Observer.php" hash="fbd80ba2d0eb8c6058f1a45d00e476f5"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="indexController.php" hash="b4ea9f1b928458c1af902416b91300d0"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="00f054210e5799c44ec2adb4da65631a"/><file name="config.xml" hash="c7d1d6c559075657d8a0f905ab705e41"/><file name="doc.uninstall.txt" hash="b2de80f292016c5392b0edbc21ac29f1"/><file name="system.xml" hash="08f31fc3097b3a4d1a702b7b5195fc7e"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="username"><dir name="checkout"><dir name="onepage"><dir name="13"><file name="billing.phtml" hash="e7875ec85ee418539807266e0f8d7581"/></dir><dir name="17"><file name="billing.phtml" hash="35a3604ae93631f7a6522f923d2d364d"/></dir><file name="billing.phtml" hash="3e91cd48d06ba295d367b866986ad25a"/><file name="login.phtml" hash="5db44d2a09be5d33cdbacdab2a1fa978"/></dir></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="4fbd87ccca20ca1c28ef64c060a13cce"/></dir></dir><dir name="form"><dir name="13"><file name="register.phtml" hash="788e9c07648371ca7eec005091a6f743"/></dir><dir name="17"><file name="register.phtml" hash="236486d1b7e9d60f686c46d3e485d793"/></dir><file name="edit.phtml" hash="9169cd9135d7f0b74ae9f973f0fd6f36"/><file name="forgotpassword.phtml" hash="2764b7f1630adeda0bf058a148f2202e"/><file name="login.phtml" hash="aaad00540adca570d18dba9afc0f1858"/><file name="register.phtml" hash="2a74a300edcf780acb804b8cd25c393e"/></dir></dir><dir name="persistent"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="02653472f632833b8bc86245ff41d33c"/><file name="login.phtml" hash="27bd60ec63fc2911458df4191fc465be"/></dir></dir><dir name="customer"><dir name="form"><file name="login.phtml" hash="959d89c5e13704e289c861a1d8fcee13"/><file name="register.phtml" hash="1763f5b002dbadf20dd97875123e2aef"/></dir></dir></dir></dir></dir><dir name="layout"><file name="username.xml" hash="432ef8d9bd05bdfedfae879c981ba95c"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_GB"><file name="Diglin_Username.csv" hash="2d18fb6bfc2c4c56f19cfe7ee6761f4b"/></dir><dir name="en_US"><file name="Diglin_Username.csv" hash="2d18fb6bfc2c4c56f19cfe7ee6761f4b"/></dir><dir name="fr_FR"><file name="Diglin_Username.csv" hash="d8d025c852649fc8e9edd2aed5ab377a"/></dir><dir name="de_DE"><file name="Diglin_Username.csv" hash="7a0aa81dbdafe2ef121a08cd03c64893"/></dir></target></contents>
|
50 |
<compatible/>
|
51 |
<dependencies/>
|
52 |
</package>
|