Diglin_Username - Version 2.2.2

Version Notes

Version 2.2.2
- Fix issue with input validation (any kind of input was possible)

Version 2.0.*
e694fcb Add custom input validation
85a0f51 Update translations
1ca6441 Update Copyright
799fc1b [FIX] prevent to save username when it's not allowed from configuration
55ab34e make the module compatible with MAgento 1.8, change copyright, move column logic for customer grid into observer
6c49218 Merge pull request #7 from gdhnz/master
bad7445 Add permission "allow everything" to adminhtml.xml to resolve admin 404 for the extension config screen under CE 1.8
fa712c7 Code factoring
6c603d8 fix comment typo
5f5fe14 change to version 2.0.7
41e58bb fix bad condition test in case of not found $customerId in Form.php. Use case, checkout process with already logged in customer.
b8e71c7 add submodule MageTrashApp
757a3e2 Update README.md
48244a4 add version 2.0.6
e9453ff generate correctly username for old customers while installing the module
f422067 Fix to the controller forgotPassword
fd71c66 change version to 2.0.5
67bf362 cleanup some test
adc2bb5 add fix when customer information are saved from backend, add observer fix for collection (do not know yet if it resolved hte problem of a user who contacted me about grid
1c0c07f change version number
4ab072f fix bad merging
cd2bb86 Update README.md
fa3f821 Update composer.json
d10136e add dependency suggestion
ff053ba remove todo task
b300aa0 Fix a problem with sql data install with empty select query
5b179b5 add uninstall process for module MageTrashApp
ce428e9 add composer.json
d93cc55 merge observer
29d4c21 add condition to test if attribute username model exists before to save the config
14acf45 Update README.md
21f72b7 add missing column for sales_flat_order table
612052d improve checkout process as a guest (no complain that username is a required field when you are a guest), fix issue with install data script
aafb0be split template depending on the magento version, add missing template for use cases using persisten customer feature
ce9245b Fix or improve form model while saving new customer data
42444f3 Improve test if shop owner change the account sharing options
4d10edb Improve Username Module: setup is now completly rewritten for Magento 1.7, add username for forgotten password, allow now to disable the feature from configuration page, ch
c6b7250 add customer ID fix depending on the context
788e656 add optionable strtolower username
49cb18d add optionable strtolower username
dff09e0 Add modman and instruction to use it
2d6b6c8 Merge pull request #1 from clst/master
1d143e9 fix: weird quote characters in german language file
9cbf4a2 add: can now update is_active for existing customers
dfa9cc6 Fix some bug and add a way to import is_active attribute
60c7143 Update README.md
24afad2 add gitignore and license files

Download this release

Release Info

Developer diglin
Extension Diglin_Username
Version 2.2.2
Comparing to
See all releases


Code changes from version 2.2.1 to 2.2.2

Files changed (67) hide show
  1. app/code/community/Diglin/Username/Block/Adminhtml/Config/Source/Generate.php +85 -0
  2. app/code/community/Diglin/Username/Block/Adminhtml/Config/Source/Hint.php +8 -7
  3. app/code/community/Diglin/Username/Helper/Data.php +3 -5
  4. app/code/community/Diglin/Username/Model/Config/Share.php +3 -5
  5. app/code/community/Diglin/Username/Model/Config/Source/Inputvalidation.php +3 -5
  6. app/code/community/Diglin/Username/Model/Customer.php +3 -5
  7. app/code/community/Diglin/Username/Model/Entity/Customer.php +3 -5
  8. app/code/community/Diglin/Username/Model/Entity/Setup.php +4 -5
  9. app/code/community/Diglin/Username/Model/Form.php +50 -32
  10. app/code/community/Diglin/Username/Model/Generate/Flag.php +62 -0
  11. app/code/community/Diglin/Username/Model/Import/Entity/Customer.php +3 -5
  12. app/code/community/Diglin/Username/Model/Observer.php +32 -34
  13. app/code/community/Diglin/Username/controllers/AccountController.php +3 -5
  14. app/code/community/Diglin/Username/controllers/Adminhtml/SyncController.php +147 -0
  15. app/code/community/Diglin/Username/data/username_setup/data-install-2.0.0.php +4 -41
  16. app/code/community/Diglin/Username/etc/adminhtml.xml +4 -19
  17. app/code/community/Diglin/Username/etc/config.xml +18 -12
  18. app/code/community/Diglin/Username/etc/system.xml +100 -105
  19. app/code/community/Diglin/Username/etc/uninstall.txt +1 -0
  20. app/code/community/Diglin/Username/sql/username_setup/install-2.0.0.php +3 -5
  21. app/code/community/Diglin/Username/sql/username_setup/mysql4-install-1.0.0.php +3 -5
  22. app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.0.0-1.1.0.php +3 -5
  23. app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.1.0-1.2.0.php +3 -5
  24. app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.3.0-1.4.0.php +3 -5
  25. app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.4.0-2.0.0.php +3 -5
  26. app/code/community/Diglin/Username/sql/username_setup/uninstall.php +3 -5
  27. app/code/community/Diglin/Username/sql/username_setup/upgrade-2.2.0-2.2.1.php +26 -0
  28. app/code/community/Hackathon/MageTrashApp/Adminhtml/Block/System/Config/Form/Fieldset/Modules/MageTrashApp.php +0 -91
  29. app/code/community/Hackathon/MageTrashApp/Block/Adminhtml/System/Config/Form/Fieldset/Modules/MageTrashApp.php +0 -91
  30. app/code/community/Hackathon/MageTrashApp/Block/Adminhtml/System/Config/Form/Fieldset/Modules/Rewind.php +0 -120
  31. app/code/community/Hackathon/MageTrashApp/Helper/Data.php +0 -180
  32. app/code/community/Hackathon/MageTrashApp/Model/Adminhtml/Config/Data.php +0 -173
  33. app/code/community/Hackathon/MageTrashApp/Model/CoreResource.php +0 -47
  34. app/code/community/Hackathon/MageTrashApp/Model/Observer.php +0 -67
  35. app/code/community/Hackathon/MageTrashApp/Model/PearWrapper.php +0 -245
  36. app/code/community/Hackathon/MageTrashApp/Model/Resource/Resource.php +0 -28
  37. app/code/community/Hackathon/MageTrashApp/Model/Resource/Setup.php +0 -37
  38. app/code/community/Hackathon/MageTrashApp/Model/Uninstall.php +0 -196
  39. app/code/community/Hackathon/MageTrashApp/Test/Config/Config.php +0 -8
  40. app/code/community/Hackathon/MageTrashApp/Test/Helper/DataTest.php +0 -45
  41. app/code/community/Hackathon/MageTrashApp/Test/Model/Observer.php +0 -12
  42. app/code/community/Hackathon/MageTrashApp/controllers/Adminhtml/indexController.php +0 -26
  43. app/code/community/Hackathon/MageTrashApp/etc/adminhtml.xml +0 -22
  44. app/code/community/Hackathon/MageTrashApp/etc/config.xml +0 -85
  45. app/code/community/Hackathon/MageTrashApp/etc/doc.uninstall.txt +0 -20
  46. app/code/community/Hackathon/MageTrashApp/etc/system.xml +0 -35
  47. app/design/adminhtml/default/default/template/username/system/config/generate.phtml +85 -0
  48. app/design/frontend/base/default/layout/username.xml +4 -19
  49. app/design/frontend/base/default/template/username/checkout/onepage/13/billing.phtml +2 -11
  50. app/design/frontend/base/default/template/username/checkout/onepage/17/billing.phtml +2 -11
  51. app/design/frontend/base/default/template/username/checkout/onepage/billing.phtml +2 -11
  52. app/design/frontend/base/default/template/username/checkout/onepage/login.phtml +2 -11
  53. app/design/frontend/base/default/template/username/customer/account/dashboard/info.phtml +2 -11
  54. app/design/frontend/base/default/template/username/customer/form/13/register.phtml +2 -11
  55. app/design/frontend/base/default/template/username/customer/form/17/register.phtml +2 -11
  56. app/design/frontend/base/default/template/username/customer/form/edit.phtml +2 -11
  57. app/design/frontend/base/default/template/username/customer/form/forgotpassword.phtml +3 -12
  58. app/design/frontend/base/default/template/username/customer/form/login.phtml +2 -11
  59. app/design/frontend/base/default/template/username/customer/form/register.phtml +2 -11
  60. app/design/frontend/base/default/template/username/persistent/checkout/onepage/billing.phtml +0 -9
  61. app/design/frontend/base/default/template/username/persistent/checkout/onepage/login.phtml +1 -10
  62. app/design/frontend/base/default/template/username/persistent/customer/form/login.phtml +1 -10
  63. app/design/frontend/base/default/template/username/persistent/customer/form/register.phtml +1 -10
  64. app/etc/modules/Hackathon_MageTrashApp.xml +0 -9
  65. app/locale/en_GB/Diglin_Username.csv +2 -1
  66. app/locale/en_US/Diglin_Username.csv +2 -1
  67. package.xml +68 -44
app/code/community/Diglin/Username/Block/Adminhtml/Config/Source/Generate.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin GmbH
4
+ *
5
+ * @category Diglin
6
+ * @package Diglin_Username
7
+ * @author Sylvain Rayé <support@diglin.com>
8
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ */
11
+
12
+ /**
13
+ * Class Diglin_Username_Block_Adminhtml_Config_Source_Generate
14
+ */
15
+ class Diglin_Username_Block_Adminhtml_Config_Source_Generate extends Mage_Adminhtml_Block_System_Config_Form_Field
16
+ {
17
+ /*
18
+ * Set template
19
+ */
20
+ protected function _construct()
21
+ {
22
+ parent::_construct();
23
+ $this->setTemplate('username/system/config/generate.phtml');
24
+ }
25
+
26
+ /**
27
+ * Remove scope label
28
+ *
29
+ * @param Varien_Data_Form_Element_Abstract $element
30
+ * @return string
31
+ */
32
+ public function render(Varien_Data_Form_Element_Abstract $element)
33
+ {
34
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
35
+ return parent::render($element);
36
+ }
37
+
38
+ /**
39
+ * Return element html
40
+ *
41
+ * @param Varien_Data_Form_Element_Abstract $element
42
+ * @return string
43
+ */
44
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
45
+ {
46
+ return $this->_toHtml();
47
+ }
48
+
49
+ /**
50
+ * Return ajax url for synchronize button
51
+ *
52
+ * @return string
53
+ */
54
+ public function getAjaxSyncUrl()
55
+ {
56
+ return Mage::getSingleton('adminhtml/url')->getUrl('username/sync/generate');
57
+ }
58
+
59
+ /**
60
+ * Return ajax url for synchronize button
61
+ *
62
+ * @return string
63
+ */
64
+ public function getAjaxStatusUpdateUrl()
65
+ {
66
+ return Mage::getSingleton('adminhtml/url')->getUrl('username/sync/syncstatus');
67
+ }
68
+
69
+ /**
70
+ * Generate generate button html
71
+ *
72
+ * @return string
73
+ */
74
+ public function getButtonHtml()
75
+ {
76
+ $button = $this->getLayout()->createBlock('adminhtml/widget_button')
77
+ ->setData(array(
78
+ 'id' => 'generate_button',
79
+ 'label' => $this->helper('username')->__('Generate'),
80
+ 'onclick' => 'javascript:generate(); return false;'
81
+ ));
82
+
83
+ return $button->toHtml();
84
+ }
85
+ }
app/code/community/Diglin/Username/Block/Adminhtml/Config/Source/Hint.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
  class Diglin_Username_Block_Adminhtml_Config_Source_Hint
@@ -29,7 +27,10 @@ class Diglin_Username_Block_Adminhtml_Config_Source_Hint
29
  */
30
  public function render(Varien_Data_Form_Element_Abstract $element)
31
  {
32
- $version = Mage::getConfig()->getModuleConfig('Diglin_Username')->version;
33
- return '<p><a href="http://www.diglin.com/?utm_source=magento&utm_medium=extension&utm_campaign=username"><img style="vertical-align:middle" src="data:image/png;base64,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"></a> <strong>Diglin_Username Version: ' . $version . '</strong></p>';
 
 
 
34
  }
35
  }
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
  class Diglin_Username_Block_Adminhtml_Config_Source_Hint
27
  */
28
  public function render(Varien_Data_Form_Element_Abstract $element)
29
  {
30
+ $html = '<p><a href="http://www.diglin.com/?utm_source=magento&utm_medium=extension&utm_campaign=username">'
31
+ .'<img style="vertical-align:middle" src="data:image/png;base64,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">'
32
+ .'</a> Diglin GmbH | Rütistrasse 14, 8952 Schlieren - Switzerland | <a href="mailto:support@diglin.com?subject=Support Diglin Username">support@diglin.com</a></p>';
33
+
34
+ return $html . '<p><strong>Diglin_Username Version: '. Mage::getConfig()->getModuleConfig('Diglin_Username')->version .' - Powered by <a href="http://www.diglin.com/?utm_source=magento&utm_medium=extension&utm_campaign=username">Diglin GmbH</a></strong></p>';
35
  }
36
  }
