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
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
- app/code/community/Diglin/Username/Block/Adminhtml/Config/Source/Generate.php +85 -0
- app/code/community/Diglin/Username/Block/Adminhtml/Config/Source/Hint.php +8 -7
- app/code/community/Diglin/Username/Helper/Data.php +3 -5
- app/code/community/Diglin/Username/Model/Config/Share.php +3 -5
- app/code/community/Diglin/Username/Model/Config/Source/Inputvalidation.php +3 -5
- app/code/community/Diglin/Username/Model/Customer.php +3 -5
- app/code/community/Diglin/Username/Model/Entity/Customer.php +3 -5
- app/code/community/Diglin/Username/Model/Entity/Setup.php +4 -5
- app/code/community/Diglin/Username/Model/Form.php +50 -32
- app/code/community/Diglin/Username/Model/Generate/Flag.php +62 -0
- app/code/community/Diglin/Username/Model/Import/Entity/Customer.php +3 -5
- app/code/community/Diglin/Username/Model/Observer.php +32 -34
- app/code/community/Diglin/Username/controllers/AccountController.php +3 -5
- app/code/community/Diglin/Username/controllers/Adminhtml/SyncController.php +147 -0
- app/code/community/Diglin/Username/data/username_setup/data-install-2.0.0.php +4 -41
- app/code/community/Diglin/Username/etc/adminhtml.xml +4 -19
- app/code/community/Diglin/Username/etc/config.xml +18 -12
- app/code/community/Diglin/Username/etc/system.xml +100 -105
- app/code/community/Diglin/Username/etc/uninstall.txt +1 -0
- app/code/community/Diglin/Username/sql/username_setup/install-2.0.0.php +3 -5
- app/code/community/Diglin/Username/sql/username_setup/mysql4-install-1.0.0.php +3 -5
- app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.0.0-1.1.0.php +3 -5
- app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.1.0-1.2.0.php +3 -5
- app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.3.0-1.4.0.php +3 -5
- app/code/community/Diglin/Username/sql/username_setup/mysql4-upgrade-1.4.0-2.0.0.php +3 -5
- app/code/community/Diglin/Username/sql/username_setup/uninstall.php +3 -5
- app/code/community/Diglin/Username/sql/username_setup/upgrade-2.2.0-2.2.1.php +26 -0
- app/code/community/Hackathon/MageTrashApp/Adminhtml/Block/System/Config/Form/Fieldset/Modules/MageTrashApp.php +0 -91
- app/code/community/Hackathon/MageTrashApp/Block/Adminhtml/System/Config/Form/Fieldset/Modules/MageTrashApp.php +0 -91
- app/code/community/Hackathon/MageTrashApp/Block/Adminhtml/System/Config/Form/Fieldset/Modules/Rewind.php +0 -120
- app/code/community/Hackathon/MageTrashApp/Helper/Data.php +0 -180
- app/code/community/Hackathon/MageTrashApp/Model/Adminhtml/Config/Data.php +0 -173
- app/code/community/Hackathon/MageTrashApp/Model/CoreResource.php +0 -47
- app/code/community/Hackathon/MageTrashApp/Model/Observer.php +0 -67
- app/code/community/Hackathon/MageTrashApp/Model/PearWrapper.php +0 -245
- app/code/community/Hackathon/MageTrashApp/Model/Resource/Resource.php +0 -28
- app/code/community/Hackathon/MageTrashApp/Model/Resource/Setup.php +0 -37
- app/code/community/Hackathon/MageTrashApp/Model/Uninstall.php +0 -196
- app/code/community/Hackathon/MageTrashApp/Test/Config/Config.php +0 -8
- app/code/community/Hackathon/MageTrashApp/Test/Helper/DataTest.php +0 -45
- app/code/community/Hackathon/MageTrashApp/Test/Model/Observer.php +0 -12
- app/code/community/Hackathon/MageTrashApp/controllers/Adminhtml/indexController.php +0 -26
- app/code/community/Hackathon/MageTrashApp/etc/adminhtml.xml +0 -22
- app/code/community/Hackathon/MageTrashApp/etc/config.xml +0 -85
- app/code/community/Hackathon/MageTrashApp/etc/doc.uninstall.txt +0 -20
- app/code/community/Hackathon/MageTrashApp/etc/system.xml +0 -35
- app/design/adminhtml/default/default/template/username/system/config/generate.phtml +85 -0
- app/design/frontend/base/default/layout/username.xml +4 -19
- app/design/frontend/base/default/template/username/checkout/onepage/13/billing.phtml +2 -11
- app/design/frontend/base/default/template/username/checkout/onepage/17/billing.phtml +2 -11
- app/design/frontend/base/default/template/username/checkout/onepage/billing.phtml +2 -11
- app/design/frontend/base/default/template/username/checkout/onepage/login.phtml +2 -11
- app/design/frontend/base/default/template/username/customer/account/dashboard/info.phtml +2 -11
- app/design/frontend/base/default/template/username/customer/form/13/register.phtml +2 -11
- app/design/frontend/base/default/template/username/customer/form/17/register.phtml +2 -11
- app/design/frontend/base/default/template/username/customer/form/edit.phtml +2 -11
- app/design/frontend/base/default/template/username/customer/form/forgotpassword.phtml +3 -12
- app/design/frontend/base/default/template/username/customer/form/login.phtml +2 -11
- app/design/frontend/base/default/template/username/customer/form/register.phtml +2 -11
- app/design/frontend/base/default/template/username/persistent/checkout/onepage/billing.phtml +0 -9
- app/design/frontend/base/default/template/username/persistent/checkout/onepage/login.phtml +1 -10
- app/design/frontend/base/default/template/username/persistent/customer/form/login.phtml +1 -10
- app/design/frontend/base/default/template/username/persistent/customer/form/register.phtml +1 -10
- app/etc/modules/Hackathon_MageTrashApp.xml +0 -9
- app/locale/en_GB/Diglin_Username.csv +2 -1
- app/locale/en_US/Diglin_Username.csv +2 -1
- package.xml +68 -44
@@ -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 |
+
}
|
@@ -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 |
-
|
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)
|
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 |
-
$
|
33 |
-
|
|
|
|
|
|
|
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,iVBORw0KGgoAAAANSUhEUgAAALoAAAA7CAYAAADM4pCMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADOlJREFUeNrsnV2MG1cVx++MvZs0a+9OygtI0PoBiYKAuKpUCALWI6GqpaLZvESiLY2tSlRFiK6jpg/9wLsBhdKIetPSDyIhOy0tbQR0UwVV8NB1kCDQoNahEWp5Mn2AipdOILE935wzc8Z7dzqz692d/fDu/Wuvxh7Pt3/3zP+eudfLmJCQkJCQkJCQkJCQkJCQkJBQ8pJWstIDjWre7Op5o9vNGZ12wzTMZv1gVROXU2hLgP7wuWeLlmVWTABc73SYgaWLpcv0bnfW1PXyqw/8siUuq9DAgg6Q1yzTLHpgA+Ae6AA4FlOHqaEzQ9c1wzDU14+caYpLKzRwoD907tmqbRqTC6J4x4ecAGcmTHVvamg6wH6+elbALjQ4oD/4x6cKtmXNBYD7sAPgGMUJcJxCJPemumnCa1ODqfruifMCdqFNIXmpBcB3H9TbbQAcShsgb1NE133Y9a4fyXV8DbD7xVQMw6qIyyu0WZReagGwJxMmNjYDy6KTVfGi+Hw0B7iZAdHcj+gWcxy38MLfflCATWh3fP6RTRHZM3v3zkXMLl8+d07cebY96J22glZF7/oRPAy4X3zAEXbTRMgZc2wZAW8A7HNQypsE9kLEPGUTVMAiTA6G50MFVAWi62Rd9F6GZd6uBFHd8+QAercX0X3IbUtmtp5u0CZyUBD2vLjcscpRJQwXoXUDvd1p6gHcPT+OgOsAOERx3exB7iLkpsycbrrpGqkywF2jL1ERsAttbtC7nUY4kvugmxTN5+2KBZDbCLkpq9WjX69KkluEwlsEAbvQ5gQdwD4ODVKtl1npQU6e3ELIJWYbKeZ0hgDytPrEozdXZYBcZq63A3jNCHgBu9DmBP3Vwy+2AO5y4Mf9RidFcssGu+JDbgPkjpFSn37sawS50wMcpx70/nsBu9Dmy7qgXj9ypn7joXEA3KrRAyFm2Q5ALjPLkL1I7pgp9cTjapUxt+i6LnMliWEM914zCQBn9B6KxBSYzL349hH19s99P7FsTGbv3jw14sYjsiln+9zGVMTs+uVz51p9ZE7GqU0S3m8T1p9dg0xNeF8N2E+jj2uUp3XHQx9jx7wL/WxnS4KOeuPxs/Xrvn0jRvSajZDbsh/J2z7ktePjVYC66CDWPOTea4LdhzwAHkGEisHUhACvLpGp6DeLEfWgC7/0Vsy+J2kdZbH9wnK4fjlB4A/GnFMj5vrg8hMRlSMsXKayBse7ua0Lr3dOvFEHyEsOQG7pKWZdGW7aRlp97omvVMGaFNGapCRGVsW3LrLk+LaF0esFNoYVXr44nU8gsr3FNiAdB/uuUQXrJxePgL1Cx7uexzhH12eyD8ijjre27UBHvffchbrdTZesyzualp5WX3zySwQ5B7EHMlsANX4usaACOPOVgbkTq/gSEe4N+SJg3wj4SqCt0XGvl1a7ryKd6/awLrz+/evzdfStv3/3gRp6cjQjkkt2RfJtCtoW7DMWWBfHnf9M4myNb2RWrDjI8baLt9xL3Lw9dFtOAvICRciVqhJlMTaxJuGcjy/VTtlyoKN8yP2I5nWBlDy8AWDy5OTTg3l+Y9SvAAt9PBtLsDEWNBxLMeu4CV23gzHzsXJNB31nYH8TBHXYnhXgMwWW26hRWWW6TlpEBb4vJiDgeZS2jXVB/e6dw7W423YvnUjWRIrw5iEff2mFx74vqiEWB3mClkWJOfdZ2Pd+voMYNeT2x2xqI9OrzahKhpkWPIeYu02BDbCWDfprfz9cgyhcdByX7Em0pA958xDwrAf8Slv1UVHn5Dpcs/wiUZJFwDOIt/vjMY3T7eHRz1z0IefnIexoSyRJigGe0VPRwLtzPp65jduu+9Gy8+iULouMVBvUuGsNsn+N0JYb6N436LNv3V9zbLeIeXBJ9j23HAU8k2LHLUnMf1JKXl2D6UpthhITPTeqK3CLCQ0+6KfeODRpAeSyA3Aj5K6fPsQGpx/N/cIobuOfRJ/FAK/BZ+pNn/rxIAKyR2CzBUE/+YdyzjTdqgzhOyUj6H5xgHTvoQ++jwDeQ95lUbYGb4sA+WNiVI/Q5mmMmoZT0Q2XGaZfTCyWyywststsi/lTLNgf3aH+LFzpNVzdLQH5BYHNFgS9qzsFQ3eYVwB43fSnJge93YPeZQ4HveNB3gNec1w3KchbMY3UwgZdR0WgNOigd+0cwI7AM93wITe8qTMf4c35CI9T22Y96L3xow7TAHT15k8fSySSL5LhWI/cdNQ55Cm/LjSooHc6Nut0bQTeK7oOBSN7ADsB34vyFlkbD3qG0V0D66Le8pljSduVqPz7vriFAcRcQvttxMxfTZcA8buVGw667rTaADsWD/qOQ8A7fjH4SM9FeNODXYOi3nnvX/O7x8c/+MhNX04y4p6OmFeI6U+OqsTcHRrLvJtoMZUMu7ZWwxWqzwrWXOPKKbIuS4LetRspWSqm0xIzoaRTLhsawimUtMxwfioVLi6DdbS0w9R7Dr+ZT6XdmrzDZukhe+6jE19Q35/9SxLRHWGL6iKLwO3jKgL2pYnrh73Sp7LTLPrJLEZ17ACVSJsDNAfbCjqnaVDJZgSyaxTR27pz8gpG9C5GdcezMfMR3vKifM/SUJSHhqsGUV295/638jJCPoyQO0xKO4qUcuY+duCGVUd2iqzTi3j1CpXF+mEfX+G+m4vse6Vtjqg7S46Ov7KYLRNKAPSfHao3APKZy22bIfBXCHQP+K7DWZoe8BpYGHXy4Qt5ecippYYdlh5GyG0EnQHoipxy5z5+x/VJwI4Rrr7C1UurGS4G604lCTuL6SsjtE6go04++HwZYK9fblvsSgB8x4ccI/2V+SivdXVHffDoRYjkAeQ2QW4j5FDwIZOrSJI7d8238knAjt0ISsto0GkEeT2BfSPs6iosUPgusZzzEErSowd6qfJCaf9D38Q8enEYvPkQWJEhmHqvff+uDQ+56k+e+YcP+Q4HPXkvkjME3Ifc6+8iSeCtEfa79qjvPXehuUpI6uRli8zvK56PyZagb68v0Q+8sZysCN0VGpReDAZn8+vhuc0t4zwaZFUKIcul9dGAba32fLjPG1sJ9GX/a5dbDh+oQUOUYCfQh2Rtx7CsPv9yK58a4iAfCiB3mLwAcre3Z1mWteyunerbT2/dH/qMGfChbrWR9gNvXXi9duxU6XLHrv8XbMz//KK1O5b6/KlWLjXkenYl1TfkEgPIlbFsZu7WRw94kfC7p6cL3zvzw9wWgnxCYDaAET3QF+/dH0T2mddnflVWvlr4QB62FfTkcp+QZ3ZdxQByNjo6xrKKwkavvppdlcmWnvzGI/UBALhI1iL2N1AIchyNpUTYFGk7ABY8MV5q2CCOMVjLbtYrHjP652deKX327ttYWpYu7S6MF8CL+5BTo3NRyMGgZ67aycYyIwD5KMuOjbHR3VeznSMjAwE5KUdeusLlzZvkbwtLrFtn20f5uLYCBgsuKZBnazhwJr2alS/+/NVS7s5bp1Ie4I4HOQsiubyg4dmDHLvsjuzayUYhkmchkmfGFJYlyH96W6W+Rb7UpRp60xFf+iRFfhx72uR+dOifmEal94ENmsEIya2DD8WCsbcaLT9Bx8N/NgaflSnKToa2NRVkkri7lfcLY+FjW+zOxi274NfJeKhpHQT/ID39xfl7gsjOnydta4KmLWqwFyiYtPrNnsmr/WZbv/jtlJxymgHkUiiS+2Pp3HnIPxTJd/uQ76tslyhXDndKoy9+ltKV99HsCYSSexqK76domQBShd6fJdDw9bVBpeNz/cFywU910PsZxnWNIMhzwWuCPOrYeO2hZRuhZZVQF4YFr+kanKV1W1yQCJ9nUOGm2PyglwJV0L6ZkZP45v7z2p80gHyGy5MT6MF40QDyHeDJRyCSj0IkH6NInik9NTG1HSBvUKalHmODiov00+nnLhHoUqgtoEUsdy3tazK8PB1LaxnHdpr6+BQ5gBltI+mkwiXO+lWWc73kpI7g/d+cLwPkdZmDnI/kuxDyXiSHhqfi25UBhhyjYYmmjQgP2qR5GFGvx3/Tskg6scFFrWm+Icd3/6X3Obb6h0o4eKRO+6tHHHeBa0hGHluEFfPsC5dlKoQ8dwttCW1zLNxYDTdglzhPvJOV+e2sqUcP618vvVn6xJ15hLy4APKdPuRZsitZtCuZkdLT+6cHNpJTpKwntC0EJOh5OctVpCKb/9Wx4D3fuavBRU8WmteImNfi9lckyGb5Zciv14NjiTm2cLtkgipOi1u2Ttvi9zlBFeA4d47YCQ6v48nQeQdtjVzEeSi0j9Nrnl5cTNfctQcPtAKQ53btHKYUoh/JM6NjjR0jI+UTB46KMaNC66Y1zeV+8u4b8ko2UxgdzSqZbLa5ayTbfOk7J1risgsJCQkJCQkJCQkJCQkJCQkJCQkJCQ2I/i/AAIBJRUJ5hOGjAAAAAElFTkSuQmCC">'
|
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 |
}
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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,
|
@@ -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)
|
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 |
-
*
|
|
|
|
|
|
|
|
|
|
|
25 |
* @see Mage_Customer_Model_Form::extractData()
|
26 |
*/
|
27 |
-
public function extractData
|
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 |
-
*
|
39 |
-
*
|
|
|
|
|
|
|
40 |
*/
|
41 |
-
public function validateData
|
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 (
|
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 |
-
|
63 |
-
|
64 |
-
|
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 |
-
|
|
|
|
|
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(
|
107 |
-
if ($
|
108 |
$message = Mage::getStoreConfig('username/general/input_validation_custom_message');
|
109 |
} else {
|
110 |
-
$message = Mage::helper('username')->
|
|
|
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 |
}
|
@@ -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 |
+
}
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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)
|
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
|
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
|
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
|
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')->
|
75 |
-
|
76 |
-
|
|
|
77 |
);
|
78 |
}
|
79 |
|
80 |
/* @var $attributeUsernameModel Mage_Customer_Model_Attribute */
|
81 |
$attributeUsernameModel = Mage::getModel('customer/attribute')->loadByCode('customer', 'username');
|
82 |
-
if($attributeUsernameModel->getId()) {
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
}
|
96 |
}
|
97 |
|
98 |
/**
|
99 |
* Event
|
100 |
-
* -
|
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'
|
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 |
);
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
+
}
|
@@ -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 |
-
|
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)
|
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 |
-
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
* @
|
25 |
-
* @
|
|
|
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>
|
@@ -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)
|
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.
|
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>
|
@@ -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 |
-
* @
|
25 |
-
* @
|
|
|
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 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>
|
@@ -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
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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 |
-
|
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)
|
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 |
|
@@ -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();
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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>
|
@@ -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 |
-
* @
|
25 |
-
* @
|
|
|
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">
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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 |
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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 |
|
@@ -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)
|
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 |
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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">
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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 |
|
@@ -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
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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 |
?>
|
@@ -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)
|
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 |
?>
|
@@ -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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -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"
|
@@ -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"
|
@@ -1,56 +1,80 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Diglin_Username</name>
|
4 |
-
<version>2.2.
|
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
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |

|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-

|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.&#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:&#xD;
|
12 |
+
&#xD;
|
13 |
+
- login with a username or email address. it can be done from frontend during checkout or getting access to the customer account&#xD;
|
14 |
+
- Username can have letters, digits, '_-' but no other special characters&#xD;
|
15 |
+
- Username length is from 6 until 30 characters possible&#xD;
|
16 |
+
- save a username from frontend (register account or checkout process) or from backend by editing a customer account&#xD;
|
17 |
+
- check that the username doesn't already exists&#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.&#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.&#xD;
|
20 |
+
&#xD;
|
21 |
+
Compatible Magento version &gt;= 1.4.2 until 1.9.1</description>
|
22 |
+
<notes>Version 2.2.2
|
23 |
+
- Fix issue with input validation (any kind of input was possible)
|
24 |

|
25 |
+
Version 2.0.*
|
26 |
+
e694fcb Add custom input validation
|
27 |
+
85a0f51 Update translations
|
28 |
+
1ca6441 Update Copyright
|
29 |
+
799fc1b [FIX] prevent to save username when it's not allowed from configuration
|
30 |
+
55ab34e make the module compatible with MAgento 1.8, change copyright, move column logic for customer grid into observer
|
31 |
+
6c49218 Merge pull request #7 from gdhnz/master
|
32 |
+
bad7445 Add permission "allow everything" to adminhtml.xml to resolve admin 404 for the extension config screen under CE 1.8
|
33 |
+
fa712c7 Code factoring
|
34 |
+
6c603d8 fix comment typo
|
35 |
+
5f5fe14 change to version 2.0.7
|
36 |
+
41e58bb fix bad condition test in case of not found $customerId in Form.php. Use case, checkout process with already logged in customer.
|
37 |
+
b8e71c7 add submodule MageTrashApp
|
38 |
+
757a3e2 Update README.md
|
39 |
+
48244a4 add version 2.0.6
|
40 |
+
e9453ff generate correctly username for old customers while installing the module
|
41 |
+
f422067 Fix to the controller forgotPassword
|
42 |
+
fd71c66 change version to 2.0.5
|
43 |
+
67bf362 cleanup some test
|
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 
|
45 |
+
1c0c07f change version number
|
46 |
+
4ab072f fix bad merging
|
47 |
+
cd2bb86 Update README.md
|
48 |
+
fa3f821 Update composer.json
|
49 |
+
d10136e add dependency suggestion
|
50 |
+
ff053ba remove todo task
|
51 |
+
b300aa0 Fix a problem with sql data install with empty select query
|
52 |
+
5b179b5 add uninstall process for module MageTrashApp
|
53 |
+
ce428e9 add composer.json
|
54 |
+
d93cc55 merge observer
|
55 |
+
29d4c21 add condition to test if attribute username model exists before to save the config
|
56 |
+
14acf45 Update README.md
|
57 |
+
21f72b7 add missing column for sales_flat_order table
|
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
|
59 |
+
aafb0be split template depending on the magento version, add missing template for use cases using persisten customer feature
|
60 |
+
ce9245b Fix or improve form model while saving new customer data
|
61 |
+
42444f3 Improve test if shop owner change the account sharing options
|
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
|
63 |
+
c6b7250 add customer ID fix depending on the context
|
64 |
+
788e656 add optionable strtolower username
|
65 |
+
49cb18d add optionable strtolower username
|
66 |
+
dff09e0 Add modman and instruction to use it
|
67 |
+
2d6b6c8 Merge pull request #1 from clst/master
|
68 |
+
1d143e9 fix: weird quote characters in german language file
|
69 |
+
9cbf4a2 add: can now update is_active for existing customers
|
70 |
+
dfa9cc6 Fix some bug and add a way to import is_active attribute
|
71 |
+
60c7143 Update README.md
|
72 |
+
24afad2 add gitignore and license files
|
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>
|