app/code/community/Diglin/Username/Helper/Data.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/Model/Config/Share.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/Model/Config/Source/Inputvalidation.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/Model/Customer.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/Model/Entity/Customer.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/Model/Entity/Setup.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
@@ -39,6 +37,7 @@ class Diglin_Username_Model_Entity_Setup extends Mage_Customer_Model_Resource_Se
39
  'username' => array(
40
  'type' => 'varchar',
41
  'input' => 'text',
 
42
  'label' => 'Username',
43
  'visible' => true,
44
  'required' => false,
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
37
  'username' => array(
38
  'type' => 'varchar',
39
  'input' => 'text',
40
+ 'user_defined' => true,
41
  'label' => 'Username',
42
  'visible' => true,
43
  'required' => false,
app/code/community/Diglin/Username/Model/Form.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,26 +8,33 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
 
 
 
 
 
21
  class Diglin_Username_Model_Form extends Mage_Customer_Model_Form
22
  {
23
  /**
24
- * (non-PHPdoc)
 
 
 
 
 
25
  * @see Mage_Customer_Model_Form::extractData()
26
  */
27
- public function extractData (Zend_Controller_Request_Http $request, $scope = null, $scopeOnly = true)
28
  {
29
  $data = parent::extractData($request, $scope, $scopeOnly);
30
- if(isset($data['username']) && !Mage::getStoreConfigFlag('username/general/case_sensitive')) {
31
  $filter = new Zend_Filter_StringToLower(array('encoding' => 'UTF-8'));
32
  $data['username'] = $filter->filter($data['username']);
33
  }
@@ -35,13 +42,21 @@ class Diglin_Username_Model_Form extends Mage_Customer_Model_Form
35
  }
36
 
37
  /**
38
- * (non-PHPdoc)
39
- * @see Mage_Customer_Model_Form::validateData()
 
 
 
40
  */
41
- public function validateData (array $data)
42
  {
43
  $errors = parent::validateData($data);
44
 
 
 
 
 
 
45
  if (!empty($data['username'])) {
46
  $model = Mage::getModel('customer/customer');
47
 
@@ -49,27 +64,29 @@ class Diglin_Username_Model_Form extends Mage_Customer_Model_Form
49
  ->getRequest()
50
  ->getParam('customer_id');
51
 
52
- if (! $customerId) {
53
  $customerId = Mage::app()->getFrontController()
54
  ->getRequest()
55
  ->getParam('id');
56
- }
57
-
58
  if (!$customerId && !Mage::app()->getStore()->isAdmin()) {
59
  $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
60
  }
61
 
62
- // Prevent possible errors
63
- if (empty($customerId)) {
64
- return $errors;
65
- }
66
 
67
  if (isset($data['website_id']) && $data['website_id'] !== false) {
68
  $websiteId = $data['website_id'];
69
  } elseif ($customerId) {
70
  $customer = $model->load($customerId);
71
  $websiteId = $customer->getWebsiteId();
72
- if ($customer->getUsername() == $data['username']) { // don't make any test if the user has already a username
 
 
73
  return $errors;
74
  }
75
  } else {
@@ -87,27 +104,28 @@ class Diglin_Username_Model_Form extends Mage_Customer_Model_Form
87
  }
88
 
89
  // Other rules are validated by the parent class because they are basic rules provided by Magento Core
90
-
91
  $inputValidation = Mage::getStoreConfig('username/general/input_validation');
92
  $useInputValidation = ($inputValidation == 'default' || $inputValidation == 'custom') ? true : false;
93
 
94
- switch ($useInputValidation) {
95
- case 'default':
96
- $validate = '/^[\w-]*$/';
97
- break;
98
- case 'custom':
99
- $validate = Mage::getStoreConfig('username/general/input_validation_custom');
100
- break;
101
- }
102
-
103
  if ($useInputValidation) {
 
 
 
 
 
 
 
 
 
 
104
  $validate = new Zend_Validate_Regex($validate);
105
 
106
- if(! $validate->isValid($data['username']) ){
107
- if ($useInputValidation == 'custom') {
108
  $message = Mage::getStoreConfig('username/general/input_validation_custom_message');
109
  } else {
110
- $message = Mage::helper('username')->__('Username is invalid! Only letters, digits and \'_-\' values are accepted.');
 
111
  }
112
  $errors = array_merge($errors, array($message));
113
  }
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
16
  */
17
 
18
+ /**
19
+ * Username Form
20
+ *
21
+ * Class Diglin_Username_Model_Form
22
+ */
23
  class Diglin_Username_Model_Form extends Mage_Customer_Model_Form
24
  {
25
  /**
26
+ * Extract Data
27
+ *
28
+ * @param Zend_Controller_Request_Http $request Request
29
+ * @param null $scope Scope
30
+ * @param bool $scopeOnly Scope Only
31
+ * @return array
32
  * @see Mage_Customer_Model_Form::extractData()
33
  */
34
+ public function extractData(Zend_Controller_Request_Http $request, $scope = null, $scopeOnly = true)
35
  {
36
  $data = parent::extractData($request, $scope, $scopeOnly);
37
+ if (isset($data['username']) && !Mage::getStoreConfigFlag('username/general/case_sensitive')) {
38
  $filter = new Zend_Filter_StringToLower(array('encoding' => 'UTF-8'));
39
  $data['username'] = $filter->filter($data['username']);
40
  }
42
  }
43
 
44
  /**
45
+ * Validate Data
46
+ *
47
+ * @param array $data Data
48
+ * @return array|bool
49
+ * @throws Mage_Core_Exception
50
  */
51
+ public function validateData(array $data)
52
  {
53
  $errors = parent::validateData($data);
54
 
55
+ // Prevent to change/save the username if it is not allowed on the frontend to change the username
56
+ if (!Mage::getStoreConfigFlag('username/general/frontend') && !Mage::app()->getStore()->isAdmin()) {
57
+ return $errors;
58
+ }
59
+
60
  if (!empty($data['username'])) {
61
  $model = Mage::getModel('customer/customer');
62
 
64
  ->getRequest()
65
  ->getParam('customer_id');
66
 
67
+ if (!$customerId) {
68
  $customerId = Mage::app()->getFrontController()
69
  ->getRequest()
70
  ->getParam('id');
71
+ }
72
+
73
  if (!$customerId && !Mage::app()->getStore()->isAdmin()) {
74
  $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
75
  }
76
 
77
+ // Prevent possible errors
78
+ if (empty($customerId)) {
79
+ return $errors;
80
+ }
81
 
82
  if (isset($data['website_id']) && $data['website_id'] !== false) {
83
  $websiteId = $data['website_id'];
84
  } elseif ($customerId) {
85
  $customer = $model->load($customerId);
86
  $websiteId = $customer->getWebsiteId();
87
+
88
+ // don't make any test if the user has already a username
89
+ if ($customer->getUsername() == $data['username']) {
90
  return $errors;
91
  }
92
  } else {
104
  }
105
 
106
  // Other rules are validated by the parent class because they are basic rules provided by Magento Core
 
107
  $inputValidation = Mage::getStoreConfig('username/general/input_validation');
108
  $useInputValidation = ($inputValidation == 'default' || $inputValidation == 'custom') ? true : false;
109
 
 
 
 
 
 
 
 
 
 
110
  if ($useInputValidation) {
111
+ $validate = '/^*$/';
112
+ switch ($inputValidation) {
113
+ case 'default':
114
+ $validate = '/^[\w-]*$/';
115
+ break;
116
+ case 'custom':
117
+ $validate = Mage::getStoreConfig('username/general/input_validation_custom');
118
+ break;
119
+ }
120
+
121
  $validate = new Zend_Validate_Regex($validate);
122
 
123
+ if (!$validate->isValid($data['username'])) {
124
+ if ($inputValidation == 'custom') {
125
  $message = Mage::getStoreConfig('username/general/input_validation_custom_message');
126
  } else {
127
+ $message = Mage::helper('username')->
128
+ __('Username is invalid! Only letters, digits and \'_-\' values are accepted.');
129
  }
130
  $errors = array_merge($errors, array($message));
131
  }
app/code/community/Diglin/Username/Model/Generate/Flag.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin GmbH
4
+ *
5
+ * @category Diglin
6
+ * @package Diglin_Username
7
+ * @author Sylvain Rayé <support@diglin.com>
8
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ */
11
+
12
+ /**
13
+ * Class Diglin_Username_Model_Generate_Flag
14
+ */
15
+ class Diglin_Username_Model_Generate_Flag extends Mage_Core_Model_Flag
16
+ {
17
+ /**
18
+ * There was no generation
19
+ */
20
+ const STATE_INACTIVE = 0;
21
+ /**
22
+ * Generation process is active
23
+ */
24
+ const STATE_RUNNING = 1;
25
+ /**
26
+ * Generation is finished
27
+ */
28
+ const STATE_FINISHED = 2;
29
+ /**
30
+ * Generation finished and notify message was formed
31
+ */
32
+ const STATE_NOTIFIED = 3;
33
+
34
+ /**
35
+ * Flag time to life in seconds
36
+ */
37
+ const FLAG_TTL = 300;
38
+
39
+ /**
40
+ * Generation flag code
41
+ *
42
+ * @var string
43
+ */
44
+ protected $_flagCode = 'username_generate';
45
+
46
+ /**
47
+ * Pass error to flag
48
+ *
49
+ * @param Exception $e
50
+ * @return Diglin_Username_Model_Generate_Flag
51
+ */
52
+ public function passError(Exception $e)
53
+ {
54
+ $data = $this->getFlagData();
55
+ if (!is_array($data)) {
56
+ $data = array();
57
+ }
58
+ $data['has_errors'] = true;
59
+ $this->setFlagData($data);
60
+ return $this;
61
+ }
62
+ }
app/code/community/Diglin/Username/Model/Import/Entity/Customer.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/Model/Observer.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,16 +9,12 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
-
21
  class Diglin_Username_Model_Observer extends Mage_Customer_Model_Observer
22
  {
23
  /**
@@ -25,14 +22,14 @@ class Diglin_Username_Model_Observer extends Mage_Customer_Model_Observer
25
  *
26
  * Event: customer_customer_authenticated
27
  *
28
- * @param Varien_Event_Observer $observer
29
  * @throws Mage_Core_Exception
30
  */
31
  public function isActive($observer)
32
- {
33
  $customer = $observer->getEvent()->getModel();
34
  // Add the inactive option
35
- if($customer->getIsActive () != '1' ){
36
  throw new Mage_Core_Exception(Mage::helper('customer')->__('This account is disabled.'), 0);
37
  }
38
  }
@@ -42,9 +39,9 @@ class Diglin_Username_Model_Observer extends Mage_Customer_Model_Observer
42
  *
43
  * Event: eav_collection_abstract_load_before
44
  *
45
- * @param Varien_Event_Observer $observer
46
  */
47
- public function addAttributeToCollection ($observer)
48
  {
49
  /* @var $collection Mage_Eav_Model_Entity_Collection_Abstract */
50
  $collection = $observer->getEvent()->getCollection();
@@ -54,52 +51,53 @@ class Diglin_Username_Model_Observer extends Mage_Customer_Model_Observer
54
  }
55
 
56
  }
57
-
58
  /**
59
  * Change the attribute of username after the configuration
60
  * has been changed
61
  *
62
  * Event: admin_system_config_changed_section_username
63
  *
64
- * @param Varien_Event_Observer $observer
65
  */
66
- public function changeEavAttribute (Varien_Event_Observer $observer)
67
  {
68
  $minLength = Mage::getStoreConfig('username/general/min_length');
69
  $maxLength = Mage::getStoreConfig('username/general/max_length');
70
  $inputValidation = Mage::getStoreConfig('username/general/input_validation');
71
 
72
- if($minLength > $maxLength) {
73
  Mage::throwException(
74
- Mage::helper('username')->__('Sorry but you cannot set a minimum length value %s bigger than the maximum length value %s. Please, change the values.',
75
- $minLength,
76
- $maxLength)
 
77
  );
78
  }
79
 
80
  /* @var $attributeUsernameModel Mage_Customer_Model_Attribute */
81
  $attributeUsernameModel = Mage::getModel('customer/attribute')->loadByCode('customer', 'username');
82
- if($attributeUsernameModel->getId()) {
83
- $rules = $attributeUsernameModel->getValidateRules();
84
- $rules['max_text_length'] = $maxLength;
85
- $rules['min_text_length'] = $minLength;
86
-
87
- if($inputValidation != 'default' && $inputValidation != 'custom') {
88
- $rules['input_validation'] = $inputValidation;
89
- }else {
90
- $rules['input_validation'] = '';
91
- }
92
-
93
- $attributeUsernameModel->setValidateRules($rules);
94
- $attributeUsernameModel->save();
95
  }
96
  }
97
 
98
  /**
99
  * Event
100
- * - block_html_before
101
  *
102
- * @param Varien_Event_Observer $observer
103
  */
104
  public function addUsernameColumn(Varien_Event_Observer $observer)
105
  {
@@ -117,7 +115,7 @@ class Diglin_Username_Model_Observer extends Mage_Customer_Model_Observer
117
  'username',
118
  array(
119
  'header' => Mage::helper('username')->__('Username'),
120
- 'index' => 'username'
121
  ),
122
  'email'
123
  );
1
  <?php
2
+
3
  /**
4
+ * Diglin GmbH
5
  *
6
  * NOTICE OF LICENSE
7
  *
9
  * that is bundled with this package in the file LICENSE.txt.
10
  * It is also available through the world-wide-web at this URL:
11
  * http://opensource.org/licenses/osl-3.0.php
 
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
 
18
  class Diglin_Username_Model_Observer extends Mage_Customer_Model_Observer
19
  {
20
  /**
22
  *
23
  * Event: customer_customer_authenticated
24
  *
25
+ * @param Varien_Event_Observer $observer Observer
26
  * @throws Mage_Core_Exception
27
  */
28
  public function isActive($observer)
29
+ {
30
  $customer = $observer->getEvent()->getModel();
31
  // Add the inactive option
32
+ if ($customer->getIsActive() != '1') {
33
  throw new Mage_Core_Exception(Mage::helper('customer')->__('This account is disabled.'), 0);
34
  }
35
  }
39
  *
40
  * Event: eav_collection_abstract_load_before
41
  *
42
+ * @param Varien_Event_Observer $observer Observer
43
  */
44
+ public function addAttributeToCollection($observer)
45
  {
46
  /* @var $collection Mage_Eav_Model_Entity_Collection_Abstract */
47
  $collection = $observer->getEvent()->getCollection();
51
  }
52
 
53
  }
54
+
55
  /**
56
  * Change the attribute of username after the configuration
57
  * has been changed
58
  *
59
  * Event: admin_system_config_changed_section_username
60
  *
61
+ * @param Varien_Event_Observer $observer Observer
62
  */
63
+ public function changeEavAttribute(Varien_Event_Observer $observer)
64
  {
65
  $minLength = Mage::getStoreConfig('username/general/min_length');
66
  $maxLength = Mage::getStoreConfig('username/general/max_length');
67
  $inputValidation = Mage::getStoreConfig('username/general/input_validation');
68
 
69
+ if ($minLength > $maxLength) {
70
  Mage::throwException(
71
+ Mage::helper('username')->
72
+ __('Sorry but you cannot set a minimum length value %s bigger than the maximum length value %s. Please, change the values.',
73
+ $minLength,
74
+ $maxLength)
75
  );
76
  }
77
 
78
  /* @var $attributeUsernameModel Mage_Customer_Model_Attribute */
79
  $attributeUsernameModel = Mage::getModel('customer/attribute')->loadByCode('customer', 'username');
80
+ if ($attributeUsernameModel->getId()) {
81
+ $rules = $attributeUsernameModel->getValidateRules();
82
+ $rules['max_text_length'] = $maxLength;
83
+ $rules['min_text_length'] = $minLength;
84
+
85
+ if ($inputValidation != 'default' && $inputValidation != 'custom') {
86
+ $rules['input_validation'] = $inputValidation;
87
+ } else {
88
+ $rules['input_validation'] = '';
89
+ }
90
+
91
+ $attributeUsernameModel->setValidateRules($rules);
92
+ $attributeUsernameModel->save();
93
  }
94
  }
95
 
96
  /**
97
  * Event
98
+ * - core_block_abstract_to_html_before
99
  *
100
+ * @param Varien_Event_Observer $observer Observer
101
  */
102
  public function addUsernameColumn(Varien_Event_Observer $observer)
103
  {
115
  'username',
116
  array(
117
  'header' => Mage::helper('username')->__('Username'),
118
+ 'index' => 'username'
119
  ),
120
  'email'
121
  );
app/code/community/Diglin/Username/controllers/AccountController.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/controllers/Adminhtml/SyncController.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin GmbH
4
+ *
5
+ * @category Diglin
6
+ * @package Diglin_Username
7
+ * @author Sylvain Rayé <support@diglin.com>
8
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ */
11
+
12
+ /**
13
+ * Class Diglin_Username_Adminhtml_SyncController
14
+ */
15
+ class Diglin_Username_Adminhtml_SyncController extends Mage_Adminhtml_Controller_Action
16
+ {
17
+ /**
18
+ * Return acl synchronize singleton
19
+ *
20
+ * @return Diglin_Username_Model_Generate_Flag
21
+ */
22
+ protected function getSyncFlag()
23
+ {
24
+ return Mage::getSingleton('username/generate_flag')->loadSelf();
25
+ }
26
+
27
+ /**
28
+ * @todo to finish to implement by using flag and using Ajax response
29
+ */
30
+ public function generateAction()
31
+ {
32
+ session_write_close();
33
+
34
+ $flag = $this->getSyncFlag();
35
+ $flag
36
+ ->setState(Diglin_Username_Model_Generate_Flag::STATE_RUNNING)
37
+ ->save();
38
+
39
+ $flag->setFlagData(array());
40
+
41
+ try {
42
+ /* @var $eavConfig Mage_Eav_Model_Config */
43
+ $usernameAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'username');
44
+
45
+ $resource = Mage::getSingleton('core/resource');
46
+ $readConnection = $resource->getConnection('core_read');
47
+
48
+ $select = $readConnection
49
+ ->select()
50
+ ->from($resource->getTableName('customer_entity_varchar'), 'entity_id')
51
+ ->where('attribute_id = ?', $usernameAttribute->getId())
52
+ ->where('value IS NOT NULL');
53
+
54
+ $ids = $readConnection->fetchCol($select);
55
+
56
+ $select = $readConnection
57
+ ->select()
58
+ ->from(array('c' => $resource->getTableName('customer_entity')), array('email', 'entity_id', 'entity_type_id'))
59
+ ->group('c.entity_id');
60
+
61
+ if (!empty($ids)) {
62
+ $select
63
+ ->joinLeft(array('cev' => $resource->getTableName('customer_entity_varchar')), 'c.entity_id = cev.entity_id')
64
+ ->where('cev.entity_id NOT IN (' . implode(',', $ids) . ')');
65
+ }
66
+
67
+ // @todo - add support for Customer Website Share option (check that the username doesn't already exist in other websites)
68
+ // @todo - add support for username depending on the username type supported in the configuration (only letters, digits, etc)
69
+
70
+ // Create username for old customers to prevent problem when creating an order as a guest
71
+ $customers = $readConnection->fetchAll($select);
72
+ $totalItemsDone = 0;
73
+
74
+ $flagData['total_items'] = count($customers);
75
+ $flag->setFlagData($flagData)
76
+ ->save();
77
+
78
+ foreach ($customers as $customer) {
79
+ $customer['attribute_id'] = $usernameAttribute->getId();
80
+ $email = $customer['email'];
81
+ $pos = strpos($email, '@');
82
+ $customer['value'] = substr($email, 0, $pos) . substr(uniqid(), 0, 5) . $customer['entity_id'];
83
+
84
+ unset($customer['email']);
85
+ unset($customer['value_id']);
86
+
87
+ $readConnection->query('REPLACE INTO '
88
+ . $readConnection->getTableName('customer_entity_varchar')
89
+ . ' SET entity_id = :entity_id, entity_type_id = :entity_type_id, attribute_id = :attribute_id, value = :value',
90
+ $customer);
91
+
92
+ $flagData['total_items_done'] = $totalItemsDone;
93
+ $flag->setFlagData($flagData)
94
+ ->save();
95
+ }
96
+
97
+ } catch (Exception $e) {
98
+ Mage::logException($e);
99
+ $flag->setHasErrors(true);
100
+ }
101
+ $flag->setState(Diglin_Username_Model_Generate_Flag::STATE_FINISHED)->save();
102
+ }
103
+
104
+ /**
105
+ * Get status of the sync
106
+ */
107
+ public function syncstatusAction()
108
+ {
109
+ $flag = $this->getSyncFlag();
110
+ if ($flag) {
111
+ $state = $flag->getState();
112
+ $flagData = $flag->getFlagData();
113
+
114
+ switch ($state) {
115
+ case Diglin_Username_Model_Generate_Flag::STATE_RUNNING:
116
+ if ($flagData['total_items'] > 0) {
117
+ $percent = (int)($flagData['total_items_done'] * 100 / $flagData['total_items']) . '%';
118
+ $result['message'] = Mage::helper('username')->__('Generating username: %s done.', $percent);
119
+ } else {
120
+ $result ['message'] = Mage::helper('username')->__('Generating...');
121
+ }
122
+ break;
123
+ case Diglin_Username_Model_Generate_Flag::STATE_FINISHED:
124
+ Mage::dispatchEvent('add_username_generate_message');
125
+ $result ['message'] = Mage::helper('username')->__('Generation finished');
126
+
127
+ if ($flag->getHasErrors()) {
128
+ $result ['message'] .= Mage::helper('username')->__('Errors occurred while running. Please, check the log if enabled.');
129
+ $result ['has_errors'] = true;
130
+ }
131
+ $state = Diglin_Username_Model_Generate_Flag::STATE_NOTIFIED;
132
+ break;
133
+ case Diglin_Username_Model_Generate_Flag::STATE_NOTIFIED:
134
+ break;
135
+ default:
136
+ $state = Diglin_Username_Model_Generate_Flag::STATE_INACTIVE;
137
+ break;
138
+ }
139
+ } else {
140
+ $state = Diglin_Username_Model_Generate_Flag::STATE_INACTIVE;
141
+ }
142
+ $result['state'] = $state;
143
+
144
+ $result = Mage::helper('core')->jsonEncode($result);
145
+ Mage::app()->getResponse()->setBody($result);
146
+ }
147
+ }
app/code/community/Diglin/Username/data/username_setup/data-install-2.0.0.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,52 +8,15 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
21
  /* @var $installer Diglin_Username_Model_Entity_Setup */
22
  $installer = $this;
23
 
24
- /* @var $eavConfig Mage_Eav_Model_Config */
25
- $usernameAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'username');
26
-
27
- $installer->startSetup();
28
-
29
- $select = $installer->getConnection()->select()
30
- ->from($this->getTable('customer_entity_varchar'), 'entity_id')
31
- ->where('attribute_id = ?', $usernameAttribute->getId());
32
-
33
- $ids = $installer->getConnection()->fetchCol($select);
34
-
35
- $select = $installer->getConnection()->select()
36
- ->from(array('c' => $this->getTable('customer_entity')), array('email', 'entity_id', 'entity_type_id'));
37
-
38
- if (!empty($ids)) {
39
- $select->joinLeft(array('cev' => $this->getTable('customer_entity_varchar')), 'c.entity_id = cev.entity_id')
40
- ->where('cev.entity_id NOT IN ('. implode(',', $ids) . ')');
41
- }
42
-
43
- // @todo - add support for Customer Website Share option (check that the username doesn't already exist in other websites)
44
-
45
- // Create username for old customers to prevent problem when creating an order as a guest
46
- $customers = $installer->getConnection()->fetchAll($select);
47
- foreach ($customers as $customer) {
48
- $customer['attribute_id'] = $usernameAttribute->getId();
49
- $email = $customer['email'];
50
- $pos = strpos($email, '@');
51
- $customer['value'] = substr($email, 0, $pos) . substr(uniqid(), 0, 5) . $customer['entity_id'];
52
-
53
- unset($customer['email']);
54
- unset($customer['value_id']);
55
-
56
- $installer->getConnection()->insert($this->getTable('customer_entity_varchar'), $customer);
57
- }
58
-
59
- $installer->endSetup();
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
19
  /* @var $installer Diglin_Username_Model_Entity_Setup */
20
  $installer = $this;
21
 
22
+ // moved to admin controller
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Diglin/Username/etc/adminhtml.xml CHANGED
@@ -1,28 +1,13 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
- * Diglin
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Academic Free License (AFL 3.0)
9
- * that is bundled with this package in the file LICENSE_AFL.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/afl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * DISCLAIMER
17
- *
18
- * Do not edit or add to this file if you wish to upgrade Magento to newer
19
- * versions in the future. If you wish to customize Magento for your
20
- * needs please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category Diglin
23
  * @package Diglin_Username
24
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
25
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 
26
  */
27
  -->
28
  <config>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
+ * Diglin GmbH
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  *
6
  * @category Diglin
7
  * @package Diglin_Username
8
+ * @author Sylvain Rayé <support@diglin.com>
9
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
  */
12
  -->
13
  <config>
app/code/community/Diglin/Username/etc/config.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
- * Diglin
5
  *
6
  * NOTICE OF LICENSE
7
  *
@@ -9,26 +9,17 @@
9
  * that is bundled with this package in the file LICENSE_AFL.txt.
10
  * It is also available through the world-wide-web at this URL:
11
  * http://opensource.org/licenses/afl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * DISCLAIMER
17
- *
18
- * Do not edit or add to this file if you wish to upgrade Magento to newer
19
- * versions in the future. If you wish to customize Magento for your
20
- * needs please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category Diglin
23
  * @package Diglin_Username
24
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
25
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
  */
27
  -->
28
  <config>
29
  <modules>
30
  <Diglin_Username>
31
- <version>2.2.0</version>
32
  </Diglin_Username>
33
  </modules>
34
  <default>
@@ -193,6 +184,21 @@
193
  </events>
194
  </adminhtml>
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  <uninstall>
197
  <filename>uninstall.txt</filename>
198
  </uninstall>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
+ * Diglin GmbH
5
  *
6
  * NOTICE OF LICENSE
7
  *
9
  * that is bundled with this package in the file LICENSE_AFL.txt.
10
  * It is also available through the world-wide-web at this URL:
11
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
17
  */
18
  -->
19
  <config>
20
  <modules>
21
  <Diglin_Username>
22
+ <version>2.2.2</version>
23
  </Diglin_Username>
24
  </modules>
25
  <default>
184
  </events>
185
  </adminhtml>
186
 
187
+ <admin>
188
+ <routers>
189
+ <username>
190
+ <use>admin</use>
191
+ <args>
192
+ <module>Diglin_Username</module>
193
+ <frontName>username</frontName>
194
+ <modules>
195
+ <Diglin_Username before="Mage_Adminhtml">Diglin_Username_Adminhtml</Diglin_Username>
196
+ </modules>
197
+ </args>
198
+ </username>
199
+ </routers>
200
+ </admin>
201
+
202
  <uninstall>
203
  <filename>uninstall.txt</filename>
204
  </uninstall>
app/code/community/Diglin/Username/etc/system.xml CHANGED
@@ -1,28 +1,13 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
- * Diglin
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Academic Free License (AFL 3.0)
9
- * that is bundled with this package in the file LICENSE_AFL.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/afl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * DISCLAIMER
17
- *
18
- * Do not edit or add to this file if you wish to upgrade Magento to newer
19
- * versions in the future. If you wish to customize Magento for your
20
- * needs please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category Diglin
23
  * @package Diglin_Username
24
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
25
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 
26
  */
27
  -->
28
  <config>
@@ -32,7 +17,7 @@
32
  <sort_order>400</sort_order>
33
  </diglin>
34
  </tabs>
35
-
36
  <sections>
37
  <username translate="label" module="username">
38
  <label>Username</label>
@@ -52,91 +37,101 @@
52
  </hint>
53
  <general model="username" translate="label">
54
  <label>General configuration</label>
55
- <frontend_type>text</frontend_type>
56
- <sort_order>1</sort_order>
57
- <show_in_default>1</show_in_default>
58
- <show_in_website>1</show_in_website>
59
- <show_in_store>1</show_in_store>
60
- <fields>
61
- <enabled model="username" translate="label comment">
62
- <label>Enable Username Support</label>
63
- <frontend_type>select</frontend_type>
64
- <source_model>adminhtml/system_config_source_yesno</source_model>
65
- <sort_order>1</sort_order>
66
- <show_in_default>1</show_in_default>
67
- <show_in_website>1</show_in_website>
68
- <show_in_store>1</show_in_store>
69
- <comment><![CDATA[Enable username support in your store]]></comment>
70
- </enabled>
71
- <frontend model="username" translate="label comment">
72
- <label>Allow frontend edit</label>
73
- <frontend_type>select</frontend_type>
74
- <source_model>adminhtml/system_config_source_yesno</source_model>
75
- <sort_order>10</sort_order>
76
- <show_in_default>1</show_in_default>
77
- <show_in_website>1</show_in_website>
78
- <show_in_store>1</show_in_store>
79
- <comment><![CDATA[Allow the customer to edit his username in "My Account"]]></comment>
80
- </frontend>
81
- <grid model="username" translate="label comment">
82
- <label><![CDATA[Display username in "Manage Customers" Grid]]></label>
83
- <frontend_type>select</frontend_type>
84
- <source_model>adminhtml/system_config_source_yesno</source_model>
85
- <sort_order>20</sort_order>
86
- <show_in_default>1</show_in_default>
87
- <comment><![CDATA[Do you want to display the field 'Username' in the Manage Customer Grid?]]></comment>
88
- </grid>
89
- <max_length model="username" translate="label comment">
90
- <label>Maximum length of the username</label>
91
- <frontend_type>text</frontend_type>
92
- <sort_order>30</sort_order>
93
- <show_in_default>1</show_in_default>
94
- <comment><![CDATA[What is the maximum length of the string username that you want to accept? By default, it's 30 characters ]]></comment>
95
- </max_length>
96
- <min_length model="username" translate="label comment">
97
- <label>Minimum length of the username</label>
98
- <frontend_type>text</frontend_type>
99
- <sort_order>40</sort_order>
100
- <show_in_default>1</show_in_default>
101
- <comment><![CDATA[What is the minimum length of the string username that you want to accept? By default, it's 6 characters ]]></comment>
102
- </min_length>
103
- <input_validation model="username" translate="label comment">
104
- <label>Input Validation</label>
105
- <frontend_type>select</frontend_type>
106
- <source_model>username/config_source_inputvalidation</source_model>
107
- <sort_order>50</sort_order>
108
- <show_in_default>1</show_in_default>
109
- <comment><![CDATA[What kind of username do you want to accept? You can set the value 'Default' which accept letters, digits and the special characters '_-' ]]></comment>
110
- </input_validation>
111
- <input_validation_custom model="username" translate="label comment">
112
- <label>Custom Input Validation</label>
113
- <frontend_type>text</frontend_type>
114
- <sort_order>60</sort_order>
115
- <show_in_default>1</show_in_default>
116
- <comment><![CDATA[Provide here a PCRE regex. e.g. <strong>/^[\w-]*$/</strong>. More info at <a href="http://php.net/manual/en/reference.pcre.pattern.syntax.php">PHP Manual</a>]]></comment>
117
- <depends>
118
- <input_validation>custom</input_validation>
119
- </depends>
120
- </input_validation_custom>
121
- <input_validation_custom_message model="username" translate="label comment">
122
- <label>Custom Input Validation - Error Message</label>
123
- <frontend_type>text</frontend_type>
124
- <sort_order>70</sort_order>
125
- <show_in_default>1</show_in_default>
126
- <comment><![CDATA[Message to show to the user in case of error</a>]]></comment>
127
- <depends>
128
- <input_validation>custom</input_validation>
129
- </depends>
130
- </input_validation_custom_message>
131
- <case_sensitive model="username" translate="label comment">
132
- <label>Case Sensitive Username</label>
133
- <frontend_type>select</frontend_type>
134
- <source_model>adminhtml/system_config_source_yesno</source_model>
135
- <sort_order>80</sort_order>
136
- <show_in_default>1</show_in_default>
137
- <comment><![CDATA[Do you want to make the username case sensitive? If not case sensitive, the username will be saved in lowercase. The idea to save in lowercase is to not irritate the user in case he provides a wrong username case.]]></comment>
138
- </case_sensitive>
139
- </fields>
 
 
 
 
 
 
 
 
 
 
140
  </general>
141
  </groups>
142
  </username>
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
+ * Diglin GmbH
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  *
6
  * @category Diglin
7
  * @package Diglin_Username
8
+ * @author Sylvain Rayé <support@diglin.com>
9
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
  */
12
  -->
13
  <config>
17
  <sort_order>400</sort_order>
18
  </diglin>
19
  </tabs>
20
+
21
  <sections>
22
  <username translate="label" module="username">
23
  <label>Username</label>
37
  </hint>
38
  <general model="username" translate="label">
39
  <label>General configuration</label>
40
+ <frontend_type>text</frontend_type>
41
+ <sort_order>1</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ <fields>
46
+ <enabled model="username" translate="label comment">
47
+ <label>Enable Username Support</label>
48
+ <frontend_type>select</frontend_type>
49
+ <source_model>adminhtml/system_config_source_yesno</source_model>
50
+ <sort_order>1</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ <comment><![CDATA[Enable username support in your store]]></comment>
55
+ </enabled>
56
+ <frontend model="username" translate="label comment">
57
+ <label>Allow frontend edit</label>
58
+ <frontend_type>select</frontend_type>
59
+ <source_model>adminhtml/system_config_source_yesno</source_model>
60
+ <sort_order>10</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ <comment><![CDATA[Allow the customer to edit his username in "My Account"]]></comment>
65
+ </frontend>
66
+ <grid model="username" translate="label comment">
67
+ <label><![CDATA[Display username in "Manage Customers" Grid]]></label>
68
+ <frontend_type>select</frontend_type>
69
+ <source_model>adminhtml/system_config_source_yesno</source_model>
70
+ <sort_order>20</sort_order>
71
+ <show_in_default>1</show_in_default>
72
+ <comment><![CDATA[Do you want to display the field 'Username' in the Manage Customer Grid?]]></comment>
73
+ </grid>
74
+ <max_length model="username" translate="label comment">
75
+ <label>Maximum length of the username</label>
76
+ <frontend_type>text</frontend_type>
77
+ <sort_order>30</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <comment><![CDATA[What is the maximum length of the string username that you want to accept? By default, it's 30 characters ]]></comment>
80
+ </max_length>
81
+ <min_length model="username" translate="label comment">
82
+ <label>Minimum length of the username</label>
83
+ <frontend_type>text</frontend_type>
84
+ <sort_order>40</sort_order>
85
+ <show_in_default>1</show_in_default>
86
+ <comment><![CDATA[What is the minimum length of the string username that you want to accept? By default, it's 6 characters ]]></comment>
87
+ </min_length>
88
+ <input_validation model="username" translate="label comment">
89
+ <label>Input Validation</label>
90
+ <frontend_type>select</frontend_type>
91
+ <source_model>username/config_source_inputvalidation</source_model>
92
+ <sort_order>50</sort_order>
93
+ <show_in_default>1</show_in_default>
94
+ <comment><![CDATA[What kind of username do you want to accept? You can set the value 'Default' which accept letters, digits and the special characters '_-' ]]></comment>
95
+ </input_validation>
96
+ <input_validation_custom model="username" translate="label comment">
97
+ <label>Custom Input Validation</label>
98
+ <frontend_type>text</frontend_type>
99
+ <sort_order>60</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <comment><![CDATA[Provide here a PCRE regex. e.g. <strong>/^[\w-]*$/</strong>. More info at <a href="http://php.net/manual/en/reference.pcre.pattern.syntax.php">PHP Manual</a>]]></comment>
102
+ <depends>
103
+ <input_validation>custom</input_validation>
104
+ </depends>
105
+ </input_validation_custom>
106
+ <input_validation_custom_message model="username" translate="label comment">
107
+ <label>Custom Input Validation - Error Message</label>
108
+ <frontend_type>text</frontend_type>
109
+ <sort_order>70</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <comment><![CDATA[Message to show to the user in case of error</a>]]></comment>
112
+ <depends>
113
+ <input_validation>custom</input_validation>
114
+ </depends>
115
+ </input_validation_custom_message>
116
+ <case_sensitive model="username" translate="label comment">
117
+ <label>Case Sensitive Username</label>
118
+ <frontend_type>select</frontend_type>
119
+ <source_model>adminhtml/system_config_source_yesno</source_model>
120
+ <sort_order>80</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <comment><![CDATA[Do you want to make the username case sensitive? If not case sensitive, the username will be saved in lowercase. The idea to save in lowercase is to not irritate the user in case he provides a wrong username case.]]></comment>
123
+ </case_sensitive>
124
+ <generate>
125
+ <label>Generate username</label>
126
+ <comment><![CDATA[Generate a username for each customer who doesn't already have one.]]></comment>
127
+ <frontend_type>button</frontend_type>
128
+ <frontend_model>username/adminhtml_config_source_generate</frontend_model>
129
+ <sort_order>90</sort_order>
130
+ <show_in_default>1</show_in_default>
131
+ <show_in_website>0</show_in_website>
132
+ <show_in_store>0</show_in_store>
133
+ </generate>
134
+ </fields>
135
  </general>
136
  </groups>
137
  </username>
app/code/community/Diglin/Username/etc/uninstall.txt CHANGED
@@ -1,4 +1,5 @@
1
  app/code/community/Diglin/Username app/code/community/Diglin/Username
 
2
  app/design/frontend/base/default/layout/username.xml app/design/frontend/base/default/layout/username.xml
3
  app/design/frontend/base/default/template/username app/design/frontend/base/default/template/username
4
  app/etc/modules/Diglin_Username.xml app/etc/modules/Diglin_Username.xml
1
  app/code/community/Diglin/Username app/code/community/Diglin/Username
2
+ app/design/adminhtml/default/default/template/username app/design/adminhtml/default/default/template/username
3
  app/design/frontend/base/default/layout/username.xml app/design/frontend/base/default/layout/username.xml
4
  app/design/frontend/base/default/template/username app/design/frontend/base/default/template/username
5
  app/etc/modules/Diglin_Username.xml app/etc/modules/Diglin_Username.xml
app/code/community/Diglin/Username/sql/username_setup/install-2.0.0.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/sql/username_setup/mysql4-install-1.0.0.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.0.0-1.1.0.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.1.0-1.2.0.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.3.0-1.4.0.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.4.0-2.0.0.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  *
4
- * Diglin
5
  *
6
  * NOTICE OF LICENSE
7
  *
@@ -9,13 +9,11 @@
9
  * that is bundled with this package in the file LICENSE.txt.
10
  * It is also available through the world-wide-web at this URL:
11
  * http://opensource.org/licenses/osl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
  *
16
  * @category Diglin
17
  * @package Diglin_Username
18
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
19
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
20
  */
21
 
1
  <?php
2
  /**
3
  *
4
+ * Diglin GmbH
5
  *
6
  * NOTICE OF LICENSE
7
  *
9
  * that is bundled with this package in the file LICENSE.txt.
10
  * It is also available through the world-wide-web at this URL:
11
  * http://opensource.org/licenses/osl-3.0.php
12
+
 
 
13
  *
14
  * @category Diglin
15
  * @package Diglin_Username
16
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
17
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
18
  */
19
 
app/code/community/Diglin/Username/sql/username_setup/uninstall.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,13 +8,11 @@
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
  *
15
  * @category Diglin
16
  * @package Diglin_Username
17
- * @copyright Copyright (c) 2011-2014 Diglin (http://www.diglin.com)
18
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
19
  */
20
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
+
 
 
12
  *
13
  * @category Diglin
14
  * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
  * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
  */
18
 
app/code/community/Diglin/Username/sql/username_setup/upgrade-2.2.0-2.2.1.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin GmbH
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+
12
+ *
13
+ * @category Diglin
14
+ * @package Diglin_Username
15
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
16
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
+ */
18
+
19
+ /* @var $installer Diglin_Username_Model_Entity_Setup */
20
+ $installer = $this;
21
+
22
+ $installer->startSetup();
23
+
24
+ $installer->updateAttribute('customer', 'username', 'is_user_defined', 1);
25
+
26
+ $installer->endSetup();
app/code/community/Hackathon/MageTrashApp/Adminhtml/Block/System/Config/Form/Fieldset/Modules/MageTrashApp.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- class Hackathon_MageTrashApp_Adminhtml_Block_System_Config_Form_Fieldset_Modules_MageTrashApp
6
- extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
7
- {
8
- protected $_dummyElement;
9
- protected $_fieldRenderer;
10
- protected $_values;
11
-
12
-
13
- public function render(Varien_Data_Form_Element_Abstract $element)
14
- {
15
- $html = $this->_getHeaderHtml($element);
16
-
17
- $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
18
-
19
- $dispatchResult = new Varien_Object($modules);
20
- Mage::dispatchEvent(
21
- 'magetrashapp_system_config_magetrashapp_manage_extns_render_before',
22
- array('modules' => $dispatchResult)
23
- );
24
- $modules = $dispatchResult->toArray();
25
-
26
- sort($modules);
27
-
28
- foreach ($modules as $moduleName) {
29
- $moduleStatus = Mage::getConfig()->getModuleConfig($moduleName)->is('active', 'true');
30
-
31
- if ($moduleName==='Mage_Adminhtml' ||$moduleName==='Hackathon_MageTrashApp'
32
- || stripos($moduleName,'Mage_') !== false) {
33
- continue;
34
- }
35
- $html.= $this->_getFieldHtml($element, $moduleName,$moduleStatus);
36
- }
37
- $html .= $this->_getFooterHtml($element);
38
-
39
- return $html;
40
- }
41
-
42
- protected function _getDummyElement()
43
- {
44
- if (empty($this->_dummyElement)) {
45
- $this->_dummyElement = new Varien_Object(array('show_in_default'=>1, 'show_in_website'=>1));
46
- }
47
- return $this->_dummyElement;
48
- }
49
-
50
- protected function _getFieldRenderer()
51
- {
52
- if (empty($this->_fieldRenderer)) {
53
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
54
- }
55
- return $this->_fieldRenderer;
56
- }
57
-
58
-
59
-
60
- protected function _getValues()
61
- {
62
- if (empty($this->_values)) {
63
- $this->_values = array(
64
- array('label'=>Mage::helper('adminhtml')->__('Disabled'), 'value'=>0),
65
- array('label'=>Mage::helper('adminhtml')->__('Enabled'), 'value'=>1),
66
- array('label'=>Mage::helper('adminhtml')->__('Uninstall'), 'value'=>2),
67
- );
68
- }
69
- return $this->_values;
70
- }
71
-
72
-
73
- protected function _getFieldHtml($fieldset, $moduleName,$moduleStatus)
74
- {
75
-
76
- $e = $this->_getDummyElement();
77
-
78
- $field = $fieldset->addField($moduleName, 'select',
79
- array(
80
- 'name' => 'groups[manage_extns][fields]['.$moduleName.'][value]',
81
- 'label' => $moduleName,
82
- 'value' => (int)$moduleStatus,
83
- 'values' => $this->_getValues(),
84
- 'inherit' => true,
85
- 'can_use_default_value' => $this->getForm()->canUseDefaultValue($e),
86
- 'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e),
87
- ))->setRenderer($this->_getFieldRenderer());
88
-
89
- return $field->toHtml();
90
- }
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Block/Adminhtml/System/Config/Form/Fieldset/Modules/MageTrashApp.php DELETED
@@ -1,91 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- class Hackathon_MageTrashApp_Block_Adminhtml_System_Config_Form_Fieldset_Modules_MageTrashApp
6
- extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
7
- {
8
- protected $_dummyElement;
9
- protected $_fieldRenderer;
10
- protected $_values;
11
-
12
-
13
- public function render(Varien_Data_Form_Element_Abstract $element)
14
- {
15
- $html = $this->_getHeaderHtml($element);
16
-
17
- $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
18
-
19
- $dispatchResult = new Varien_Object($modules);
20
- Mage::dispatchEvent(
21
- 'magetrashapp_system_config_magetrashapp_manage_extns_render_before',
22
- array('modules' => $dispatchResult)
23
- );
24
- $modules = $dispatchResult->toArray();
25
-
26
- sort($modules);
27
-
28
- foreach ($modules as $moduleName) {
29
- $moduleStatus = Mage::getConfig()->getModuleConfig($moduleName)->is('active', 'true');
30
-
31
- if ($moduleName==='Mage_Adminhtml' ||$moduleName==='Hackathon_MageTrashApp'
32
- || stripos($moduleName,'Mage_') !== false) {
33
- continue;
34
- }
35
- $html.= $this->_getFieldHtml($element, $moduleName,$moduleStatus);
36
- }
37
- $html .= $this->_getFooterHtml($element);
38
-
39
- return $html;
40
- }
41
-
42
- protected function _getDummyElement()
43
- {
44
- if (empty($this->_dummyElement)) {
45
- $this->_dummyElement = new Varien_Object(array('show_in_default'=>1, 'show_in_website'=>1));
46
- }
47
- return $this->_dummyElement;
48
- }
49
-
50
- protected function _getFieldRenderer()
51
- {
52
- if (empty($this->_fieldRenderer)) {
53
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
54
- }
55
- return $this->_fieldRenderer;
56
- }
57
-
58
-
59
-
60
- protected function _getValues()
61
- {
62
- if (empty($this->_values)) {
63
- $this->_values = array(
64
- array('label'=>Mage::helper('adminhtml')->__('Disabled'), 'value'=>0),
65
- array('label'=>Mage::helper('adminhtml')->__('Enabled'), 'value'=>1),
66
- array('label'=>Mage::helper('adminhtml')->__('Uninstall'), 'value'=>2),
67
- );
68
- }
69
- return $this->_values;
70
- }
71
-
72
-
73
- protected function _getFieldHtml($fieldset, $moduleName,$moduleStatus)
74
- {
75
-
76
- $e = $this->_getDummyElement();
77
-
78
- $field = $fieldset->addField($moduleName, 'select',
79
- array(
80
- 'name' => 'groups[manage_extns][fields]['.$moduleName.'][value]',
81
- 'label' => $moduleName,
82
- 'value' => (int)$moduleStatus,
83
- 'values' => $this->_getValues(),
84
- 'inherit' => true,
85
- 'can_use_default_value' => $this->getForm()->canUseDefaultValue($e),
86
- 'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e),
87
- ))->setRenderer($this->_getFieldRenderer());
88
-
89
- return $field->toHtml();
90
- }
91
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Block/Adminhtml/System/Config/Form/Fieldset/Modules/Rewind.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
-
3
-
4
-
5
- class Hackathon_MageTrashApp_Block_Adminhtml_System_Config_Form_Fieldset_Modules_Rewind
6
- extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
7
- {
8
- protected $_dummyElement;
9
- protected $_fieldRenderer;
10
-
11
-
12
- public function render(Varien_Data_Form_Element_Abstract $element)
13
- {
14
- $html = $this->_getHeaderHtml($element);
15
-
16
- $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
17
-
18
- $dispatchResult = new Varien_Object($modules);
19
- Mage::dispatchEvent(
20
- 'magetrashapp_system_config_magetrashapp_manage_extns_render_before',
21
- array('modules' => $dispatchResult)
22
- );
23
- $modules = $dispatchResult->toArray();
24
-
25
- sort($modules);
26
-
27
- foreach ($modules as $moduleName) {
28
- if ($moduleName==='Mage_Adminhtml' || $moduleName==='Hackathon_MageTrashApp'
29
- || stripos($moduleName,'Mage_') !== false) {
30
- continue;
31
- }
32
-
33
- $resName = Mage::helper('magetrashapp')->getResourceName($moduleName);
34
- $number = Mage::getResourceSingleton('core/resource')->getDbVersion($resName);
35
- if (!$resName || $resName == $number) {
36
- continue;
37
- }
38
-
39
- $html.= $this->_getFieldHtml($element, $moduleName);
40
- }
41
- $html .= $this->_getFooterHtml($element);
42
- return $html;
43
- }
44
-
45
- protected function _getDummyElement()
46
- {
47
- if (empty($this->_dummyElement)) {
48
- $this->_dummyElement = new Varien_Object(array('show_in_default'=>1, 'show_in_website'=>1));
49
- }
50
- return $this->_dummyElement;
51
- }
52
-
53
- protected function _getFieldRenderer()
54
- {
55
- if (empty($this->_fieldRenderer)) {
56
- $this->_fieldRenderer = Mage::getBlockSingleton('adminhtml/system_config_form_field');
57
- }
58
- return $this->_fieldRenderer;
59
- }
60
-
61
- /**
62
- * @param $moduleName
63
- * @return array
64
- */
65
- protected function _getValues($moduleName)
66
- {
67
- $nameSpaceModule = str_replace('_', '/', $moduleName);
68
- $resName = Mage::helper('magetrashapp')->getResourceName($moduleName);
69
- $community = Mage::getBaseDir('code') . DS . 'community' . DS;
70
-
71
- $sqlScriptPath = $community . $nameSpaceModule . DS . 'sql' . DS . $resName . DS. '*.*';
72
-
73
- $valuesArray = array(
74
- array('label'=>Mage::helper('adminhtml')->__('Do nothing'), 'value'=>2),
75
- array('label'=>Mage::helper('adminhtml')->__('Delete core_resource'), 'value'=>0)
76
- );
77
-
78
- // Loop through all sql files and create a value for each
79
- foreach(glob($sqlScriptPath) as $filename){
80
- $filename = explode("-",basename($filename));
81
-
82
- foreach ($filename as $part) {
83
- if (strpos($part, ".php")) {
84
- $part = str_replace('.php', '', $part);
85
- $number = $part;
86
- }
87
- }
88
-
89
- $sqlVersionsArray[] = array('label'=>Mage::helper('adminhtml')->__(
90
- 'Rewind core_resource: ' . $number), 'value'=>'1_' . $number
91
- );
92
- }
93
-
94
- if (!empty($sqlVersionsArray)) {
95
- $valuesArray = array_merge($valuesArray, array_reverse($sqlVersionsArray));
96
- }
97
-
98
- return $valuesArray;
99
- }
100
-
101
-
102
- protected function _getFieldHtml($fieldset, $moduleName)
103
- {
104
-
105
- $e = $this->_getDummyElement();
106
-
107
- $field = $fieldset->addField($moduleName . '_Rewind', 'select',
108
- array(
109
- 'name' => 'groups[rewind_extns][fields]['.$moduleName.'][value]',
110
- 'label' => $moduleName,
111
- 'value' => 2,
112
- 'values' => $this->_getValues($moduleName),
113
- 'inherit' => true,
114
- 'can_use_default_value' => $this->getForm()->canUseDefaultValue($e),
115
- 'can_use_website_value' => $this->getForm()->canUseWebsiteValue($e),
116
- ))->setRenderer($this->_getFieldRenderer());
117
-
118
- return $field->toHtml();
119
- }
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Helper/Data.php DELETED
@@ -1,180 +0,0 @@
1
- <?php
2
- class Hackathon_MageTrashApp_Helper_Data extends Mage_Core_Helper_Abstract
3
- {
4
- const DISABLE = 0;
5
- const ENABLE = 1;
6
- const UNINSTALL = 2;
7
-
8
- const DELETE = 0;
9
- const REWIND = 1;
10
-
11
- public function uninstallModule($moduleName)
12
- {
13
- // deactivate the module
14
- $this->activateModule($moduleName,false);
15
-
16
- // Check the dependencies first and allow the rest of the process otherwise block it
17
- $dependencies = $this->checkDependencies($moduleName);
18
- if (count($dependencies) > 0) {
19
- Mage::throwException(
20
- $this->__('The module %s has dependencies with the module(s) %s. Please fix that before to remove this module.', $moduleName, implode(',', $dependencies))
21
- );
22
- return;
23
- }
24
-
25
- /* @var $uninstallModel Hackathon_MageTrashApp_Model_Uninstall */
26
- $uninstallModel = Mage::getModel('magetrashapp/uninstall');
27
-
28
- // We need to trigger SQL uninstall scripts
29
- Mage::dispatchEvent('magetrashapp_before_sql_uninstall');
30
- $uninstallModel->uninstallSqlCommand($moduleName);
31
- Mage::dispatchEvent('magetrashapp_after_sql_uninstall');
32
-
33
- // We need to remove all package files based on uninstall.txt file or modman file
34
- Mage::dispatchEvent('magetrashapp_before_package_uninstall');
35
- $uninstallModel->processUninstallPackage($moduleName);
36
- Mage::dispatchEvent('magetrashapp_after_package_uninstall');
37
- Mage::getSingleton('adminhtml/session')->addSuccess($moduleName.' has been uninstalled.');
38
-
39
- // Do the cleanup of the config here because we need the old config until this point
40
- Mage::app()->getStore()->resetConfig();
41
- }
42
-
43
- /**
44
- *
45
- * @param string $moduleName
46
- * @return boolean | array
47
- */
48
- protected function checkDependencies ($moduleName)
49
- {
50
- $moduleDepends = array();
51
- foreach (Mage::getConfig()->getNode('modules')->children() as $parentName => $module) {
52
- if ($parentName == $moduleName) {
53
- continue;
54
- }
55
-
56
- if ($module->depends) {
57
- foreach ($module->depends->children() as $name => $depend) {
58
- if ($name === $moduleName && (bool) Mage::getConfig()->getModuleConfig($moduleName)->is('active', 'true')) {
59
- $moduleDepends[] = $parentName;
60
- }
61
- }
62
- }
63
- }
64
-
65
- return $moduleDepends;
66
- }
67
-
68
- /**
69
- * Activate/Deactivate a Magento module
70
- *
71
- * @param string $name
72
- * @return string
73
- */
74
- public function activateModule($name,$activateFlag = true)
75
- {
76
- $isDeactivationPossible = true;
77
- if (count($this->checkDependencies($name)) > 0) {
78
- $isDeactivationPossible = false;
79
- }
80
-
81
-
82
- if ($isDeactivationPossible) {
83
- $status = '';
84
- $xmlPath = Mage::getBaseDir() . DS . 'app' . DS . 'etc' . DS . 'modules' . DS . $name .'.xml';
85
- if (file_exists($xmlPath)) {
86
- $xmlObj = new Varien_Simplexml_Config($xmlPath);
87
-
88
- $xmlObj->setNode(
89
- 'modules/'.$name.'/active',
90
- $activateFlag ? 'true' : 'false'
91
- );
92
-
93
- if (is_writable($xmlPath)) {
94
- $xmlData = $xmlObj->getNode()->asNiceXml();
95
- @file_put_contents($xmlPath, $xmlData);
96
- if ($activateFlag) {
97
- $status = $this->__('The module "%s" has been successfully activated.', $name);
98
- } else {
99
- $status = $this->__('The module "%s" has been successfully deactivated.', $name);
100
- }
101
- } else {
102
- $status = $this->__('File %s is not writable.', $xmlPath);
103
- }
104
- } else {
105
- $status = $this->__(
106
- 'Module %s is probably not installed. File %s does not exist.',
107
- $name,
108
- $xmlPath
109
- );
110
- }
111
- } else {
112
- $status = $this->__('Module can\'t be deactivated because it is a dependency of another module which is still active.');
113
- }
114
-
115
- return $status;
116
- }
117
-
118
- public function rrmdir($dir)
119
- {
120
- if (is_dir($dir)) {
121
- $objects = scandir($dir);
122
- foreach ($objects as $object) {
123
- if ($object != "." && $object != "..") {
124
- if (filetype($dir."/".$object) == "dir") $this->rrmdir($dir."/".$object); else unlink($dir."/".$object);
125
- }
126
- }
127
- reset($objects);
128
- rmdir($dir);
129
- }
130
- }
131
-
132
- /**
133
- * Delete Core Resource for specified module
134
- *
135
- * @param $moduleName
136
- */
137
- public function deleteCoreResource($moduleName)
138
- {
139
- $resName = $this->getResourceName($moduleName);
140
- $number = Mage::getResourceSingleton('core/resource')->getDbVersion($resName);
141
-
142
- Mage::getModel('magetrashapp/coreresource')->deleteCoreResource($moduleName, $resName, $number);
143
- }
144
-
145
- /**
146
- * Rewind Core Resource for specified module
147
- *
148
- * @param $moduleName
149
- * @param $number
150
- */
151
- public function rewindCoreResource ($moduleName, $number)
152
- {
153
- $resName = Mage::helper('magetrashapp')->getResourceName($moduleName);
154
-
155
- Mage::getModel('magetrashapp/coreresource')->rewindCoreResource($moduleName, $resName, $number);
156
- }
157
-
158
- /**
159
- * Get resource name from config.xml node
160
- *
161
- * @param $moduleName
162
- * @return mixed
163
- */
164
- public function getResourceName($moduleName) {
165
- $config = Mage::app()->getConfig();
166
- $xmlPath = $config->getModuleDir('etc', $moduleName) . DS . 'config.xml';
167
-
168
- if (file_exists($xmlPath)) {
169
- $xmlObj = new Varien_Simplexml_Config($xmlPath);
170
-
171
- $resourceNode = $xmlObj->getNode('global/resources');
172
- if ($resourceNode) {
173
- $resourceNode = $resourceNode->asArray();
174
- reset($resourceNode);
175
- $resName = key($resourceNode);
176
- return $resName;
177
- }
178
- }
179
- }
180
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Model/Adminhtml/Config/Data.php DELETED
@@ -1,173 +0,0 @@
1
- <?php
2
- /**
3
- * Created by JetBrains PhpStorm.
4
- * User: damian
5
- * Date: 12.01.13
6
- * Time: 15:31
7
- * To change this template use File | Settings | File Templates.
8
- */
9
- class Hackathon_MageTrashApp_Model_Adminhtml_Config_Data extends Mage_Adminhtml_Model_Config_Data {
10
-
11
- // need to edit save
12
-
13
- public function save()
14
- {
15
- $this->_validate();
16
- $this->_getScope();
17
-
18
- Mage::dispatchEvent('model_config_data_save_before', array('object' => $this));
19
-
20
- $section = $this->getSection();
21
- $website = $this->getWebsite();
22
- $store = $this->getStore();
23
- $groups = $this->getGroups();
24
- $scope = $this->getScope();
25
- $scopeId = $this->getScopeId();
26
-
27
- if (empty($groups)) {
28
- return $this;
29
- }
30
-
31
- $sections = Mage::getModel('adminhtml/config')->getSections();
32
- /* @var $sections Mage_Core_Model_Config_Element */
33
-
34
- $oldConfig = $this->_getConfig(true);
35
-
36
- $deleteTransaction = Mage::getModel('core/resource_transaction');
37
- /* @var $deleteTransaction Mage_Core_Model_Resource_Transaction */
38
- $saveTransaction = Mage::getModel('core/resource_transaction');
39
- /* @var $saveTransaction Mage_Core_Model_Resource_Transaction */
40
-
41
- // Extends for old config data
42
- $oldConfigAdditionalGroups = array();
43
-
44
- foreach ($groups as $group => $groupData) {
45
- /**
46
- * Map field names if they were cloned
47
- */
48
- $groupConfig = $sections->descend($section.'/groups/'.$group);
49
-
50
- if ($clonedFields = !empty($groupConfig->clone_fields)) {
51
- if ($groupConfig->clone_model) {
52
- $cloneModel = Mage::getModel((string)$groupConfig->clone_model);
53
- } else {
54
- Mage::throwException('Config form fieldset clone model required to be able to clone fields');
55
- }
56
- $mappedFields = array();
57
- $fieldsConfig = $sections->descend($section.'/groups/'.$group.'/fields');
58
-
59
- if ($fieldsConfig->hasChildren()) {
60
- foreach ($fieldsConfig->children() as $field => $node) {
61
- foreach ($cloneModel->getPrefixes() as $prefix) {
62
- $mappedFields[$prefix['field'].(string)$field] = (string)$field;
63
- }
64
- }
65
- }
66
- }
67
- // set value for group field entry by fieldname
68
- // use extra memory
69
- $fieldsetData = array();
70
- foreach ($groupData['fields'] as $field => $fieldData) {
71
- $fieldsetData[$field] = (is_array($fieldData) && isset($fieldData['value']))
72
- ? $fieldData['value'] : null;
73
- }
74
-
75
- foreach ($groupData['fields'] as $field => $fieldData) {
76
- $fieldConfig = $sections->descend($section . '/groups/' . $group . '/fields/' . $field);
77
- if (!$fieldConfig && $clonedFields && isset($mappedFields[$field])) {
78
- $fieldConfig = $sections->descend($section . '/groups/' . $group . '/fields/'
79
- . $mappedFields[$field]);
80
- }
81
- if (!$fieldConfig) {
82
- $node = $sections->xpath($section .'//' . $group . '[@type="group"]/fields/' . $field);
83
- if ($node) {
84
- $fieldConfig = $node[0];
85
- }
86
- }
87
-
88
- /**
89
- * Get field backend model
90
- */
91
- // HACKATHON START
92
- if ($fieldConfig) {
93
- $backendClass = $fieldConfig->backend_model;
94
- if (!$backendClass) {
95
- $backendClass = 'core/config_data';
96
- }
97
- } else {
98
- $backendClass = 'core/config_data';
99
- }
100
- // HACKATHON END
101
-
102
-
103
- /** @var $dataObject Mage_Core_Model_Config_Data */
104
- $dataObject = Mage::getModel($backendClass);
105
- if (!$dataObject instanceof Mage_Core_Model_Config_Data) {
106
- Mage::throwException('Invalid config field backend model: '.$backendClass);
107
- }
108
-
109
- $dataObject
110
- ->setField($field)
111
- ->setGroups($groups)
112
- ->setGroupId($group)
113
- ->setStoreCode($store)
114
- ->setWebsiteCode($website)
115
- ->setScope($scope)
116
- ->setScopeId($scopeId)
117
- ->setFieldConfig($fieldConfig)
118
- ->setFieldsetData($fieldsetData)
119
- ;
120
-
121
- if (!isset($fieldData['value'])) {
122
- $fieldData['value'] = null;
123
- }
124
-
125
- $path = $section . '/' . $group . '/' . $field;
126
-
127
- /**
128
- * Look for custom defined field path
129
- */
130
- if (is_object($fieldConfig)) {
131
- $configPath = (string)$fieldConfig->config_path;
132
- if (!empty($configPath) && strrpos($configPath, '/') > 0) {
133
- // Extend old data with specified section group
134
- $groupPath = substr($configPath, 0, strrpos($configPath, '/'));
135
- if (!isset($oldConfigAdditionalGroups[$groupPath])) {
136
- $oldConfig = $this->extendConfig($groupPath, true, $oldConfig);
137
- $oldConfigAdditionalGroups[$groupPath] = true;
138
- }
139
- $path = $configPath;
140
- }
141
- }
142
-
143
- $inherit = !empty($fieldData['inherit']);
144
-
145
- $dataObject->setPath($path)
146
- ->setValue($fieldData['value']);
147
-
148
- if (isset($oldConfig[$path])) {
149
- $dataObject->setConfigId($oldConfig[$path]['config_id']);
150
-
151
- /**
152
- * Delete config data if inherit
153
- */
154
- if (!$inherit) {
155
- $saveTransaction->addObject($dataObject);
156
- }
157
- else {
158
- $deleteTransaction->addObject($dataObject);
159
- }
160
- }
161
- elseif (!$inherit) {
162
- $dataObject->unsConfigId();
163
- $saveTransaction->addObject($dataObject);
164
- }
165
- }
166
- }
167
-
168
- $deleteTransaction->delete();
169
- $saveTransaction->save();
170
-
171
- return $this;
172
- }
173
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Model/CoreResource.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
-
3
- class Hackathon_MageTrashApp_Model_CoreResource extends Mage_Core_Model_Abstract{
4
-
5
- /**
6
- * Delete Core Resource for specified module
7
- *
8
- * @param $moduleName
9
- * @param $resName
10
- * @param $number
11
- */
12
- public function deleteCoreResource($moduleName, $resName, $number)
13
- {
14
- if (!$number) {
15
- Mage::getSingleton('adminhtml/session')->AddNotice('No CoreResource version found for:'. $moduleName);
16
- } else {
17
- Mage::register('isSecureArea', true);
18
- $resource = Mage::getResourceSingleton('magetrashapp/resource');
19
- $resource->deleteDbVersion($resName, $number);
20
- Mage::unregister('isSecureArea');
21
-
22
- if ($resource->getDbVersion($resName) == $resName) {
23
- Mage::getSingleton('adminhtml/session')->AddNotice('CoreResource Deleted for:'. $moduleName);
24
- }
25
- }
26
- }
27
-
28
- /**
29
- * Reset Core Resource to specified version
30
- *
31
- * @param $moduleName
32
- * @param $resName
33
- * @param $number
34
- */
35
- public function rewindCoreResource ($moduleName, $resName, $number)
36
- {
37
- Mage::register('isSecureArea', true);
38
- $resource = Mage::getResourceSingleton('core/resource');
39
- $resource->setDbVersion($resName, $number);
40
- Mage::unregister('isSecureArea');
41
-
42
- if ($resource->getDbVersion($resName) == $number) {
43
- Mage::getSingleton('adminhtml/session')->AddNotice($moduleName .
44
- ' CoreResource version rewound to: ' .$number);
45
- }
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Model/Observer.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- class Hackathon_MageTrashApp_Model_Observer extends Mage_Core_Model_Abstract {
3
-
4
- private $disableModules = array();
5
-
6
- public function saveConfig($observer) {
7
-
8
- $modules = array_keys((array)Mage::getConfig()->getNode('modules')->children());
9
-
10
- $dispatchResult = new Varien_Object($modules);
11
-
12
- $modules = $dispatchResult->toArray();
13
-
14
- foreach ($modules as $moduleName) {
15
- if ($moduleName==='Mage_Adminhtml' ||$moduleName==='Hackathon_MageTrashApp'
16
- || stripos($moduleName,'Mage_') !== false) {
17
- continue;
18
- }
19
-
20
- $configFlag = Mage::getStoreConfig('magetrashapp/manage_extns/' . $moduleName);
21
-
22
-
23
- switch ($configFlag) {
24
- case Hackathon_MageTrashApp_Helper_Data::ENABLE:
25
- Mage::helper('magetrashapp')->activateModule($moduleName);
26
- break;
27
- case Hackathon_MageTrashApp_Helper_Data::DISABLE:
28
- $this->disableModules[] = $moduleName;
29
- Mage::helper('magetrashapp')->activateModule($moduleName, false);
30
-
31
- break;
32
- case Hackathon_MageTrashApp_Helper_Data::UNINSTALL:
33
- Mage::helper('magetrashapp')->uninstallModule($moduleName);
34
- break;
35
- default:
36
- break;
37
-
38
- }
39
-
40
- $configFlag = Mage::getStoreConfig('magetrashapp/rewind_extns/' . $moduleName);
41
-
42
- if ($configFlag != 0) {
43
- $version = substr($configFlag, 2);
44
- $configFlag = $configFlag[0];
45
- } elseif (is_null($configFlag)) {
46
- continue;
47
- }
48
-
49
- switch ($configFlag) {
50
- case Hackathon_MageTrashApp_Helper_Data::DELETE:
51
- Mage::helper('magetrashapp')->deleteCoreResource($moduleName);
52
- break;
53
- case Hackathon_MageTrashApp_Helper_Data::REWIND:
54
- Mage::helper('magetrashapp')->rewindCoreResource($moduleName, $version);
55
- break;
56
- default:
57
- break;
58
-
59
- }
60
-
61
- }
62
-
63
-
64
- }
65
-
66
-
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Model/PearWrapper.php DELETED
@@ -1,245 +0,0 @@
1
- <?php
2
-
3
-
4
- class Hackathon_MageTrashApp_Model_PearWrapper extends Mage_Core_Model_Abstract
5
- {
6
- const DEFAULT_SCONFIG_FILENAME = 'cache.cfg';
7
-
8
- /**
9
- * Object of config
10
- *
11
- * @var Mage_Connect_Config
12
- */
13
- protected $_config;
14
-
15
- /**
16
- * Object of single config
17
- *
18
- * @var Mage_Connect_Singleconfig
19
- */
20
- protected $_sconfig;
21
-
22
- /**
23
- * Object of frontend
24
- *
25
- * @var Mage_Connect_Frontend
26
- */
27
- protected $_frontend;
28
-
29
- /**
30
- * Internal cache for command objects
31
- *
32
- * @var array
33
- */
34
- protected $_cmdCache = array();
35
-
36
- /**
37
- * Console Started flag
38
- *
39
- * @var boolean
40
- */
41
- protected $_consoleStarted = false;
42
-
43
- /**
44
- * Instance of class
45
- *
46
- * @var Maged_Connect
47
- */
48
- static protected $_instance;
49
-
50
- /**
51
- * Constructor loads Config, Cache Config and initializes Frontend
52
- */
53
- public function __construct()
54
- {
55
- $this->getConfig();
56
- $this->getSingleConfig();
57
- //$this->getFrontend();
58
- }
59
-
60
- /**
61
- * Destructor, sends Console footer if Console started
62
- */
63
- public function __destruct()
64
- {
65
- if ($this->_consoleStarted) {
66
- $this->_consoleFooter();
67
- }
68
- }
69
-
70
- /**
71
- * Initialize instance
72
- *
73
- * @return Maged_Connect
74
- */
75
- public static function getInstance()
76
- {
77
- if (!self::$_instance) {
78
- self::$_instance = new self;
79
- }
80
- return self::$_instance;
81
- }
82
-
83
- /**
84
- * Retrieve object of config and set it to Mage_Connect_Command
85
- *
86
- * @return Mage_Connect_Config
87
- */
88
- public function getConfig()
89
- {
90
- if (!$this->_config) {
91
- $this->_config = new Mage_Connect_Config();
92
- $ftp=$this->_config->__get('remote_config');
93
- if(!empty($ftp)){
94
- $packager = new Mage_Connect_Packager();
95
- list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp);
96
- $this->_config=$config;
97
- $this->_sconfig=$cache;
98
- }
99
- $this->_config->magento_root = dirname(dirname(__FILE__)).DS.'..';
100
- //Mage_Connect_Command::setConfigObject($this->_config);
101
- }
102
- return $this->_config;
103
- }
104
-
105
- /**
106
- * Retrieve object of single config and set it to Mage_Connect_Command
107
- *
108
- * @param bool $reload
109
- * @return Mage_Connect_Singleconfig
110
- */
111
- public function getSingleConfig($reload = false)
112
- {
113
- if(!$this->_sconfig || $reload) {
114
- $this->_sconfig = new Mage_Connect_Singleconfig(
115
-
116
- Mage::getModuleDir('etc','Hackathon_MageTrashApp').DIRECTORY_SEPARATOR
117
- . self::DEFAULT_SCONFIG_FILENAME
118
- );
119
- }
120
- Mage_Connect_Command::setSconfig($this->_sconfig);
121
- return $this->_sconfig;
122
-
123
- }
124
-
125
- /**
126
- * Retrieve object of frontend and set it to Mage_Connect_Command
127
- *
128
- * @return Maged_Connect_Frontend
129
- */
130
- public function getFrontend()
131
- {
132
- if (!$this->_frontend) {
133
- $this->_frontend = new Maged_Connect_Frontend();
134
- Mage_Connect_Command::setFrontendObject($this->_frontend);
135
- }
136
- return $this->_frontend;
137
- }
138
-
139
- /**
140
- * Retrieve lof from frontend
141
- *
142
- * @return array
143
- */
144
- public function getLog()
145
- {
146
- return $this->getFrontend()->getLog();
147
- }
148
-
149
- /**
150
- * Retrieve output from frontend
151
- *
152
- * @return array
153
- */
154
- public function getOutput()
155
- {
156
- return $this->getFrontend()->getOutput();
157
- }
158
-
159
- /**
160
- * Clean registry
161
- *
162
- * @return Maged_Connect
163
- */
164
- public function cleanSconfig()
165
- {
166
- $this->getSingleConfig()->clear();
167
- return $this;
168
- }
169
-
170
- /**
171
- * Delete directory recursively
172
- *
173
- * @param string $path
174
- * @return Maged_Connect
175
- */
176
- public function delTree($path) {
177
- if (@is_dir($path)) {
178
- $entries = @scandir($path);
179
- foreach ($entries as $entry) {
180
- if ($entry != '.' && $entry != '..') {
181
- $this->delTree($path.DS.$entry);
182
- }
183
- }
184
- @rmdir($path);
185
- } else {
186
- @unlink($path);
187
- }
188
- return $this;
189
- }
190
-
191
- /**
192
- * Run commands from Mage_Connect_Command
193
- *
194
- * @param string $command
195
- * @param array $options
196
- * @param array $params
197
- * @return boolean|Mage_Connect_Error
198
- */
199
- public function run($command, $options=array(), $params=array())
200
- {
201
- @set_time_limit(0);
202
- @ini_set('memory_limit', '256M');
203
-
204
- if (empty($this->_cmdCache[$command])) {
205
- Mage_Connect_Command::getCommands();
206
- /**
207
- * @var $cmd Mage_Connect_Command
208
- */
209
- $cmd = Mage_Connect_Command::getInstance($command);
210
- if ($cmd instanceof Mage_Connect_Error) {
211
- return $cmd;
212
- }
213
- $this->_cmdCache[$command] = $cmd;
214
- } else {
215
- /**
216
- * @var $cmd Mage_Connect_Command
217
- */
218
- $cmd = $this->_cmdCache[$command];
219
- }
220
- $ftp=$this->getConfig()->remote_config;
221
- if(strlen($ftp)>0){
222
- $options=array_merge($options, array('ftp'=>$ftp));
223
- }
224
- $cmd->run($command, $options, $params);
225
- if ($cmd->ui()->hasErrors()) {
226
- return false;
227
- } else {
228
- return true;
229
- }
230
- }
231
-
232
- /**
233
- * Set remote Config by URI
234
- *
235
- * @param $uri
236
- * @return Maged_Connect
237
- */
238
- public function setRemoteConfig($uri)
239
- {
240
- $this->getConfig()->remote_config=$uri;
241
- return $this;
242
- }
243
-
244
-
245
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Model/Resource/Resource.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- class Hackathon_MageTrashApp_Model_Resource_Resource extends Mage_Core_Model_Resource_Resource
4
- {
5
- /**
6
- * Delete core_resource entry
7
- *
8
- * @param $resName
9
- * @param $version
10
- * @return int
11
- */
12
- public function deleteDbVersion($resName, $version)
13
- {
14
- $dbModuleInfo = array(
15
- 'code' => $resName,
16
- 'version' => $version,
17
- );
18
-
19
- if ($this->getDbVersion($resName)) {
20
- self::$_versions[$resName] = $resName;
21
- return $this->_getWriteAdapter()->delete($this->getMainTable(),
22
- array('code = ?' => $resName));
23
- } else {
24
- self::$_versions[$resName] = $version;
25
- return $this->_getWriteAdapter()->insert($this->getMainTable(), $dbModuleInfo);
26
- }
27
- }
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Model/Resource/Setup.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
-
3
- class Hackathon_MageTrashApp_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
4
- {
5
-
6
- public function runUninstallSql($fileName,$resourceName) {
7
-
8
- Mage::getSingleton('adminhtml/session')->addNotice('Invoking uninstall file for resource'.$resourceName);
9
-
10
- $connection = Mage::getSingleton('core/resource')->getConnection($resourceName);
11
-
12
- $connection->disallowDdlCache();
13
-
14
- try {
15
- // run sql uninstall php
16
- $result = include $fileName;
17
- // remove core_resource
18
- if ($result) {
19
- Mage::getSingleton('adminhtml/session')->
20
- addNotice('Removing core resource '.$resourceName);
21
- $this->deleteTableRow('core/resource', 'code', $resourceName);
22
- }
23
-
24
- } catch (Exception $e) {
25
- $result = false;
26
- Mage::log($e);
27
- Mage::getSingleton('adminhtml/session')->
28
- addWarning('Running uninstall failed for resource '.$resourceName);
29
- }
30
-
31
- $connection->allowDdlCache();
32
-
33
- return $result;
34
-
35
- }
36
-
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Model/Uninstall.php DELETED
@@ -1,196 +0,0 @@
1
- <?php
2
-
3
- class Hackathon_MageTrashApp_Model_Uninstall extends Mage_Core_Model_Abstract
4
- {
5
- /**
6
- * Run the uninstall sql script to remove everything from module in database
7
- * This uninstall script must be provided by the extension provider
8
- *
9
- * @param $moduleName
10
- */
11
- public function uninstallSqlCommand ($moduleName)
12
- {
13
- Mage::getSingleton('adminhtml/session')->AddNotice('Running SQL Unininstall for Module:'.$moduleName);
14
-
15
- $result = false;
16
-
17
- $resources = Mage::getConfig()->getNode('global/resources')->children();
18
- foreach ($resources as $resName => $resource) {
19
- if (!$resource->setup) {
20
- continue;
21
- }
22
-
23
- if (isset($resource->setup->module)) {
24
- $testModName = (string)$resource->setup->module;
25
- if ($testModName==$moduleName) {
26
- $resourceName = $resName;
27
- }
28
- }
29
- }
30
-
31
- if (empty($resourceName)) {
32
- return $result;
33
- }
34
-
35
- $fileName = $this->_getUninstallSQLFile($moduleName,$resourceName);
36
-
37
- if (!is_null($fileName) ) {
38
-
39
- $resource = new Hackathon_MageTrashApp_Model_Resource_Setup($resourceName);
40
- $result = $resource->runUninstallSql($fileName,$resourceName);
41
-
42
- } else {
43
- Mage::getSingleton('adminhtml/session')->addNotice('Unable to find uninstall script for:'. $moduleName);
44
- }
45
-
46
- return $result;
47
-
48
- }
49
-
50
- /**
51
- * Gets the Uninstall file contents if present
52
- *
53
- * Lifted and modified from Mage_Core_Resource_Setup::_getAvailableDbFiles()
54
- *
55
- * @return bool
56
- */
57
- protected function _getUninstallSQLFile($moduleName,$resourceName) {
58
-
59
-
60
- $filesDir = Mage::getModuleDir('sql', $moduleName) . DS . $resourceName;
61
- if (!is_dir($filesDir) || !is_readable($filesDir)) {
62
- return null;
63
- }
64
-
65
- $uninstallFile = null;
66
- $regExpDb = sprintf('#^.*%s\.(php|sql)$#i', 'uninstall');
67
- $handlerDir = dir($filesDir);
68
- while (false !== ($file = $handlerDir->read())) {
69
- $matches = array();
70
- if (preg_match($regExpDb, $file, $matches)) {
71
- $uninstallFile = $filesDir . DS . $file;
72
- break;
73
- }
74
- }
75
- $handlerDir->close();
76
-
77
- return $uninstallFile;
78
- }
79
-
80
-
81
- /**
82
- * Options for uninstall are:
83
- * 1. Pear
84
- * 2. Using uninstall.sql and file as specified in config.xml
85
- * Format of the file must be modman???
86
- * @param $moduleName
87
- */
88
- public function processUninstallPackage($moduleName)
89
- {
90
- // if (!$this->processPearUninstall($moduleName)) {
91
- $this->processFileBasedUninstall($moduleName);
92
- // }
93
- }
94
-
95
- /**
96
- * Attempts to uninstall Pear
97
- *
98
- * @param $moduleName
99
- */
100
- protected function processPearUninstall($moduleName) {
101
- Mage::log("facebook foo");
102
- $command = 'uninstall';
103
- $params[] = 'community';
104
- $params[] = $moduleName;
105
- Mage_Connect_Command_Install::registerCommands(); // needed for init
106
- $pear = new Mage_Connect_Command_Install();
107
-
108
- // we need a config obj
109
-
110
- /* @var $config Hackathon_MageTrashApp_Model_PearWrapper */
111
- $config = Mage::getModel('magetrashapp/pearWrapper');
112
- $bla = $config->getConfig();
113
-
114
- /*$config = new Mage_Connect_Config();
115
- $ftp=$config->__get('remote_config');
116
- if(!empty($ftp)){
117
- $packager = new Mage_Connect_Packager();
118
- list($cache, $config, $ftpObj) = $packager->getRemoteConf($ftp);
119
- $config;
120
- }
121
- $config->magento_root = dirname(dirname(__FILE__)).DS.'..';DS.'..';
122
- */
123
-
124
- $pear->setConfigObject($bla);
125
-
126
- $result = $pear->doUninstall($command,array(),$params);
127
-
128
- $bla = 'dfdf';
129
-
130
- }
131
-
132
- /**
133
- * Attempts to uninstall Pear
134
- *
135
- * @param $moduleName
136
- */
137
- protected function processFileBasedUninstall($moduleName)
138
- {
139
- $magentoRoot = dirname(Mage::getRoot());
140
-
141
- $config = Mage::app()->getConfig();
142
- $configModule = $config->getModuleConfig($moduleName);
143
-
144
- /* @var $configFile Mage_Core_Model_Config_Base */
145
- $configFile = Mage::getModel('core/config_base');
146
-
147
- /* @var $helper Hackathon_MageTrashApp_Helper_Data */
148
- $helper = Mage::helper('magetrashapp');
149
-
150
- // if ($configModule->is('active', true)) {
151
- // Mage::throwException( $helper->__('The module %s must be disabled before to uninstall.', $moduleName));
152
- // return;
153
- // }
154
-
155
- $etc = $config->getModuleDir('etc', $moduleName) . DS . 'config.xml';
156
- $configFile->loadFile($etc);
157
-
158
- $element = $configFile->getNode('uninstall');
159
-
160
- if (!empty($element) && !$element->filename) {
161
- $filename = $element->filename;
162
- } else {
163
- $filename = 'uninstall.txt';
164
- }
165
-
166
- $uninstallFile = $config->getModuleDir('etc', $moduleName) . DS . $filename;
167
-
168
- if (file_exists($uninstallFile)) {
169
- $handle = fopen($uninstallFile, 'r');
170
- while ($line = fgets($handle)) {
171
- $line = preg_replace('/\s+/', '%%%', $line);
172
- $lines = explode('%%%', $line);
173
-
174
- if (count($lines) > 2) { // modman file format, we take the second argument because it should be the path of the target installation
175
- $pathsToDelete[] = $magentoRoot . DS . trim($lines[1], '/');
176
- } else {
177
- $pathsToDelete[] = $magentoRoot . DS . trim($lines[0], '/');
178
- }
179
- }
180
- if (!feof($handle)) {
181
- $helper->__('A problem occured while trying to get access to the uninstall file.');
182
- }
183
- fclose($handle);
184
-
185
- foreach ($pathsToDelete as $dest) {
186
- if(file_exists($dest) && (is_file($dest) || is_link($dest))) {
187
- unlink($dest);
188
- } else if (file_exists($dest)) {
189
- $helper->rrmdir($dest);
190
- }
191
- }
192
- return true;
193
- }
194
- return false;
195
- }
196
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Test/Config/Config.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- class Hackathon_MageTrashApp_Test_Config_Config extends EcomDev_PHPUnit_Test_Case_Config {
3
-
4
- public function testObserverAliasExist(){
5
- $this->assertModelAlias('magetrashapp/observer','Hackathon_MageTrashApp_Model_Observer');
6
- }
7
-
8
- }
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Test/Helper/DataTest.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
- require_once 'app/Mage.php';
3
- require_once 'app/code/community/Hackathon/MageTrashApp/Helper/Data.php';
4
- require_once 'PHPUnit/Framework/TestCase.php';
5
-
6
- /**
7
- * Hackthon_MageTrashApp_Helper_Data test case.
8
- */
9
- class DataTest extends PHPUnit_Framework_TestCase {
10
-
11
- /**
12
- *
13
- * @var Hackthon_MageTrashApp_Helper_Data
14
- */
15
- private $Hackthon_MageTrashApp_Helper_Data;
16
-
17
- /**
18
- * Prepares the environment before running a test.
19
- */
20
- protected function setUp() {
21
- parent::setUp ();
22
-
23
- // TODO Auto-generated DataTest::setUp()
24
-
25
- $this->Hackthon_MageTrashApp_Helper_Data = new Hackthon_MageTrashApp_Helper_Data(/* parameters */);
26
- }
27
-
28
- /**
29
- * Cleans up the environment after running a test.
30
- */
31
- protected function tearDown() {
32
- // TODO Auto-generated DataTest::tearDown()
33
- $this->Hackthon_MageTrashApp_Helper_Data = null;
34
-
35
- parent::tearDown ();
36
- }
37
-
38
- /**
39
- * Constructs the test case.
40
- */
41
- public function __construct() {
42
- // TODO Auto-generated constructor
43
- }
44
- }
45
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/Test/Model/Observer.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- class Hackathon_MageTrashApp_Test_Model_Observer extends EcomDev_PHPUnit_Test_Case_Config {
3
- /**
4
- * @var Hackathon_MageTrashApp_Model_Observer
5
- */
6
- protected $model = null;
7
-
8
- protected function setUp(){
9
- $this->model = Mage::getModel('magetrashapp/observer');
10
- }
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/controllers/Adminhtml/indexController.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- class Hackathon_MageTrashApp_Adminhtml_indexController extends Mage_Core_Controller_Front_Action
4
- {
5
- public function uninstallAction ()
6
- {
7
- $moduleName = $this->getRequest()->getParam('module_name');
8
-
9
- try {
10
- Mage::helper()->uninstallModule($moduleName);
11
- } catch (Exception $e) {
12
-
13
- }
14
- }
15
-
16
-
17
- public function activateModule ()
18
- {
19
-
20
- }
21
-
22
- public function deactivateModule ()
23
- {
24
-
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/etc/adminhtml.xml DELETED
@@ -1,22 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <acl>
4
- <resources>
5
- <admin>
6
- <children>
7
- <system>
8
- <children>
9
- <config>
10
- <children>
11
- <magetrashapp translate="title" module="trashapp">
12
- <title>Mage Trash App</title>
13
- </magetrashapp>
14
- </children>
15
- </config>
16
- </children>
17
- </system>
18
- </children>
19
- </admin>
20
- </resources>
21
- </acl>
22
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/etc/config.xml DELETED
@@ -1,85 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <phpunit>
4
- <suite>
5
- <modules>
6
- <Hackathon_MageTrashApp />
7
- </modules>
8
- </suite>
9
- </phpunit>
10
-
11
- <modules>
12
- <Hackathon_MageTrashApp>
13
- <version>1.0.0</version>
14
- </Hackathon_MageTrashApp>
15
- </modules>
16
-
17
- <global>
18
- <blocks>
19
- <magetrashapp>
20
- <class>Hackathon_MageTrashApp_Block</class>
21
- </magetrashapp>
22
- <magetrashapp_adminhtml>
23
- <class>Hackathon_MageTrashApp_Block_Adminhtml</class>
24
- </magetrashapp_adminhtml>
25
- </blocks>
26
- <helpers>
27
- <magetrashapp>
28
- <class>Hackathon_MageTrashApp_Helper</class>
29
- </magetrashapp>
30
- </helpers>
31
-
32
- <models>
33
- <magetrashapp>
34
- <class>Hackathon_MageTrashApp_Model</class>
35
- <resourceModel>magetrashapp_resource</resourceModel>
36
- </magetrashapp>
37
- <magetrashapp_resource>
38
- <class>Hackathon_MageTrashApp_Model_Resource</class>
39
- </magetrashapp_resource>
40
- <adminhtml>
41
- <rewrite>
42
- <config_data>Hackathon_MageTrashApp_Model_Adminhtml_Config_Data</config_data>
43
- </rewrite>
44
- </adminhtml>
45
- </models>
46
- <resources>
47
- <magetrashapp_resource>
48
- <setup>
49
- <module>Hackathon_MageTrashApp</module>
50
- </setup>
51
- <connection>
52
- <use>core_setup</use>
53
- </connection>
54
- </magetrashapp_resource>
55
- </resources>
56
- <events>
57
- <admin_system_config_changed_section_magetrashapp>
58
- <observers>
59
- <hackathon_magetrashapp>
60
- <class>Hackathon_MageTrashApp_Model_Observer</class>
61
- <method>saveConfig</method>
62
- </hackathon_magetrashapp>
63
- </observers>
64
- </admin_system_config_changed_section_magetrashapp>
65
- </events>
66
-
67
- </global>
68
-
69
- <admin>
70
- <routers>
71
- <subscription>
72
- <use>admin</use>
73
- <args>
74
- <module>Hackathon_MageTrashApp</module>
75
- <frontName>magetrashapp</frontName>
76
- </args>
77
- </subscription>
78
- </routers>
79
- </admin>
80
-
81
- <uninstall>
82
- <filename>uninstall.txt</filename>
83
- <!-- <path>.modman/Hackathon_MageTrashApp</path> -->
84
- </uninstall>
85
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/etc/doc.uninstall.txt DELETED
@@ -1,20 +0,0 @@
1
- Place a file uninstall.txt into the folder etc/ of your module to allow to be triggered by this module when you deinstall it.
2
- If you wish to change the name of this uninstall.txt file to something different, just set into the config.xml file of your module, the following:
3
- <config>
4
- ...
5
- <uninstall>
6
- <filename>myuninstallfile.txt</filename>
7
- </uninstall>
8
- </config>
9
-
10
- The format of the content should start from the Magento Root path. For example: you want to deinstall the module Namepspace_Mymodule placed into the community code pool
11
- Just do:
12
- app/code/community/Namespace/Mymodule
13
- app/etc/modules/Namespace_Mymodule.xml
14
- js/mynamespace/
15
- skin/frontend/base/default/images/mynapespace
16
-
17
- If you have modman, you could copy the file of modman into the etc folder. In this case, the second part of each line will be taken to uninstall your module.
18
- For example:
19
- src/app/code/community/Namespace/Mymodule app/code/community/Namespace/Mymodule
20
- src/app/etc/modules/Namespace_Mymodule.xml app/etc/modules/Namespace_Mymodule.xml
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Hackathon/MageTrashApp/etc/system.xml DELETED
@@ -1,35 +0,0 @@
1
- <?xml version="1.0"?>
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>
9
- <sort_order>999</sort_order>
10
- <show_in_default>1</show_in_default>
11
- <show_in_website>1</show_in_website>
12
- <show_in_store>1</show_in_store>
13
- <groups>
14
- <manage_extns>
15
- <label>Extensions Installed</label>
16
- <frontend_type>text</frontend_type>
17
- <frontend_model>magetrashapp_adminhtml/system_config_form_fieldset_modules_mageTrashApp</frontend_model>
18
- <sort_order>20</sort_order>
19
- <show_in_default>1</show_in_default>
20
- <show_in_website>1</show_in_website>
21
- <show_in_store>1</show_in_store>
22
- </manage_extns>
23
- <rewind_extns>
24
- <label>Rewind Extension</label>
25
- <frontend_type>text</frontend_type>
26
- <frontend_model>magetrashapp_adminhtml/system_config_form_fieldset_modules_rewind</frontend_model>
27
- <sort_order>30</sort_order>
28
- <show_in_default>1</show_in_default>
29
- <show_in_website>1</show_in_website>
30
- <show_in_store>1</show_in_store>
31
- </rewind_extns>
32
- </groups>
33
- </magetrashapp>
34
- </sections>
35
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/adminhtml/default/default/template/username/system/config/generate.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Diglin GmbH
4
+ *
5
+ * @category Diglin
6
+ * @package Diglin_Username
7
+ * @author Sylvain Rayé <support@diglin.com>
8
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
9
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
10
+ */
11
+
12
+ // @var $this Diglin_Username_Block_Adminhtml_Config_Source_Generate
13
+ ?>
14
+ <script type="text/javascript">
15
+ //<![CDATA[
16
+
17
+ function enableSyncButton() {
18
+ Form.Element.enable('generate_button');
19
+ $('generate_button').removeClassName('disabled');
20
+ }
21
+
22
+ function disableSyncButton() {
23
+ Form.Element.disable('generate_button');
24
+ $('generate_button').addClassName('disabled');
25
+ }
26
+
27
+ function checkStatus() {
28
+ u = new Ajax.PeriodicalUpdater('', '<?php echo $this->getAjaxStatusUpdateUrl() ?>', {
29
+ method: 'get',
30
+ frequency: 5,
31
+ loaderArea: false,
32
+
33
+ onSuccess: function(transport) {
34
+ var response;
35
+
36
+ try {
37
+ response = eval('(' + transport.responseText + ')');
38
+ if (response.state == '<?php echo Diglin_Username_Model_Generate_Flag::STATE_RUNNING ?>'
39
+ && response.message
40
+ ) {
41
+ if ($('sync_span').hasClassName('no-display')) {
42
+ $('sync_span').removeClassName('no-display');
43
+ }
44
+ $('sync_message_span').update(response.message);
45
+
46
+ } else {
47
+ u.stop();
48
+ //$('sync_span').addClassName('no-display');
49
+ $('generate_process_spinner').addClassName('no-display');
50
+
51
+ if (response.state == '<?php echo Diglin_Username_Model_Generate_Flag::STATE_NOTIFIED ?>') {
52
+ if (response.message) {
53
+ if ($('sync_span').hasClassName('no-display')) {
54
+ $('sync_span').removeClassName('no-display');
55
+ }
56
+ $('sync_message_span').update(response.message);
57
+ }
58
+ if (response.has_errors) {
59
+ enableSyncButton();
60
+ }
61
+ }
62
+ }
63
+ } catch (e) {
64
+ response = {};
65
+ }
66
+ }
67
+ });
68
+ }
69
+
70
+ function generate() {
71
+ params = {}
72
+
73
+ new Ajax.Request('<?php echo $this->getAjaxSyncUrl() ?>', {
74
+ parameters: params,
75
+ loaderArea: false,
76
+ asynchronous: true
77
+ });
78
+
79
+ window.setTimeout('checkStatus()', 2011);
80
+ disableSyncButton();
81
+ }
82
+ //]]>
83
+ </script>
84
+
85
+ <?php echo $this->getButtonHtml(); ?><span class="sync-indicator no-display" id="sync_span"><img id="generate_process_spinner" alt="<?php echo $this->__('Generate') ?>" style="margin:0 5px" src="<?php echo $this->getSkinUrl('images/process_spinner.gif') ?>"/><span id="sync_message_span"></span></span>
app/design/frontend/base/default/layout/username.xml CHANGED
@@ -1,28 +1,13 @@
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
- * Diglin
5
- *
6
- * NOTICE OF LICENSE
7
- *
8
- * This source file is subject to the Academic Free License (AFL 3.0)
9
- * that is bundled with this package in the file LICENSE_AFL.txt.
10
- * It is also available through the world-wide-web at this URL:
11
- * http://opensource.org/licenses/afl-3.0.php
12
- * If you did not receive a copy of the license and are unable to
13
- * obtain it through the world-wide-web, please send an email
14
- * to license@magentocommerce.com so we can send you a copy immediately.
15
- *
16
- * DISCLAIMER
17
- *
18
- * Do not edit or add to this file if you wish to upgrade Magento to newer
19
- * versions in the future. If you wish to customize Magento for your
20
- * needs please refer to http://www.magentocommerce.com for more information.
21
  *
22
  * @category Diglin
23
  * @package Diglin_Username
24
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
25
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
 
26
  */
27
  -->
28
  <layout version="2.0.0">
1
  <?xml version="1.0" encoding="UTF-8"?>
2
  <!--
3
  /**
4
+ * Diglin GmbH
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  *
6
  * @category Diglin
7
  * @package Diglin_Username
8
+ * @author Sylvain Rayé <support@diglin.com>
9
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
10
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
11
  */
12
  -->
13
  <layout version="2.0.0">
app/design/frontend/base/default/template/username/checkout/onepage/13/billing.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/checkout/onepage/17/billing.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/checkout/onepage/billing.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
 
app/design/frontend/base/default/template/username/checkout/onepage/login.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/customer/account/dashboard/info.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
 
app/design/frontend/base/default/template/username/customer/form/13/register.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
 
app/design/frontend/base/default/template/username/customer/form/17/register.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/customer/form/edit.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/customer/form/forgotpassword.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,22 +8,13 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  *
26
- * Diglin - change the strings to add 'Username' information
27
  */
28
  ?>
29
  <div class="page-title">
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  *
17
+ * Diglin GmbH - change the strings to add 'Username' information
18
  */
19
  ?>
20
  <div class="page-title">
app/design/frontend/base/default/template/username/customer/form/login.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/customer/form/register.phtml CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Diglin
4
  *
5
  * NOTICE OF LICENSE
6
  *
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category Diglin
22
  * @package Diglin_Username
23
- * @copyright Copyright (c) 2011 Diglin (http://www.diglin.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
 
1
  <?php
2
  /**
3
+ * Diglin GmbH
4
  *
5
  * NOTICE OF LICENSE
6
  *
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category Diglin
13
  * @package Diglin_Username
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
 
app/design/frontend/base/default/template/username/persistent/checkout/onepage/billing.phtml CHANGED
@@ -8,15 +8,6 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category design
22
  * @package base_default
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category design
13
  * @package base_default
app/design/frontend/base/default/template/username/persistent/checkout/onepage/login.phtml CHANGED
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category design
22
  * @package base_default
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category design
13
  * @package base_default
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/persistent/customer/form/login.phtml CHANGED
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category design
22
  * @package base_default
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category design
13
  * @package base_default
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/design/frontend/base/default/template/username/persistent/customer/form/register.phtml CHANGED
@@ -8,19 +8,10 @@
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
  *
21
  * @category design
22
  * @package base_default
23
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
8
  * that is bundled with this package in the file LICENSE_AFL.txt.
9
  * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/afl-3.0.php
 
 
 
 
 
 
 
 
 
11
  *
12
  * @category design
13
  * @package base_default
14
+ * @copyright Copyright (c) 2008-2015 Diglin GmbH - Switzerland (http://www.diglin.com)
15
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
16
  */
17
  ?>
app/etc/modules/Hackathon_MageTrashApp.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <modules>
4
- <Hackathon_MageTrashApp>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- </Hackathon_MageTrashApp>
8
- </modules>
9
- </config>
 
 
 
 
 
 
 
 
 
app/locale/en_GB/Diglin_Username.csv CHANGED
@@ -1,4 +1,5 @@
1
  "This account is disabled.","This account is disabled."
2
  "Username","Username"
3
  "Email Address/Username", "Email Address/Username"
4
- "'Email/Username:'","'Email/Username:'"
 
1
  "This account is disabled.","This account is disabled."
2
  "Username","Username"
3
  "Email Address/Username", "Email Address/Username"
4
+ "'Email/Username:'","'Email/Username:'"
5
+ "Username already exists","Username already exists"
app/locale/en_US/Diglin_Username.csv CHANGED
@@ -1,4 +1,5 @@
1
  "This account is disabled.","This account is disabled."
2
  "Username","Username"
3
  "Email Address/Username", "Email Address/Username"
4
- "'Email/Username:'","'Email/Username:'"
 
1
  "This account is disabled.","This account is disabled."
2
  "Username","Username"
3
  "Email Address/Username", "Email Address/Username"
4
+ "'Email/Username:'","'Email/Username:'"
5
+ "Username already exists","Username already exists"
package.xml CHANGED
@@ -1,56 +1,80 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Diglin_Username</name>
4
- <version>2.2.1</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>
8
  <extends/>
9
- <summary>Create and login to an account thanks to a username AND email address.&#xD;
10
  Allow to disable an account from backend. The user will be blocked if the option in the customer backend is set to no</summary>
11
- <description>## Features&#xD;
 
 
 
 
 
 
 
 
 
 
 
 
12
  &#xD;
13
- - Magento 1.3 to 1.8.1&#xD;
14
- - Login with a username and/or email, it can be done from frontend during checkout or getting access to the customer account&#xD;
15
- - Save a username from frontend (register account or checkout process) or from backend by editing a customer account&#xD;
16
- - Check that the username doesn't already exists&#xD;
17
- - Allow you to deactivate temporary customer account from Customer Management page (bonus functionality from version &gt; Magento 1.4.x). The user will be blocked if the option in the customer backend is set to no.&#xD;
18
- - The default templates override some customer and checkout views to adapt display for login pages, checkout process and account edition in frontend. If you have a customized template, please check the layout file username.xml and compare with your template to use or adapt to your situation.&#xD;
19
- - When you have already customers in your system and you do a first install of this plugin, a username will be generated for each customer based on a part of his email and a unique id. (e.g. email address is "developer@localhost.com" -&gt; username is "developer1235467")&#xD;
20
- - Configurable options to define what kind of username to support: only letters, only digits, both or default (digits, letters and special characters '-_')&#xD;
21
- - Configurable options to set the maximum and minium string length&#xD;
22
- - Display Username of each customer in the Customer Management Grid&#xD;
23
- - Allow or not the customer to edit the username in My Account in frontend&#xD;
24
- - Compatible and tested with Magento version &gt;=1.4.2 until 1.7.x&#xD;
25
- - support username when a customer wants to retrieve his forgotten password thanks to the "Forgotten Password" form&#xD;
26
- - support username into the template of the persistent module&#xD;
27
- - NEW - support Custom Regex validation (Select the Input validation 'custom' from the configuration page)&#xD;
28
- &#xD;
29
- Use MageTrashApp to uninstall this module correctly: https://github.com/magento-hackathon/MageTrashApp</description>
30
- <notes>- 2.2.1: fix input validation&#xD;
31
- - 2.2.0: support Magento 1.8 + custom input validation of username&#xD;
32
- - 2.0.7: update MageTrashApp, fix some bug in specific case during checkout process&#xD;
33
- - 2.0.5: remove test text&#xD;
34
- - 2.0.4: fix of "username exists" error message&#xD;
35
- - 2.0.3: fix bad Observer merge&#xD;
36
- - 2.0.1 / 2.0.2:&#xD;
37
- - Add composer, modman, MageTrashApp support to help installing and uninstalling this module&#xD;
38
- - Move template to design base package&#xD;
39
- - Fix several bugs like saving username from frontend, checkout process as guest, etc&#xD;
40
- - Follow best practices for module setup&#xD;
41
- - Version 1.5.0: update for Magento 1.7&#xD;
42
- - Version 1.4.0: fix a problem to enable and disable a customer account from Customer Management in backend&#xD;
43
- - 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 " _-)&#xD;
44
- - Version 1.2.1: fix customer account layout &#xD;
45
- - 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&#xD;
46
- - 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&#xD;
47
- - Version 1.0.2 - fix a bug with the installation&#xD;
48
- - 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&#xD;
49
- - Version 1.0.0 - stable version</notes>
50
- <authors><author><name>diglin</name><user>diglin</user><email>website@diglin.com</email></author></authors>
51
- <date>2014-02-10</date>
52
- <time>22:41:04</time>
53
- <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="Adminhtml"><dir name="Config"><dir name="Source"><file name="Hint.php" hash="0dc648be933060aa2399001829070b79"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="e830b16b7c7de00d5d93d246195a9551"/></dir><dir name="Model"><dir name="Config"><file name="Share.php" hash="e029c5424074d0ce28a2f2139a748dc3"/><dir name="Source"><file name="Inputvalidation.php" hash="6b9037b526f1ff976a07870143860291"/></dir></dir><file name="Customer.php" hash="960ea3f70df8e0cb4f495b2cf6d6e93e"/><dir name="Entity"><file name="Customer.php" hash="54627255257244df3b6103ec34a5d9cb"/><file name="Setup.php" hash="dad9545b28dd785f23ef59d48fdfec8a"/></dir><file name="Form.php" hash="6b90e7aa54a6f71e8a806a059fb277ae"/><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="aa85749489175a6d595618609ca6619b"/></dir></dir><file name="Observer.php" hash="d2922eead0f0485b18d700bda2cc34de"/></dir><dir name="controllers"><file name="AccountController.php" hash="a8ab01bd291f779d1b5700de9c24218c"/></dir><dir name="data"><dir name="username_setup"><file name="data-install-2.0.0.php" hash="b80e44774725d1805774b2145b7635f3"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="17c135749877ba875eb061c16c5b0a34"/><file name="config.xml" hash="20e844986975107ffb3ba29771c875d3"/><file name="system.xml" hash="90651edfbc736daa84f540e5afa40fff"/><file name="uninstall.txt" hash="70ce51e6ea76f07394760ca567cd6294"/></dir><dir name="sql"><dir name="username_setup"><file name="install-2.0.0.php" hash="cb1d129962d2776c70542363c846b810"/><file name="mysql4-install-1.0.0.php" hash="ca05dc1cbee01889f8c511f363082be2"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="f5cf8a2c6d900844d358f77e32d37131"/><file name="mysql4-upgrade-1.1.0-1.2.0.php" hash="7f38c7d1f56406b19a7c534c72840005"/><file name="mysql4-upgrade-1.3.0-1.4.0.php" hash="d077137a9fba3524bbcc8ec3076e010c"/><file name="mysql4-upgrade-1.4.0-2.0.0.php" hash="4a26c28b54d3d87aed21328d625223ef"/><file name="uninstall.php" hash="4b1c8bb67bc8bca38afd6e2f3b93d116"/></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><file name="CoreResource.php" hash="48faa17486cbdb58b5b58e26a892bc8a"/><file name="Observer.php" hash="4edb98984908198865fd9a73fe15ccab"/><file name="PearWrapper.php" hash="5bfc49da1c0c4b8801217e1ece28b7e9"/><dir name="Resource"><file name="Resource.php" hash="ba46996c23e6c17db231fcfd7eeee1cd"/><file name="Setup.php" hash="01c3a067fb830edd7c2783b9a9b2d2bb"/></dir><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="29e4e7211061fb73eeceb1a6dc510dad"/><file name="config.xml" hash="767b2cd648240b07c858ef7282827571"/><file name="doc.uninstall.txt" hash="b2de80f292016c5392b0edbc21ac29f1"/><file name="system.xml" hash="ca750acb4682fc8edea2f5aa451278a5"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="username"><dir><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="da260e1dcfaf0c1200e8149dee2cd9b9"/><file name="login.phtml" hash="456f485f5c5b34f42ab7b3d6b842a336"/></dir></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="762e44bffe4596658d674500cf3aa8cd"/></dir></dir><dir name="form"><dir name="13"><file name="register.phtml" hash="3bb3748061cf515d09ca8f3a0283326d"/></dir><dir name="17"><file name="register.phtml" hash="57fb12c734a0e7842da56d64ac93fe67"/></dir><file name="edit.phtml" hash="271a5b40a1371683ba64849c2cf8ce54"/><file name="forgotpassword.phtml" hash="a672db46aae548b939a64d32ffccd772"/><file name="login.phtml" hash="43ac5db68fef36ff156f7592f3eb34bf"/><file name="register.phtml" hash="2a74a300edcf780acb804b8cd25c393e"/></dir></dir><dir name="persistent"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="d65b0f7f56959385c5b6e6379479be1e"/><file name="login.phtml" hash="9c82c47edb76c8782a482c3a592eecc4"/></dir></dir><dir name="customer"><dir name="form"><file name="login.phtml" hash="cb6ada4391b79e57cf3b9f9b15425732"/><file name="register.phtml" hash="215b85f826cd94ce17cbff17199b1435"/></dir></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>
 
 
 
 
 
 
 
 
 
 
 
 
54
  <compatible/>
55
  <dependencies><required><php><min>5.2.9</min><max>6.0.0</max></php></required></dependencies>
56
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Diglin_Username</name>
4
+ <version>2.2.2</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>
8
  <extends/>
9
+ <summary>Create and login to an account thanks to a username AND email address.&amp;#xD;&#xD;
10
  Allow to disable an account from backend. The user will be blocked if the option in the customer backend is set to no</summary>
11
+ <description>This module allows you to:&amp;#xD;&#xD;
12
+ &amp;#xD;&#xD;
13
+ - login with a username or email address. it can be done from frontend during checkout or getting access to the customer account&amp;#xD;&#xD;
14
+ - Username can have letters, digits, '_-' but no other special characters&amp;#xD;&#xD;
15
+ - Username length is from 6 until 30 characters possible&amp;#xD;&#xD;
16
+ - save a username from frontend (register account or checkout process) or from backend by editing a customer account&amp;#xD;&#xD;
17
+ - check that the username doesn't already exists&amp;#xD;&#xD;
18
+ - deactivate temporary customer account from Customer Management page (bonus functionnality). The user will be blocked if the option in the customer backend is set to no.&amp;#xD;&#xD;
19
+ - The default template override some customer and checkout views to adapt display for login pages, checkout process and account edition in frontend. If you have a customized template, please check the layout file username.xml and compare with your template to use or adapt to your situation.&amp;#xD;&#xD;
20
+ &amp;#xD;&#xD;
21
+ Compatible Magento version &amp;gt;= 1.4.2 until 1.9.1</description>
22
+ <notes>Version 2.2.2&#xD;
23
+ - Fix issue with input validation (any kind of input was possible)&#xD;
24
  &#xD;
25
+ Version 2.0.*&#xD;
26
+ e694fcb Add custom input validation&#xD;
27
+ 85a0f51 Update translations&#xD;
28
+ 1ca6441 Update Copyright&#xD;
29
+ 799fc1b [FIX] prevent to save username when it's not allowed from configuration&#xD;
30
+ 55ab34e make the module compatible with MAgento 1.8, change copyright, move column logic for customer grid into observer&#xD;
31
+ 6c49218 Merge pull request #7 from gdhnz/master&#xD;
32
+ bad7445 Add permission "allow everything" to adminhtml.xml to resolve admin 404 for the extension config screen under CE 1.8&#xD;
33
+ fa712c7 Code factoring&#xD;
34
+ 6c603d8 fix comment typo&#xD;
35
+ 5f5fe14 change to version 2.0.7&#xD;
36
+ 41e58bb fix bad condition test in case of not found $customerId in Form.php. Use case, checkout process with already logged in customer.&#xD;
37
+ b8e71c7 add submodule MageTrashApp&#xD;
38
+ 757a3e2 Update README.md&#xD;
39
+ 48244a4 add version 2.0.6&#xD;
40
+ e9453ff generate correctly username for old customers while installing the module&#xD;
41
+ f422067 Fix to the controller forgotPassword&#xD;
42
+ fd71c66 change version to 2.0.5&#xD;
43
+ 67bf362 cleanup some test&#xD;
44
+ adc2bb5 add fix when customer information are saved from backend, add observer fix for collection (do not know yet if it resolved hte problem of a user who contacted me about grid &#xD;
45
+ 1c0c07f change version number&#xD;
46
+ 4ab072f fix bad merging&#xD;
47
+ cd2bb86 Update README.md&#xD;
48
+ fa3f821 Update composer.json&#xD;
49
+ d10136e add dependency suggestion&#xD;
50
+ ff053ba remove todo task&#xD;
51
+ b300aa0 Fix a problem with sql data install with empty select query&#xD;
52
+ 5b179b5 add uninstall process for module MageTrashApp&#xD;
53
+ ce428e9 add composer.json&#xD;
54
+ d93cc55 merge observer&#xD;
55
+ 29d4c21 add condition to test if attribute username model exists before to save the config&#xD;
56
+ 14acf45 Update README.md&#xD;
57
+ 21f72b7 add missing column for sales_flat_order table&#xD;
58
+ 612052d improve checkout process as a guest (no complain that username is a required field when you are a guest), fix issue with install data script&#xD;
59
+ aafb0be split template depending on the magento version, add missing template for use cases using persisten customer feature&#xD;
60
+ ce9245b Fix or improve form model while saving new customer data&#xD;
61
+ 42444f3 Improve test if shop owner change the account sharing options&#xD;
62
+ 4d10edb Improve Username Module: setup is now completly rewritten for Magento 1.7, add username for forgotten password, allow now to disable the feature from configuration page, ch&#xD;
63
+ c6b7250 add customer ID fix depending on the context&#xD;
64
+ 788e656 add optionable strtolower username&#xD;
65
+ 49cb18d add optionable strtolower username&#xD;
66
+ dff09e0 Add modman and instruction to use it&#xD;
67
+ 2d6b6c8 Merge pull request #1 from clst/master&#xD;
68
+ 1d143e9 fix: weird quote characters in german language file&#xD;
69
+ 9cbf4a2 add: can now update is_active for existing customers&#xD;
70
+ dfa9cc6 Fix some bug and add a way to import is_active attribute&#xD;
71
+ 60c7143 Update README.md&#xD;
72
+ 24afad2 add gitignore and license files&#xD;
73
+ </notes>
74
+ <authors><author><name>diglin</name><user>diglin</user><email>sly@diglin.com</email></author></authors>
75
+ <date>2015-05-12</date>
76
+ <time>22:43:20</time>
77
+ <contents><target name="magecommunity"><dir name="Diglin"><dir name="Username"><dir name="Block"><dir name="Adminhtml"><dir name="Config"><dir name="Source"><file name="Generate.php" hash="5438831326f98427b2eba37bc822c040"/><file name="Hint.php" hash="96ae0eb9fd067807896f13aa5f044346"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="791ae37f3f82b28340a8c2be1234dbe9"/></dir><dir name="Model"><dir name="Config"><file name="Share.php" hash="1b45228f4e4e48192c3944f00390065d"/><dir name="Source"><file name="Inputvalidation.php" hash="299ad9a1d6aba9514eeb379900305f40"/></dir></dir><file name="Customer.php" hash="7b03b83d61e3c7a9e0ff5467c72b748b"/><dir name="Entity"><file name="Customer.php" hash="6f27941b523fbe2749415316a304b6aa"/><file name="Setup.php" hash="2988ff6bd777fe5dcd10286c91c5a92a"/></dir><file name="Form.php" hash="6cf2c09144695ea8aa855cf95ea72e03"/><dir name="Generate"><file name="Flag.php" hash="f1132a46a4a5496769ac9019a90f4847"/></dir><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="8d116fe49dabdaf65c07e17ca31d6b7f"/></dir></dir><file name="Observer.php" hash="00b256411ff548db84ecb084388e28eb"/></dir><dir name="controllers"><file name="AccountController.php" hash="e6e78d271668d3c9650c4c3fd9f0f577"/><dir name="Adminhtml"><file name="SyncController.php" hash="8054f8a5f9b8470bb174867ffc2ab55a"/></dir></dir><dir name="data"><dir name="username_setup"><file name="data-install-2.0.0.php" hash="8494a84bae1af4a68829c315be517676"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="f9d21d4e64496e21dd35a9e9b20928a3"/><file name="config.xml" hash="14f4ea6cdca46b0776455579d50f9f9f"/><file name="system.xml" hash="732af4b70033a30012b8806888872450"/><file name="uninstall.txt" hash="4df056a32b360aea886be50f41e6756a"/></dir><dir name="sql"><dir name="username_setup"><file name="install-2.0.0.php" hash="3c2c5990ffcd3ed961d4aa7e937e802b"/><file name="mysql4-install-1.0.0.php" hash="c537ec7c53055b31c16f3f11f6319466"/><file name="mysql4-upgrade-1.0.0-1.1.0.php" hash="2aefd1b6a93e657aa1b41237ee6abf60"/><file name="mysql4-upgrade-1.1.0-1.2.0.php" hash="f310b67e2261057c00a30abb8f317720"/><file name="mysql4-upgrade-1.3.0-1.4.0.php" hash="cda7316bb85268e7dd0f31575b6acbe9"/><file name="mysql4-upgrade-1.4.0-2.0.0.php" hash="3377040e0d0ab53d72ca3194eedaa480"/><file name="uninstall.php" hash="7abbfcecdafe1cdb8c0d1e7a3b34cd7c"/><file name="upgrade-2.2.0-2.2.1.php" hash="0845008f1adc4241dd5afd7009353d31"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Diglin_Username.xml" hash="79603fae3def6dd098d4be51897e1ec6"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="username"><dir name="system"><dir name="config"><file name="generate.phtml" hash="a957b485487086b54ee200847cfd7033"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="username.xml" hash="dd930f6ce80905dffa3abdfe6e063534"/></dir><dir name="template"><dir name="username"><dir name="checkout"><dir name="onepage"><dir name="13"><file name="billing.phtml" hash="1c61a77c1220d12089afdaa190ea1f60"/></dir><dir name="17"><file name="billing.phtml" hash="f300428362fc60f1d497a683932ce2ef"/></dir><file name="billing.phtml" hash="b6ba7ad91fe9a771e7b96a63e73bf62b"/><file name="login.phtml" hash="c4358a929f03bd1183c3680cb77bade7"/></dir></dir><dir name="customer"><dir name="account"><dir name="dashboard"><file name="info.phtml" hash="518c8b40a8136f5ff1628af8ec9256a5"/></dir></dir><dir name="form"><dir name="13"><file name="register.phtml" hash="7b11d52277924851ebdcde0486659a31"/></dir><dir name="17"><file name="register.phtml" hash="8b6a62347a1185d2907fa452981a13d0"/></dir><file name="edit.phtml" hash="dcaac12c0dad4721414df15a7d3c9670"/><file name="forgotpassword.phtml" hash="8d77df979ff2b2ce2aba40575b8b9934"/><file name="login.phtml" hash="6b3e9264779efcfad98640cb561abcf2"/><file name="register.phtml" hash="55cf179850823cd1bc616a55ee8e5c3d"/></dir></dir><dir name="persistent"><dir name="checkout"><dir name="onepage"><file name="billing.phtml" hash="9a5f09956941185fa15ada3091fa77aa"/><file name="login.phtml" hash="8b192aa73817356215b05929a1bf47d1"/></dir></dir><dir name="customer"><dir name="form"><file name="login.phtml" hash="6c7e82dfd0ded5c7121d0c8fb103af22"/><file name="register.phtml" hash="1d2f93da259e846599ccff1434621f20"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Diglin_Username.csv" hash="7a0aa81dbdafe2ef121a08cd03c64893"/></dir><dir name="en_GB"><file name="Diglin_Username.csv" hash="96cb410646498ef5f423dfff746e7370"/></dir><dir name="en_US"><file name="Diglin_Username.csv" hash="96cb410646498ef5f423dfff746e7370"/></dir><dir name="fr_FR"><file name="Diglin_Username.csv" hash="d8d025c852649fc8e9edd2aed5ab377a"/></dir></target></contents>
78
  <compatible/>
79
  <dependencies><required><php><min>5.2.9</min><max>6.0.0</max></php></required></dependencies>
80
  </package>