Flickrocket - Version 1.1.2

Version Notes

First RC

Download this release

Release Info

Developer Volkmar Breitfeld
Extension Flickrocket
Version 1.1.2
Comparing to
See all releases


Version 1.1.2

Files changed (50) hide show
  1. app/code/community/Acegmbh/Flux/Block/Adminhtml/Admin.php +23 -0
  2. app/code/community/Acegmbh/Flux/Block/Adminhtml/Admin/Grid.php +22 -0
  3. app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux.php +23 -0
  4. app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit.php +7 -0
  5. app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit/Form.php +7 -0
  6. app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit/Tab/Form.php +7 -0
  7. app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit/Tabs.php +7 -0
  8. app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Grid.php +126 -0
  9. app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Grid/Render/Xml.php +24 -0
  10. app/code/community/Acegmbh/Flux/Helper/Data.php +792 -0
  11. app/code/community/Acegmbh/Flux/Model/Adminhtml/System/Config/Source/Licenceids.php +32 -0
  12. app/code/community/Acegmbh/Flux/Model/Adminhtml/System/Config/Source/Projectids.php +40 -0
  13. app/code/community/Acegmbh/Flux/Model/Adminhtml/System/Config/Source/Wsdlurls.php +19 -0
  14. app/code/community/Acegmbh/Flux/Model/Customer.php +27 -0
  15. app/code/community/Acegmbh/Flux/Model/Customer/Entity/Customer.php +83 -0
  16. app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/ChangeCustomerEMail.php +14 -0
  17. app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/ChangeCustomerPassword.php +14 -0
  18. app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/CheckUserExists.php +14 -0
  19. app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/CreateShopOrder.php +14 -0
  20. app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/GetLicenses.php +19 -0
  21. app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/GetProjects.php +9 -0
  22. app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/PrepareLogin.php +19 -0
  23. app/code/community/Acegmbh/Flux/Model/Mysql4/Orders.php +15 -0
  24. app/code/community/Acegmbh/Flux/Model/Mysql4/Orders/Collection.php +19 -0
  25. app/code/community/Acegmbh/Flux/Model/Mysql4/Users.php +15 -0
  26. app/code/community/Acegmbh/Flux/Model/Mysql4/Users/Collection.php +19 -0
  27. app/code/community/Acegmbh/Flux/Model/Observer.php +199 -0
  28. app/code/community/Acegmbh/Flux/Model/Orders.php +20 -0
  29. app/code/community/Acegmbh/Flux/Model/Users.php +20 -0
  30. app/code/community/Acegmbh/Flux/controllers/Adminhtml/AdminController.php +113 -0
  31. app/code/community/Acegmbh/Flux/controllers/Adminhtml/FluxController.php +110 -0
  32. app/code/community/Acegmbh/Flux/controllers/Adminhtml/UploadController.php +113 -0
  33. app/code/community/Acegmbh/Flux/controllers/Checkout/OnepageController.php +52 -0
  34. app/code/community/Acegmbh/Flux/controllers/IndexController.php +11 -0
  35. app/code/community/Acegmbh/Flux/etc/adminhtml.xml +51 -0
  36. app/code/community/Acegmbh/Flux/etc/config.xml +163 -0
  37. app/code/community/Acegmbh/Flux/etc/system.xml +70 -0
  38. app/code/community/Acegmbh/Flux/sql/flux_setup/mysql4-install-0.1.0.php +235 -0
  39. app/design/adminhtml/default/default/layout/acegmbh_flux.xml +8 -0
  40. app/design/adminhtml/default/default/template/flux/admin.phtml +71 -0
  41. app/design/adminhtml/default/default/template/flux/upload.phtml +84 -0
  42. app/design/frontend/base/default/layout/flux.xml +43 -0
  43. app/design/frontend/base/default/template/flux/catalog/product/samples.phtml +37 -0
  44. app/design/frontend/base/default/template/flux/dlmanagerlinks.phtml +38 -0
  45. app/etc/modules/Acegmbh_Flux.xml +8 -0
  46. app/locale/en_US/Acegmbh_Flux.csv +33 -0
  47. package.xml +21 -0
  48. skin/adminhtml/default/default/images/flux/CloudIcon_Apple.png +0 -0
  49. skin/adminhtml/default/default/images/flux/CloudIcon_Html5.png +0 -0
  50. skin/adminhtml/default/default/images/flux/CloudIcon_Win.png +0 -0
app/code/community/Acegmbh/Flux/Block/Adminhtml/Admin.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Admin
4
+ extends Mage_Adminhtml_Block_Widget_Grid_Container
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return object
14
+ */
15
+ public function __construct()
16
+ {
17
+ $this->_controller = 'adminhtml_flickrocketadmin';
18
+ $this->_blockGroup = 'admin';
19
+ $this->_headerText = Mage::helper('flux')->__('FlickRocket Admin');
20
+ parent::__construct();
21
+ $this->removeButton('add');
22
+ }
23
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Admin/Grid.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Admin_Grid
4
+ extends Mage_Adminhtml_Block_Widget_Grid
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return object
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+
19
+ }
20
+
21
+
22
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Flux
4
+ extends Mage_Adminhtml_Block_Widget_Grid_Container
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return object
14
+ */
15
+ public function __construct()
16
+ {
17
+ $this->_controller = 'adminhtml_flux';
18
+ $this->_blockGroup = 'flux';
19
+ $this->_headerText = Mage::helper('flux')->__('FlickRocket SOAP Log');
20
+ parent::__construct();
21
+ $this->removeButton('add');
22
+ }
23
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Flux_Edit
4
+ extends Mage_Adminhtml_Block_Widget_Form_Container
5
+ {
6
+
7
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit/Form.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Flux_Edit_Form
4
+ extends Mage_Adminhtml_Block_Widget_Form
5
+ {
6
+
7
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit/Tab/Form.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Flux_Edit_Tab_Form
4
+ extends Mage_Adminhtml_Block_Widget_Form
5
+ {
6
+
7
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Edit/Tabs.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Flux_Edit_Tabs
4
+ extends Mage_Adminhtml_Block_Widget_Tabs
5
+ {
6
+
7
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Grid.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Flux_Grid
4
+ extends Mage_Adminhtml_Block_Widget_Grid
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return object
14
+ */
15
+ public function __construct()
16
+ {
17
+ parent::__construct();
18
+ $this->setId('FluxOrderGrid');
19
+ $this->setDefaultSort('flux_order_id');
20
+ $this->setDefaultDir('DESC');
21
+ $this->setSaveParametersInSession(true);
22
+ }
23
+
24
+ /**
25
+ * Prepare the collection of physical orders.
26
+ *
27
+ * @version 0.1
28
+ *
29
+ * @param void
30
+ *
31
+ * @return object
32
+ */
33
+ protected function _prepareCollection()
34
+ {
35
+ $collection = Mage::getModel('flux/orders')->getCollection();
36
+ $this->setCollection($collection);
37
+ return parent::_prepareCollection();
38
+ }
39
+
40
+ /**
41
+ * Prepare the columns.
42
+ *
43
+ * @version 0.1
44
+ *
45
+ * @param void
46
+ *
47
+ * @return object
48
+ */
49
+ protected function _prepareColumns()
50
+ {
51
+ $this->addColumn('flux_order_id', array(
52
+ 'header' => Mage::helper('flux')->__('ID'),
53
+ 'align' => 'right',
54
+ 'width' => '50px',
55
+ 'index' => 'flux_order_id'
56
+ )
57
+ );
58
+ $this->addColumn('order_id', array(
59
+ 'header' => Mage::helper('flux')->__('Order ID'),
60
+ 'align' => 'right',
61
+ 'width' => '50px',
62
+ 'index' => 'order_id'
63
+ )
64
+ );
65
+ $this->addColumn('store_id', array(
66
+ 'header' => Mage::helper('flux')->__('Store ID'),
67
+ 'align' => 'right',
68
+ 'width' => '50px',
69
+ 'index' => 'store_id'
70
+ )
71
+ );
72
+ $this->addColumn('customer_id', array(
73
+ 'header' => Mage::helper('flux')->__('Customer ID'),
74
+ 'align' => 'right',
75
+ 'width' => '50px',
76
+ 'index' => 'customer_id'
77
+ )
78
+ );
79
+ $this->addColumn('request', array(
80
+ 'header' => Mage::helper('flux')->__('Request'),
81
+ 'align' => 'right',
82
+ 'width' => '150px',
83
+ 'index' => 'request',
84
+ 'renderer' => 'Acegmbh_Flux_Block_Adminhtml_Flux_Grid_Render_Xml'
85
+ )
86
+ );
87
+ $this->addColumn('response', array(
88
+ 'header' => Mage::helper('flux')->__('Response'),
89
+ 'align' => 'right',
90
+ 'width' => '150px',
91
+ 'index' => 'response',
92
+ 'renderer' => 'Acegmbh_Flux_Block_Adminhtml_Flux_Grid_Render_Xml'
93
+ )
94
+ );
95
+ $this->addColumn('error', array(
96
+ 'header' => Mage::helper('flux')->__('Error'),
97
+ 'align' => 'right',
98
+ 'width' => '150px',
99
+ 'index' => 'error'
100
+ )
101
+ );
102
+ $this->addColumn('date', array(
103
+ 'header' => Mage::helper('flux')->__('Order Date'),
104
+ 'align' => 'right',
105
+ 'width' => '150px',
106
+ 'index' => 'date',
107
+ 'type' => 'time'
108
+ )
109
+ );
110
+ return parent::_prepareColumns();
111
+ }
112
+
113
+ /**
114
+ * Get Row URL.
115
+ *
116
+ * @version 0.1
117
+ *
118
+ * @param object $row
119
+ *
120
+ * @return string
121
+ */
122
+ public function getRowUrl($row)
123
+ {
124
+ return;
125
+ }
126
+ }
app/code/community/Acegmbh/Flux/Block/Adminhtml/Flux/Grid/Render/Xml.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Block_Adminhtml_Flux_Grid_Render_Xml
4
+ extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
5
+ {
6
+ /**
7
+ * Render.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param object $Row
12
+ *
13
+ * @return string
14
+ */
15
+ public function render(Varien_Object $Row)
16
+ {
17
+ $value = $Row->getData($this->getColumn()->getIndex());
18
+ $Dom = new DOMDocument;
19
+ $Dom->preserveWhiteSpace = FALSE;
20
+ $Dom->formatOutput = TRUE;
21
+ $Dom->loadXml($value);
22
+ return '<div style="width:450px; overflow:auto;"><textarea rows="20" cols="80" style="border:none; font-size:11px;">' . $Dom->saveXml() . '</textarea></div>';
23
+ }
24
+ }
app/code/community/Acegmbh/Flux/Helper/Data.php ADDED
@@ -0,0 +1,792 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Helper_Data
4
+ extends Mage_Core_Helper_Abstract
5
+ {
6
+ /**
7
+ * Log file
8
+ */
9
+ const LOGFILE = "Acegmbh_Flux_Data.log";
10
+
11
+ const ERROR_INVALID_USER = 'Invalid user or not enough rights to submit orders';
12
+ const ERROR_INVALID_XML = 'Invalid XML';
13
+ const ERROR_NONEXISTANT_CUSTOMER_NODE = '"Customer" Node not found';
14
+ const ERROR_NONEXISTANT_ORDER_CUSTOMER = 'Customer Password is wrong';
15
+ const ERROR_UNDEFINED = 'Please check with FLUX';
16
+ const ERROR_NONEXISTANT_PASSWORD_NODE = '"Password" Node not found';
17
+ const ERROR_NONEXISTANT_NEWEMAIL_NODE = '"New Email" Node not found';
18
+ const ERROR_NONEXISTANT_CUSTOMER = '"Customer" not found';
19
+ const ERROR_EMAIL_EXISTS = 'Email already exists';
20
+ const SUCCESSFUL = 'Order Placed Successful';
21
+
22
+ /**
23
+ * @var array $errors
24
+ */
25
+ public static $errors = array(
26
+ 0 => self::SUCCESSFUL,
27
+ '-1' => self::ERROR_INVALID_USER,
28
+ '-2' => self::ERROR_INVALID_XML,
29
+ '-3' => self::ERROR_NONEXISTANT_CUSTOMER_NODE,
30
+ '-4' => self::ERROR_NONEXISTANT_ORDER_CUSTOMER,
31
+ '-5' => self::ERROR_UNDEFINED
32
+ );
33
+
34
+ public static $errorsemail = array(
35
+ 0 => self::SUCCESSFUL,
36
+ '-1' => self::ERROR_INVALID_USER,
37
+ '-2' => self::ERROR_INVALID_XML,
38
+ '-3' => self::ERROR_NONEXISTANT_CUSTOMER_NODE,
39
+ '-4' => self::ERROR_NONEXISTANT_CUSTOMER,
40
+ '-5' => self::ERROR_NONEXISTANT_PASSWORD_NODE,
41
+ '-7' => self::ERROR_NONEXISTANT_NEWEMAIL_NODE,
42
+ '-8' => self::ERROR_EMAIL_EXISTS,
43
+ );
44
+
45
+ /** ***************************************************************************** **/
46
+ /** ****************************** SOAP-functions ******************************* **/
47
+ /** ***************************************************************************** **/
48
+
49
+ /**
50
+ * Change password.
51
+ *
52
+ * @version 0.1
53
+ *
54
+ * @param Mage_Customer_Model_Customer $Customer
55
+ * @param string $currentPassword
56
+ * @param string $newPassword
57
+ *
58
+ * @return boolean
59
+ */
60
+ public static function changePassword( Mage_Customer_Model_Customer $Customer,
61
+ $currentPassword,
62
+ $newPassword,
63
+ $bHashvaluesGiven = false )
64
+ {
65
+ self::_log('changePassword');
66
+
67
+ $customerId = $Customer->getId();
68
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
69
+ $SoapClient = new SoapClient( $wsdl ,
70
+ array(
71
+ 'soap_version' => SOAP_1_2,
72
+ 'trace' => true,
73
+ 'classmap' => array(
74
+ 'CreateCustomerPasswordResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_ChangeCustomerPassword'
75
+ ),
76
+ 'cache_wsdl' => WSDL_CACHE_NONE
77
+ )
78
+ );
79
+
80
+ $soapRequest = array();
81
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
82
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
83
+
84
+ $Doc = new DOMDocument('1.0', 'UTF-8');
85
+ $Doc->formatOutput = true;
86
+ $_Customer = $Doc->createElement('Customer');
87
+ $Doc->appendChild($_Customer);
88
+
89
+ $_Email = $Doc->createElement('EMail', $Customer->getEmail());
90
+ $_Customer->appendChild($_Email);
91
+
92
+ if( $bHashvaluesGiven )
93
+ {
94
+ $Password = $Doc->createElement('PasswordHash', $currentPassword);
95
+ $_Customer->appendChild($Password);
96
+
97
+ $NewPassword = $Doc->createElement('NewPasswordHash', $newPassword);
98
+ $_Customer->appendChild($NewPassword);
99
+ }
100
+ else
101
+ {
102
+ $Password = $Doc->createElement('PasswordHash', $Customer->hashPassword($currentPassword) );
103
+ $_Customer->appendChild($Password);
104
+
105
+ $NewPassword = $Doc->createElement('NewPasswordHash', $Customer->hashPassword($newPassword) );
106
+ $_Customer->appendChild($NewPassword);
107
+ }
108
+
109
+ $soapRequest['XML'] = $Doc->saveXML();
110
+ try
111
+ {
112
+ $Result = $SoapClient->__call('ChangeCustomerPassword', array('parameters' => $soapRequest) );
113
+ $Result->ChangeCustomerPasswordResult;
114
+
115
+ self::_log('Request:');
116
+ self::_log(html_entity_decode($SoapClient->__getLastRequest()));
117
+ self::_log('Response:');
118
+ self::_log($SoapClient->__getLastResponse());
119
+
120
+ if( $Result->ErrorCode<0 )
121
+ {
122
+ return $Result->ErrorCode;
123
+ }
124
+ else
125
+ {
126
+ return true;
127
+ }
128
+ }
129
+ catch (SoapFault $Exception)
130
+ {
131
+ self::_log($Exception->getMessage());
132
+ return false;
133
+ }
134
+ }
135
+
136
+ public static function changeEmail(Mage_Customer_Model_Customer $Customer, $strNewEmail)
137
+ {
138
+ self::_log('changeEmail');
139
+
140
+ $customerId = $Customer->getId();
141
+
142
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
143
+ $SoapClient = new SoapClient( $wsdl ,
144
+ array(
145
+ 'soap_version' => SOAP_1_2,
146
+ 'trace' => true,
147
+ 'classmap' => array(
148
+ 'ChangeCustomerEMailResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_ChangeCustomerEMail'
149
+ ),
150
+ 'cache_wsdl' => WSDL_CACHE_NONE
151
+ )
152
+ );
153
+
154
+ $soapRequest = array();
155
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
156
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
157
+
158
+ $Doc = new DOMDocument('1.0', 'UTF-8');
159
+ $Doc->formatOutput = true;
160
+ $_Customer = $Doc->createElement('Customer');
161
+ $Doc->appendChild($_Customer);
162
+
163
+ $_Email = $Doc->createElement('EMail', $Customer->getEmail());
164
+ $_Customer->appendChild($_Email);
165
+
166
+ $_NewEmail = $Doc->createElement('NewEMail', $strNewEmail);
167
+ $_Customer->appendChild($_NewEmail);
168
+
169
+ $Password = $Doc->createElement('PasswordHash', $Customer->getData("password_hash"));
170
+ $_Customer->appendChild($Password);
171
+
172
+ $soapRequest['XML'] = $Doc->saveXML();
173
+ try
174
+ {
175
+ $Result = $SoapClient->__call('ChangeCustomerEMail', array('parameters' => $soapRequest) );
176
+ $Result->ChangeCustomerEMailResult;
177
+
178
+ self::_log('Request:');
179
+ self::_log( $SoapClient->__getLastRequest() );
180
+ self::_log('Response:');
181
+ self::_log( $SoapClient->__getLastResponse() );
182
+
183
+ if( $Result->ErrorCode<0 )
184
+ {
185
+ return $Result->ErrorCode;
186
+ }
187
+ else
188
+ {
189
+ return true;
190
+ }
191
+ }
192
+ catch (SoapFault $Exception)
193
+ {
194
+ self::_log($Exception->getMessage());
195
+ return false;
196
+ }
197
+ }
198
+
199
+ public static function createShopOrder($Order)
200
+ {
201
+ self::_log('createShopOrder');
202
+
203
+ $iIdCustomer = $Order->getCustomerId();
204
+ $Customer = Mage::getModel('customer/customer')->load($iIdCustomer);
205
+
206
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
207
+ $SoapClient = new SoapClient($wsdl, array( 'soap_version' => SOAP_1_2,
208
+ 'trace' => true,
209
+ 'classmap' => array('CreateShopOrderResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_CreateShopOrder'),
210
+ 'cache_wsdl' => WSDL_CACHE_NONE
211
+ )
212
+ );
213
+
214
+ $soapRequest = array();
215
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
216
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
217
+
218
+ $Doc = new DOMDocument('1.0', 'UTF-8');
219
+ $Doc->formatOutput = true;
220
+ $_Order = $Doc->createElement('Order');
221
+ $Doc->appendChild($_Order);
222
+
223
+ $TransactionID = $Doc->createElement('TransactionID', $Order->getRealOrderId());
224
+ $_Order->appendChild($TransactionID);
225
+
226
+ $ThemeID = $Doc->createElement('ThemeID', Mage::getStoreConfig('acegmbh_flux/flux/flux_theme_id'));
227
+ $_Order->appendChild($ThemeID);
228
+
229
+ $EMail = $Doc->createElement('EMail', $Customer->getEmail());
230
+ $_Order->appendChild($EMail);
231
+
232
+ $Password = $Doc->createElement('PasswordHash', $Customer->getPasswordHash());
233
+ $_Order->appendChild($Password);
234
+
235
+ $Items = $Doc->createElement('Items');
236
+ $_Order->appendChild($Items);
237
+
238
+ $iSentItems = 0;
239
+ $_Items = $Order->getAllItems();
240
+ foreach ($_Items as $_Item)
241
+ {
242
+ $productId = $_Item->getData('product_id');
243
+ $Product = Mage::getModel('catalog/product')->load($productId);
244
+
245
+ $attributeSetModel = Mage::getModel("eav/entity_attribute_set");
246
+ $attributeSetModel->load( $Product->getAttributeSetId() );
247
+ $attributeSetName = $attributeSetModel->getAttributeSetName();
248
+
249
+ self::_log( 'ProductId: ' . $productId . ', ' .
250
+ 'AttributeSetId: ' . $Product->getAttributeSetId() . ', ' .
251
+ 'AttributeSetName: ' . $attributeSetName );
252
+
253
+ /**
254
+ * sent only digital items
255
+ */
256
+ if( $attributeSetName!='FlickRocketProduct' )
257
+ {
258
+ self::_log('No FlickRocketProduct (do not add it to XML)');
259
+ continue;
260
+ }
261
+
262
+ $Item = $Doc->createElement('Item');
263
+ $Items->appendChild($Item);
264
+ $ProjectID = $Doc->createElement('ProjectID', $Product->getProjectId());
265
+ $Item->appendChild($ProjectID);
266
+
267
+ $LicenseID = $Doc->createElement('LicenseID', $Product->getLicenseId());/* NOTE - License ID HARD CODED */
268
+ $Item->appendChild($LicenseID);
269
+
270
+ $Count = $Doc->createElement('Count', 1); // $_Item->getQtyToShip());
271
+ $Item->appendChild($Count);
272
+
273
+ $iSentItems++;
274
+ }
275
+
276
+ if( 0==$iSentItems )
277
+ {
278
+ /**
279
+ * don't sent data, if the order has no digital items
280
+ */
281
+ self::_log( 'do not sent data, if the order has no digital items ');
282
+ return;
283
+ }
284
+
285
+ $soapRequest['XML'] = $Doc->saveXML();
286
+ try
287
+ {
288
+ $Result = $SoapClient->__call('CreateShopOrder', array( 'parameters' => $soapRequest ) );
289
+
290
+ self::_log('Request:');
291
+ self::_log( $SoapClient->__getLastRequest() );
292
+ self::_log('Response:');
293
+ self::_log( $SoapClient->__getLastResponse() );
294
+
295
+ self::_logflux( $Order->getId(),
296
+ $Order->getStore()->getId(),
297
+ $Customer->getId(),
298
+ $SoapClient->__getLastRequest(),
299
+ $SoapClient->__getLastResponse(),
300
+ $Result->ErrorCode );
301
+ }
302
+ catch (SoapFault $Exception)
303
+ {
304
+ self::_log($Exception->getMessage());
305
+ }
306
+ }
307
+
308
+ /** ***************************************************************************** **/
309
+ /** ************************ SOAP-functions (as in the API) ********************* **/
310
+ /** ***************************************************************************** **/
311
+
312
+ /**
313
+ * @param int $iTransactionId
314
+ * @param string $strEmail
315
+ * @param string $strPassword
316
+ * @param bool $bPwHash - true means, the password is given as a hash
317
+ * @return 'OK' = email and password are correct or user email does not exist
318
+ * 'PASSWORD_WRONG' = email is correct but password is wrong
319
+ * 'SOAP_EXCEPTION'
320
+ */
321
+ public static function createShopUser( $iTransactionId, $strEmail, $strPassword, $bPwHash = true )
322
+ {
323
+ self::_log('createShopUser');
324
+
325
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
326
+ $SoapClient = new SoapClient($wsdl, array( 'soap_version' => SOAP_1_2,
327
+ 'trace' => true,
328
+ 'classmap' => array('CreateShopOrderResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_CreateShopOrder'),
329
+ 'cache_wsdl' => WSDL_CACHE_NONE
330
+ )
331
+ );
332
+
333
+ $soapRequest = array();
334
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
335
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
336
+
337
+ $Doc = new DOMDocument('1.0', 'UTF-8');
338
+ $Doc->formatOutput = true;
339
+ $_Order = $Doc->createElement('Order');
340
+ $Doc->appendChild($_Order);
341
+
342
+ $TransactionID = $Doc->createElement('TransactionID', '999999' . $iTransactionId);
343
+ $_Order->appendChild($TransactionID);
344
+
345
+ $ThemeID = $Doc->createElement('ThemeID', Mage::getStoreConfig('acegmbh_flux/flux/flux_theme_id'));
346
+ $_Order->appendChild($ThemeID);
347
+
348
+ $EMail = $Doc->createElement('EMail', $strEmail);
349
+ $_Order->appendChild($EMail);
350
+
351
+ if( $bPwHash )
352
+ {
353
+ $Password = $Doc->createElement('PasswordHash', $strPassword);
354
+ $_Order->appendChild($Password);
355
+ }
356
+ else
357
+ {
358
+ $Password = $Doc->createElement('Password', $strPassword);
359
+ $_Order->appendChild($Password);
360
+ }
361
+
362
+ $soapRequest['XML'] = $Doc->saveXML();
363
+ try
364
+ {
365
+ $Result = $SoapClient->__call('CreateShopOrder', array( 'parameters' => $soapRequest ) );
366
+
367
+ self::_log('Request:');
368
+ self::_log( $SoapClient->__getLastRequest() );
369
+ self::_log('Response:');
370
+ self::_log( $SoapClient->__getLastResponse() );
371
+
372
+ if( $Result->CreateShopOrderResult==1 && $Result->ErrorCode==0 )
373
+ {
374
+ return 'OK';
375
+ }
376
+ if( $Result->ErrorCode==-4 )
377
+ {
378
+ return 'PASSWORD_WRONG';
379
+ }
380
+ }
381
+ catch (SoapFault $Exception)
382
+ {
383
+ self::_log($Exception->getMessage());
384
+ return 'SOAP_EXCEPTION';
385
+ }
386
+ }
387
+
388
+ /**
389
+ * @param string $strEmail
390
+ * @param string $strPassword
391
+ * @param bool $bPwHash - true means, the password is given as a hash
392
+ * @return 'OK' = email and password are correct or user email does not exist
393
+ * 'PASSWORD_WRONG' = email is correct but password is wrong
394
+ * 'SOAP_EXCEPTION'
395
+ */
396
+ public static function checkUserExists($strEmail, $strPassword, $bPwHash = true )
397
+ {
398
+ self::_log('checkUserExists');
399
+
400
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
401
+ $SoapClient = new SoapClient($wsdl, array( 'soap_version' => SOAP_1_2,
402
+ 'trace' => true,
403
+ 'classmap' => array('CheckUserExistsResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_CheckUserExists'),
404
+ 'cache_wsdl' => WSDL_CACHE_NONE
405
+ )
406
+ );
407
+
408
+ $soapRequest = array();
409
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
410
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
411
+
412
+ $Doc = new DOMDocument('1.0', 'UTF-8');
413
+ $Doc->formatOutput = true;
414
+ $_Customer = $Doc->createElement('Customer');
415
+ $Doc->appendChild($_Customer);
416
+
417
+ $EMail = $Doc->createElement('EMail', $strEmail);
418
+ $_Customer->appendChild($EMail);
419
+
420
+ if( $bPwHash )
421
+ {
422
+ $Password = $Doc->createElement('PasswordHash', $strPassword);
423
+ $_Customer->appendChild($Password);
424
+ }
425
+ else
426
+ {
427
+ $Password = $Doc->createElement('Password', $strPassword);
428
+ $_Customer->appendChild($Password);
429
+ }
430
+
431
+ $soapRequest['XML'] = $Doc->saveXML();
432
+ try
433
+ {
434
+ $Result = $SoapClient->__call('CheckUserExists', array( 'parameters' => $soapRequest ) );
435
+
436
+ self::_log('Request:');
437
+ self::_log( $SoapClient->__getLastRequest() );
438
+ self::_log('Response:');
439
+ self::_log( $SoapClient->__getLastResponse() );
440
+
441
+ if( $Result->CheckUserExistsResult==1 && $Result->ErrorCode==0 )
442
+ {
443
+ return 'OK';
444
+ }
445
+ if( $Result->ErrorCode==-5 )
446
+ {
447
+ return 'PASSWORD_WRONG';
448
+ }
449
+ return $Result->ErrorCode;
450
+ }
451
+ catch (SoapFault $Exception)
452
+ {
453
+ self::_log($Exception->getMessage());
454
+ return 'SOAP_EXCEPTION';
455
+ }
456
+ }
457
+
458
+ /**
459
+ *
460
+ * @param string $strEmail
461
+ * @param string $strPwOld
462
+ * @param bool $bPwOldHash
463
+ * @param string $strPwNew
464
+ * @param bool $bPwNewHash
465
+ * @return 'OK' = email and password are correct or user email does not exist
466
+ * 'PASSWORD_WRONG' = email is correct but password is wrong
467
+ * 'SOAP_EXCEPTION'
468
+ */
469
+ public static function changeCustomerPassword( $strEmail,
470
+ $strPwOld,
471
+ $bPwOldHash,
472
+ $strPwNew,
473
+ $bPwNewHash )
474
+ {
475
+
476
+ self::_log('changeCustomerPassword');
477
+
478
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
479
+ $SoapClient = new SoapClient( $wsdl, array( 'soap_version' => SOAP_1_2,
480
+ 'trace' => true,
481
+ 'classmap' => array( 'ChangeCustomerPasswordResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_ChangeCustomerPassword' ),
482
+ 'cache_wsdl' => WSDL_CACHE_NONE
483
+ )
484
+ );
485
+
486
+ $soapRequest = array();
487
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
488
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
489
+
490
+ $Doc = new DOMDocument('1.0', 'UTF-8');
491
+ $Doc->formatOutput = true;
492
+ $_Customer = $Doc->createElement('Customer');
493
+ $Doc->appendChild($_Customer);
494
+
495
+ $_Email = $Doc->createElement('EMail', $strEmail);
496
+ $_Customer->appendChild($_Email);
497
+
498
+ if( $bPwOldHash==true )
499
+ {
500
+ $Password = $Doc->createElement('PasswordHash', $strPwOld);
501
+ }
502
+ else
503
+ {
504
+ $Password = $Doc->createElement('Password', $strPwOld);
505
+ }
506
+ $_Customer->appendChild($Password);
507
+
508
+ if( $bPwNewHash==true )
509
+ {
510
+ $NewPassword = $Doc->createElement('NewPasswordHash', $strPwNew );
511
+ }
512
+ else
513
+ {
514
+ $NewPassword = $Doc->createElement('NewPassword', $strPwNew );
515
+ }
516
+ $_Customer->appendChild($NewPassword);
517
+
518
+ $soapRequest['XML'] = $Doc->saveXML();
519
+ try
520
+ {
521
+ $Result = $SoapClient->__call('ChangeCustomerPassword', array( 'parameters' => $soapRequest ) );
522
+
523
+ self::_log('Request:');
524
+ self::_log( $SoapClient->__getLastRequest() );
525
+ self::_log('Response:');
526
+ self::_log( $SoapClient->__getLastResponse() );
527
+
528
+ if( $Result->ChangeCustomerPasswordResult==1 && $Result->ErrorCode==0 )
529
+ {
530
+ return 'OK';
531
+ }
532
+ if( $Result->ErrorCode==-4 )
533
+ {
534
+ return 'EMAIL_NOT_FOUND';
535
+ }
536
+ }
537
+ catch (SoapFault $Exception)
538
+ {
539
+ self::_log($Exception->getMessage());
540
+ return 'SOAP_EXCEPTION';
541
+ }
542
+
543
+ }
544
+
545
+ /**
546
+ */
547
+ public static function getProjects()
548
+ {
549
+ self::_log('getProjects');
550
+
551
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
552
+ $SoapClient = new SoapClient($wsdl, array( 'soap_version' => SOAP_1_2,
553
+ 'trace' => true,
554
+ 'classmap' => array('CheckUserExistsResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_GetProjects'),
555
+ 'cache_wsdl' => WSDL_CACHE_NONE
556
+ )
557
+ );
558
+
559
+ $soapRequest = array();
560
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
561
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
562
+ $soapRequest['ThemeID'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_theme_id');
563
+
564
+ $Doc = new DOMDocument('1.0', 'UTF-8');
565
+ $Doc->formatOutput = true;
566
+ $soapRequest['XML'] = $Doc->saveXML();
567
+ try
568
+ {
569
+ $Result = $SoapClient->__call('GetProjects', array( 'parameters' => $soapRequest ) );
570
+
571
+ self::_log('Request:');
572
+ self::_log( $SoapClient->__getLastRequest() );
573
+ self::_log('Response:');
574
+ self::_log( $SoapClient->__getLastResponse() );
575
+
576
+ if( $Result->GetProjectsResult==true && $Result->ErrorCode==0 )
577
+ {
578
+ // echo '>>>'.count($Result->Licenses).'<<<';
579
+ // echo '<pre>';
580
+ // var_dump($Result->Licenses->stLicense);
581
+ // echo '</pre>';
582
+ if( is_array($Result->Projects->stProject) )
583
+ {
584
+ return $Result->Projects->stProject;
585
+ }
586
+ else
587
+ {
588
+ $arrReturn = array();
589
+ $arrReturn[] = $Result->Projects->stProject;
590
+ return $arrReturn;
591
+ }
592
+
593
+
594
+ foreach( $Result->Licenses->stLicense as $license )
595
+ {
596
+ echo "\n<br />" . '***';
597
+ // print_r($license);
598
+ echo "\n<br />" . $license->ID;
599
+ echo "\n<br />" . $license->Name;
600
+ echo "\n<br />" . $license->LicType;
601
+ }
602
+ }
603
+
604
+ }
605
+ catch (SoapFault $Exception)
606
+ {
607
+ self::_log($Exception->getMessage());
608
+ return 'SOAP_EXCEPTION';
609
+ }
610
+ }
611
+
612
+ /**
613
+ */
614
+ public static function getLicenses()
615
+ {
616
+ self::_log('getLicenses');
617
+
618
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
619
+ $SoapClient = new SoapClient($wsdl, array( 'soap_version' => SOAP_1_2,
620
+ 'trace' => true,
621
+ 'classmap' => array('CheckUserExistsResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_GetLicenses'),
622
+ 'cache_wsdl' => WSDL_CACHE_NONE
623
+ )
624
+ );
625
+ $soapRequest = array();
626
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
627
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
628
+ $soapRequest['ThemeID'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_theme_id');
629
+
630
+ $Doc = new DOMDocument('1.0', 'UTF-8');
631
+ $Doc->formatOutput = true;
632
+ $soapRequest['XML'] = $Doc->saveXML();
633
+ try
634
+ {
635
+ $Result = $SoapClient->__call('GetLicenses', array( 'parameters' => $soapRequest ) );
636
+
637
+ self::_log('Request:');
638
+ self::_log( $SoapClient->__getLastRequest() );
639
+ self::_log('Response:');
640
+ self::_log( $SoapClient->__getLastResponse() );
641
+
642
+ if( $Result->GetLicensesResult==true && $Result->ErrorCode==0 )
643
+ {
644
+ // echo '>>>'.count($Result->Licenses).'<<<';
645
+ // echo '<pre>';
646
+ // var_dump($Result->Licenses->stLicense);
647
+ // echo '</pre>';
648
+ return $Result->Licenses->stLicense;
649
+
650
+ foreach( $Result->Licenses->stLicense as $license )
651
+ {
652
+ echo "\n<br />" . '***';
653
+ // print_r($license);
654
+ echo "\n<br />" . $license->ID;
655
+ echo "\n<br />" . $license->Name;
656
+ echo "\n<br />" . $license->LicType;
657
+ }
658
+ }
659
+
660
+ // public $Licenses;
661
+ /*
662
+ if( $Result->CheckUserExistsResult==1 && $Result->ErrorCode==0 )
663
+ {
664
+ return 'OK';
665
+ }
666
+ if( $Result->ErrorCode==-5 )
667
+ {
668
+ return 'PASSWORD_WRONG';
669
+ }
670
+ return $Result->ErrorCode;
671
+ */
672
+ }
673
+ catch (SoapFault $Exception)
674
+ {
675
+ self::_log($Exception->getMessage());
676
+ return 'SOAP_EXCEPTION';
677
+ }
678
+ }
679
+ /**
680
+ */
681
+
682
+ public static function checkPreviewExists($strProjectID)
683
+ {
684
+ self::_log('checkPreviewExists');
685
+
686
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
687
+ $SoapClient = new SoapClient($wsdl, array( 'soap_version' => SOAP_1_2,
688
+ 'trace' => true,
689
+ 'classmap' => array('CheckPreviewExists' => 'Acegmbh_Flux_Model_Flux_Soap_Response_CheckPreviewExists'),
690
+ 'cache_wsdl' => WSDL_CACHE_NONE
691
+ )
692
+ );
693
+ $soapRequest = array();
694
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
695
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
696
+ $soapRequest['ProjectID'] = $strProjectID;
697
+
698
+ try
699
+ {
700
+ $Result = $SoapClient->__call('CheckPreviewExists', array( 'parameters' => $soapRequest ) );
701
+
702
+ self::_log('Request:');
703
+ self::_log( $SoapClient->__getLastRequest() );
704
+ self::_log('Response:');
705
+ self::_log( $SoapClient->__getLastResponse() );
706
+
707
+ if( $Result->CheckPreviewExistsResult == true )
708
+ {
709
+ return $Result->CheckPreviewExistsResult;
710
+
711
+ }
712
+
713
+ }
714
+ catch (SoapFault $Exception)
715
+ {
716
+ self::_log($Exception->getMessage());
717
+ return 'SOAP_EXCEPTION';
718
+ }
719
+ }
720
+ /** ***************************************************************************** **/
721
+ /** **************************** logging-functions ****************************** **/
722
+ /** ***************************************************************************** **/
723
+
724
+ private static function _log($strLogText)
725
+ {
726
+ // echo '<pre>';
727
+ // echo htmlentities($strLogText);
728
+ // echo '</pre>';
729
+ Mage::log($strLogText, null, self::LOGFILE);
730
+ }
731
+
732
+ private static function _logflux( $iIdOrder, $iIdStore, $iIdCustomer, $strRequest, $strResponse, $iErrorCode )
733
+ {
734
+ $FluxOrders = Mage::getModel('flux/orders');
735
+ $FluxOrders->setOrderId( $iIdOrder );
736
+ $FluxOrders->setStoreId( $iIdStore );
737
+ $FluxOrders->setCustomerId( $iIdCustomer );
738
+ $FluxOrders->setRequest( $strRequest );
739
+ $FluxOrders->setResponse( $strResponse );
740
+ $FluxOrders->setError(self::$errors[$iErrorCode]);
741
+ $FluxOrders->save();
742
+ }
743
+
744
+ public static function prepareLoginEx( $strCustomerMail, $strCustomerPasswordHash)
745
+ {
746
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
747
+ $SoapClient = new SoapClient( $wsdl, array( 'soap_version' => SOAP_1_2,
748
+ 'trace' => true,
749
+ 'classmap' => array( 'PrepareLogin' => 'Acegmbh_Flux_Model_Flux_Soap_Response_PrepareLogin' ),
750
+ 'cache_wsdl' => WSDL_CACHE_NONE
751
+ )
752
+ );
753
+
754
+ $soapRequest = array();
755
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
756
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
757
+ $soapRequest['ThemeID'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_theme_id');
758
+
759
+ $Doc = new DOMDocument('1.0', 'UTF-8');
760
+ $Doc->formatOutput = true;
761
+ $_Customer = $Doc->createElement('Customer');
762
+ $Doc->appendChild($_Customer);
763
+
764
+ $_EMail = $Doc->createElement('EMail',$strCustomerMail);
765
+ $_Customer->appendChild($_EMail);
766
+
767
+ $_Password = $Doc->createElement('PasswordHash', $strCustomerPasswordHash);
768
+ $_Customer->appendChild($_Password);
769
+
770
+ $soapRequest['XML'] = $Doc->saveXML();
771
+
772
+ try
773
+ {
774
+ $Result = $SoapClient->__call('PrepareLoginEx', array( 'parameters' => $soapRequest ) );
775
+ if( $Result->PrepareLoginExResult==true && $Result->ErrorCode==0 ){
776
+
777
+ return $Result->sURL;
778
+
779
+ } else {
780
+
781
+ return $Result->ErrorCode;
782
+ }
783
+ }
784
+ catch (SoapFault $Exception)
785
+ {
786
+ self::_log($Exception->getMessage());
787
+ return 'SOAP_EXCEPTION';
788
+
789
+ }
790
+ }
791
+
792
+ }
app/code/community/Acegmbh/Flux/Model/Adminhtml/System/Config/Source/Licenceids.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Acegmbh_Flux_Model_Adminhtml_System_Config_Source_Licenceids
3
+ extends Mage_Core_Model_Abstract
4
+ {
5
+ /**
6
+ * Options getter
7
+ *
8
+ * @return array
9
+ */
10
+ static public function getAllOptions()
11
+ //public function toOptionArray()
12
+ {
13
+ /*
14
+ return array(
15
+ '19' => Mage::helper('flux')->__('19 - permanent download/up to three devices'),
16
+ '241' => Mage::helper('catalog')->__('241 - another Licence ID')
17
+ );
18
+ */
19
+ $arr = Mage::helper('flux')->getLicenses();
20
+
21
+ $arrReturn = array();
22
+ foreach( $arr as $license )
23
+ {
24
+ $arrReturn[] = array( 'value' => $license->ID,
25
+ 'label' => $license->Name);
26
+ }
27
+
28
+ // $arrReturn[] = array( 'value' => 241,
29
+ // 'label' => '241 - another Licence ID');
30
+ return $arrReturn;
31
+ }
32
+ }
app/code/community/Acegmbh/Flux/Model/Adminhtml/System/Config/Source/Projectids.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Acegmbh_Flux_Model_Adminhtml_System_Config_Source_Projectids
3
+ extends Mage_Core_Model_Abstract
4
+ {
5
+ /**
6
+ * Options getter
7
+ *
8
+ * @return array
9
+ */
10
+ static public function getAllOptions()
11
+ //public function toOptionArray()
12
+ {
13
+ /*
14
+ return array(
15
+ '19' => Mage::helper('flux')->__('19 - permanent download/up to three devices'),
16
+ '241' => Mage::helper('catalog')->__('241 - another Licence ID')
17
+ );
18
+ */
19
+ $arr = Mage::helper('flux')->getProjects();
20
+
21
+ $arrReturn = array();
22
+ foreach( $arr as $project )
23
+ {
24
+ $arrReturn[] = array( 'value' => $project->LongProjectID,
25
+ 'label' => $project->Name);
26
+
27
+ /*
28
+ <LongProjectID>0000-5517-51C6-E730</LongProjectID>
29
+ <Name>Big Buck Bunny</Name>
30
+ <CreationDate>2013-10-05T12:27:50</CreationDate>
31
+ <ContentType>fluxDVD</ContentType>
32
+ <Complete>true</Complete>
33
+ */
34
+ }
35
+
36
+ // $arrReturn[] = array( 'value' => 241,
37
+ // 'label' => '241 - another Licence ID');
38
+ return $arrReturn;
39
+ }
40
+ }
app/code/community/Acegmbh/Flux/Model/Adminhtml/System/Config/Source/Wsdlurls.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Acegmbh_Flux_Model_Adminhtml_System_Config_Source_Wsdlurls
3
+ {
4
+ /**
5
+ * Options getter
6
+ *
7
+ * @return array
8
+ */
9
+ public function toOptionArray()
10
+ {
11
+ $arrReturn = array();
12
+ $arrReturn[] = array( 'value' => 'http://sandbox.flickrocket.com/services/OnDemandOrder/Service.asmx?WSDL',
13
+ 'label' => 'Sandbox');
14
+ $arrReturn[] = array( 'value' => 'http://www.flickrocket.com/services/OnDemandOrder/Service.asmx?WSDL',
15
+ 'label' => 'Live');
16
+
17
+ return $arrReturn;
18
+ }
19
+ }
app/code/community/Acegmbh/Flux/Model/Customer.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Customer
4
+ extends Mage_Customer_Model_Customer
5
+ {
6
+
7
+ /*
8
+ public function setPassword($password)
9
+ {
10
+ $this->setData('password', $password);
11
+ $strHash = $this->hashPassword($password, 'MD');
12
+ $this->setPasswordHash($strHash);
13
+ return $this;
14
+ }
15
+ */
16
+ /**
17
+ * Hash customer password
18
+ *
19
+ * @param string $password
20
+ * @param int $salt
21
+ * @return string
22
+ */
23
+ public function hashPassword($password, $salt = null)
24
+ {
25
+ return Mage::helper('core')->getHash($password, 'MD');
26
+ }
27
+ }
app/code/community/Acegmbh/Flux/Model/Customer/Entity/Customer.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Customer_Entity_Customer
4
+ extends Mage_Customer_Model_Entity_Customer
5
+ {
6
+
7
+ /**
8
+ * Change password.
9
+ *
10
+ * @param Mage_Customer_Model_Customer $Customer
11
+ * @param string $newPassword
12
+ *
13
+ * @return true or a negative error code
14
+ *
15
+ * -2 XML invalid
16
+ * -3 Customer node is missing
17
+ * -4 Customer not found
18
+ * -5 Password missing
19
+ * -6 Node empty
20
+ */
21
+ public function changePassword(Mage_Customer_Model_Customer $Customer, $newPassword)
22
+ {
23
+ Mage::log('changePassword in Acegmbh_Flux_Model_Customer_Entity_Customer', null, 'Acegmbh_Flux_Customer.log', true);
24
+
25
+ $Customer->setPassword($newPassword);
26
+ $this->saveAttribute($Customer, 'password_hash');
27
+ $customerId = $Customer->getId();
28
+ $strPasswdHash = $Customer->getPasswordHash();
29
+
30
+ Mage::helper('flux')->changeCustomerPassword( $Customer->getEmail(),
31
+ $strPasswdHash,
32
+ true,
33
+ $newPassword,
34
+ false );
35
+ return parent::changePassword($Customer, $newPassword);
36
+
37
+ /*
38
+ if (Acegmbh_Flux_Model_Flux_Tools::isFluxUser($customerId))
39
+ {
40
+ $wsdl = Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl');
41
+ $SoapClient = new SoapClient($wsdl,
42
+ array(
43
+ 'soap_version' => SOAP_1_2,
44
+ 'trace' => true,
45
+ 'classmap' => array(
46
+ 'CreateCustomerPasswordResponse' => 'Acegmbh_Flux_Model_Flux_Soap_Response_ChangeCustomerPassword'
47
+ ),
48
+ 'cache_wsdl' => WSDL_CACHE_NONE
49
+ )
50
+ );
51
+
52
+ $fluxPassword = substr($password, 0, strpos($password, ':'));
53
+ $soapRequest = array();
54
+ $soapRequest['EMail'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
55
+ $soapRequest['Password'] = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
56
+
57
+ $Doc = new DOMDocument('1.0', 'UTF-8');
58
+ $Doc->formatOutput = true;
59
+ $_Customer = $Doc->createElement('Customer');
60
+ $Doc->appendChild($_Customer);
61
+ $_Email = $Doc->createElement('Email', $Customer->getEmail());
62
+ $_Customer->appendChild($_Email);
63
+ $Password = $Doc->createElement('PasswordHash', $fluxPassword);
64
+ $_Customer->appendChild($Password);
65
+ $soapRequest['XML'] = $Doc->saveXML();
66
+ try
67
+ {
68
+ $Result = $SoapClient->__call('CreateShopOrder',
69
+ array(
70
+ 'parameters' => $soapRequest
71
+ )
72
+ );
73
+ }
74
+ catch (SoapFault $Exception)
75
+ {
76
+ Mage::logException($Exception);
77
+ continue;
78
+ }
79
+ }
80
+ */
81
+ return $this;
82
+ }
83
+ }
app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/ChangeCustomerEMail.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Flux_Soap_Response_ChangeCustomerEMail
4
+ {
5
+ /**
6
+ * @var bool $ChangeCustomerPassword
7
+ */
8
+ public $ChangeCustomerEMail = false;
9
+
10
+ /**
11
+ * @var int $ErrorCode
12
+ */
13
+ public $ErrorCode;
14
+ }
app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/ChangeCustomerPassword.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Flux_Soap_Response_ChangeCustomerPassword
4
+ {
5
+ /**
6
+ * @var bool $ChangeCustomerPassword
7
+ */
8
+ public $ChangeCustomerPassword = false;
9
+
10
+ /**
11
+ * @var int $ErrorCode
12
+ */
13
+ public $ErrorCode;
14
+ }
app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/CheckUserExists.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Flux_Soap_Response_CheckUserExists
4
+ {
5
+ /**
6
+ * @var bool $CheckUserExistsResult
7
+ */
8
+ public $CheckUserExistsResult = false;
9
+
10
+ /**
11
+ * @var int $ErrorCode
12
+ */
13
+ public $ErrorCode;
14
+ }
app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/CreateShopOrder.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Flux_Soap_Response_CreateShopOrder
4
+ {
5
+ /**
6
+ * @var bool $CreateShopOrderResult
7
+ */
8
+ public $CreateShopOrderResult = false;
9
+
10
+ /**
11
+ * @var int $ErrorCode
12
+ */
13
+ public $ErrorCode;
14
+ }
app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/GetLicenses.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Flux_Soap_Response_GetLicenses
4
+ {
5
+ public $GetLicensesResult;
6
+ public $Licenses;
7
+ /*
8
+ * <stLicense>
9
+ * <ID>15</ID>
10
+ * <Name>Rental (24 hours)</Name>
11
+ * <LicType>ltFlickRocket</LicType>
12
+ * </stLicense>
13
+ * */
14
+
15
+ /**
16
+ * @var int $ErrorCode
17
+ */
18
+ public $ErrorCode;
19
+ }
app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/GetProjects.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Flux_Soap_Response_GetProjects
4
+ {
5
+ /**
6
+ * @var int $ErrorCode
7
+ */
8
+ public $ErrorCode;
9
+ }
app/code/community/Acegmbh/Flux/Model/Flux/Soap/Response/PrepareLogin.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Flux_Soap_Response_PrepareLogin
4
+ {
5
+ /**
6
+ * @var bool $PrepareLoginResult
7
+ */
8
+ public $PrepareLoginResult = false;
9
+
10
+ /**
11
+ * @var int $ErrorCode
12
+ */
13
+ public $ErrorCode;
14
+
15
+ /**
16
+ * @var string $sGUID
17
+ */
18
+ public $sGUID;
19
+ }
app/code/community/Acegmbh/Flux/Model/Mysql4/Orders.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Mysql4_Orders
4
+ extends Mage_Core_Model_Mysql4_Abstract
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ */
11
+ public function _construct()
12
+ {
13
+ $this->_init('flux/orders', 'flux_order_id');
14
+ }
15
+ }
app/code/community/Acegmbh/Flux/Model/Mysql4/Orders/Collection.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Mysql4_Orders_Collection
4
+ extends Mage_Core_Model_Mysql4_Collection_Abstract
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return void
14
+ */
15
+ public function _construct()
16
+ {
17
+ $this->_init('flux/orders');
18
+ }
19
+ }
app/code/community/Acegmbh/Flux/Model/Mysql4/Users.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Mysql4_Users
4
+ extends Mage_Core_Model_Mysql4_Abstract
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ */
11
+ public function _construct()
12
+ {
13
+ $this->_init('flux/users', 'flux_user_id');
14
+ }
15
+ }
app/code/community/Acegmbh/Flux/Model/Mysql4/Users/Collection.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Mysql4_Users_Collection
4
+ extends Mage_Core_Model_Mysql4_Collection_Abstract
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return void
14
+ */
15
+ public function _construct()
16
+ {
17
+ $this->_init('flux/users');
18
+ }
19
+ }
app/code/community/Acegmbh/Flux/Model/Observer.php ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Observer
4
+ {
5
+ const LOGFILE = 'Acegmbh_Flux_Model_Observer.log';
6
+
7
+ public function _log( $strLogMessage )
8
+ {
9
+ Mage::log($strLogMessage, null, self::LOGFILE );
10
+ }
11
+
12
+ public function placeOrder(Varien_Event_Observer $Observer)
13
+ {
14
+ self::_log('placeOrder');
15
+
16
+ $Event = $Observer->getEvent();
17
+ // echo '<pre>';
18
+ // print_r($Event);
19
+ // $object = new ReflectionObject($Event);
20
+ // var_dump($object->getMethods());
21
+ // echo '</pre>';
22
+ // die();
23
+ $Order = $Event->getOrder();
24
+ if( $Order==null )
25
+ {
26
+ $arrOrderIds = $Observer->getOrderIds();
27
+ $iIdOrder = $arrOrderIds[0];
28
+ $Order = Mage::getModel('sales/order')->load($iIdOrder);
29
+ }
30
+ self::_log('idorder: ' . $iIdOrder);
31
+ if( $Order==null )
32
+ {
33
+ throw new Exception("Zahlung konnte nicht abgeschlossen werden! Bitte wenden Sie sich an den Support.");
34
+ }
35
+ $Customer = Mage::getModel('customer/customer')->load($Order->getCustomerId());
36
+
37
+ $strEmail = $Customer->getEmail();
38
+ $strPassword = $_SESSION['flux_customer_password'];
39
+ $strHashedPw = Mage::getModel('customer/customer')->hashPassword($strPassword);
40
+ $iTransactionId = '99999' . $Customer->getId();
41
+
42
+ self::_log('email: ' . $strEmail);
43
+ self::_log('transactionid: ' . $iTransactionId);
44
+
45
+ if( !empty($strPassword) )
46
+ {
47
+ $strResultCreate = Mage::helper('flux')->createShopUser($iTransactionId,
48
+ $strEmail,
49
+ $strHashedPw,
50
+ true );
51
+ if( $strResultCreate=='OK' )
52
+ {
53
+ // User erfolgreich neu angelegt, oder User mit gleichem Passwort bereits in Flux verfügbar
54
+ }
55
+ elseif( $strResultCreate=='PASSWORD_WRONG' )
56
+ {
57
+ $strResultCheck = Mage::helper('flux')->checkUserExists($strEmail,
58
+ $strPassword,
59
+ false);
60
+ if( $strResultCheck=='OK' )
61
+ {
62
+ // echo 'User in Flux verfügbar, Password korrekt, Passworthash falsch. PasswordHash anpassen.';
63
+ $strResultChange = Mage::helper('flux')->changeCustomerPassword($strEmail,
64
+ $strPassword,
65
+ false,
66
+ $strHashedPw,
67
+ true );
68
+ }
69
+ elseif( $strResultCheck=='PASSWORD_WRONG' )
70
+ {
71
+ /**
72
+ * this should never happen(!) because the same check is in the billing-step of onepage checkout
73
+ **/
74
+ self::_log('ERROR: User (' . $strEmail .') exists in Flux, but with an other password', null, 'Acegmbh_Flux_Data.log', true);
75
+
76
+ // ('Der Benutzer ist in Flux bereits verfügbar, allerdings unter mit einem anderen Passwort.');
77
+ }
78
+ }
79
+ else
80
+ {
81
+ self::_log('SOAP_ERROR in Observer->createFluxUser', null, 'Acegmbh_Flux_Data.log', true);
82
+ }
83
+ }
84
+
85
+ $FluxHelper = Mage::helper('flux');
86
+ $FluxHelper->createShopOrder($Order);
87
+ }
88
+
89
+ public function createFluxUser(Varien_Event_Observer $Observer)
90
+ {
91
+ self::_log('createFluxUser');
92
+
93
+ $Event = $Observer->getEvent();
94
+ $Customer = $Event->getCustomer();
95
+
96
+ $strEmail = $Customer->getEmail();
97
+ $strPassword = $Customer->getPassword();
98
+ $strHashedPw = Mage::getModel('customer/customer')->hashPassword($strPassword);
99
+ $iTransactionId = '99999' . $Customer->getId();
100
+
101
+ self::_log('email: ' . $strEmail);
102
+ self::_log('transactionid: ' . $iTransactionId);
103
+
104
+ $strResultCreate = Mage::helper('flux')->createShopUser($iTransactionId,
105
+ $strEmail,
106
+ $strHashedPw,
107
+ true );
108
+ if( $strResultCreate=='OK' )
109
+ {
110
+ // User erfolgreich neu angelegt, oder User mit gleichem Passwort bereits in Flux verfügbar
111
+ }
112
+ elseif( $strResultCreate=='PASSWORD_WRONG' )
113
+ {
114
+ $strResultCheck = Mage::helper('flux')->checkUserExists($strEmail,
115
+ $strPassword,
116
+ false);
117
+ if( $strResultCheck=='OK' )
118
+ {
119
+ // echo 'User in Flux verfügbar, Password korrekt, Passworthash falsch. PasswordHash anpassen.';
120
+ $strResultChange = Mage::helper('flux')->changeCustomerPassword($strEmail,
121
+ $strPassword,
122
+ false,
123
+ $strHashedPw,
124
+ true );
125
+ }
126
+ elseif( $strResultCheck=='PASSWORD_WRONG' )
127
+ {
128
+ /**
129
+ * this should never happen(!) because the same check is in $this->checkFluxUser()
130
+ **/
131
+ self::_log('ERROR: User (' . $strEmail .') exists in Flux, but with an other password', null, 'Acegmbh_Flux_Data.log', true);
132
+ // ('Der Benutzer ist in Flux bereits verfügbar, allerdings unter mit einem anderen Passwort.');
133
+ }
134
+ }
135
+ else
136
+ {
137
+ self::_log('SOAP_ERROR in Observer->createFluxUser', null, 'Acegmbh_Flux_Data.log', true);
138
+ }
139
+ }
140
+
141
+ public function checkFluxUser(Varien_Event_Observer $Observer)
142
+ {
143
+ self::_log('checkFluxUser');
144
+
145
+ //get input params
146
+ $request = Mage::app()->getFrontController()->getRequest();
147
+ $email = $request->getParam('email');
148
+ $password = $request->getParam('password');
149
+
150
+ //let the normal validation handle this
151
+ if (empty($email) || empty($password)) return;
152
+
153
+ /** for regular "create customer" form **/
154
+ $strEmail = $email;
155
+ $strPassword = $password;
156
+ $strResultCheck = Mage::helper('flux')->checkUserExists($strEmail,
157
+ $strPassword,
158
+ false);
159
+ if( $strResultCheck=='PASSWORD_WRONG' )
160
+ {
161
+ Mage::getSingleton('customer/session')->addError('Ihre E-Mail-Adresse ist bereits in Flux angelegt. Bitte verwenden Sie das Passwort aus Ihrem Flux Account.');
162
+ $url = Mage::getModel('core/url') ->getUrl('*/*/create');
163
+ Mage::app()->getResponse()->setRedirect($url);
164
+ Mage::app()->getResponse()->sendResponse();
165
+ exit;
166
+ }
167
+
168
+ }
169
+
170
+ public function changeFluxPw(Varien_Event_Observer $Observer)
171
+ {
172
+ self::_log('changeFluxPw');
173
+
174
+
175
+ // Check if it happens somewhere in the customer module
176
+ $request = Mage::app()->getFrontController()->getRequest();
177
+ $module = $request->getModuleName();
178
+ //$controller = $request->getControllerName();
179
+ //$action = $request->getActionName();
180
+ if ( 'customer' != $module ) return;
181
+
182
+ $event = $Observer->getEvent();
183
+ $customer = $event->getCustomer();
184
+ $postData = Mage::app()->getRequest()->getPost();
185
+ if($customer instanceof Mage_Customer_Model_Customer && !$customer->isObjectNew())
186
+ {
187
+ if( $postData['change_password'] == 1 && $postData['current_password'] != $postData['password'] )
188
+ {
189
+ Mage::helper('flux')->changeCustomerPassword( $customer->getEmail(),
190
+ $postData['current_password'],
191
+ false,
192
+ $postData['password'],
193
+ false );
194
+ }
195
+ }
196
+ return $this;
197
+ }
198
+
199
+ }
app/code/community/Acegmbh/Flux/Model/Orders.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Orders
4
+ extends Mage_Core_Model_Abstract
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return void
14
+ */
15
+ public function _construct()
16
+ {
17
+ parent::_construct();
18
+ $this->_init('flux/orders');
19
+ }
20
+ }
app/code/community/Acegmbh/Flux/Model/Users.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Model_Users
4
+ extends Mage_Core_Model_Abstract
5
+ {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return void
14
+ */
15
+ public function _construct()
16
+ {
17
+ parent::_construct();
18
+ $this->_init('flux/users');
19
+ }
20
+ }
app/code/community/Acegmbh/Flux/controllers/Adminhtml/AdminController.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Adminhtml_AdminController
4
+ extends Mage_Adminhtml_Controller_Action
5
+ {
6
+ /**
7
+ * Initialisation action.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return object
14
+ */
15
+ protected function _initAction()
16
+ {
17
+ $this->loadLayout()
18
+ ->_setActiveMenu('flickrocket_admin')
19
+ ->_addBreadcrumb(Mage::helper('flux')->__('FlickRocket SOAP Log'), Mage::helper('flux')->__('FlickRocket SOAP Log'));
20
+ return $this;
21
+ }
22
+
23
+ /**
24
+ * Index action.
25
+ *
26
+ * @version 0.1
27
+ *
28
+ * @param void
29
+ *
30
+ * @return void
31
+ */
32
+ public function indexAction()
33
+ {
34
+ $this->_initAction();
35
+ $this->loadLayout();
36
+ $this->_addContent($this->getLayout()->createBlock('adminhtml/template')->setTemplate('flux/admin.phtml'));
37
+ $this->renderLayout();
38
+
39
+ }
40
+
41
+ /**
42
+ * Edit action.
43
+ *
44
+ * @version 0.1
45
+ *
46
+ * @param void
47
+ *
48
+ * @return void
49
+ */
50
+ public function editAction()
51
+ {
52
+
53
+ }
54
+
55
+ /**
56
+ * New action.
57
+ *
58
+ * @version 0.1
59
+ *
60
+ * @param void
61
+ *
62
+ * @return void
63
+ */
64
+ public function newAction()
65
+ {
66
+
67
+ }
68
+
69
+ /**
70
+ * Save action.
71
+ *
72
+ * @version 0.1
73
+ *
74
+ * @param void
75
+ *
76
+ * @return void
77
+ */
78
+ public function saveAction()
79
+ {
80
+
81
+ }
82
+
83
+ /**
84
+ * Delete action.
85
+ *
86
+ * @version 0.1
87
+ *
88
+ * @param void
89
+ *
90
+ * @return void
91
+ */
92
+ public function deleteAction()
93
+ {
94
+
95
+ }
96
+
97
+ /**
98
+ * Grid action.
99
+ *
100
+ * @version 0.1
101
+ *
102
+ * @param void
103
+ *
104
+ * @return void
105
+ */
106
+ public function gridAction()
107
+ {
108
+ $this->loadLayout();
109
+ $this->getResponse()->setBody(
110
+ $this->getLayout()->createBlock('importedit/adminhtml_flux_grid')->toHtml()
111
+ );
112
+ }
113
+ }
app/code/community/Acegmbh/Flux/controllers/Adminhtml/FluxController.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Adminhtml_FluxController
4
+ extends Mage_Adminhtml_Controller_Action
5
+ {
6
+ /**
7
+ * Initialisation action.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return object
14
+ */
15
+ protected function _initAction()
16
+ {
17
+ $this->loadLayout()
18
+ ->_setActiveMenu('sales/flux')
19
+ ->_addBreadcrumb(Mage::helper('flux')->__('FlickRocket SOAP Log'), Mage::helper('flux')->__('FlickRocket SOAP Log'));
20
+ return $this;
21
+ }
22
+
23
+ /**
24
+ * Index action.
25
+ *
26
+ * @version 0.1
27
+ *
28
+ * @param void
29
+ *
30
+ * @return void
31
+ */
32
+ public function indexAction()
33
+ {
34
+ $this->_initAction();
35
+ $this->renderLayout();
36
+ }
37
+
38
+ /**
39
+ * Edit action.
40
+ *
41
+ * @version 0.1
42
+ *
43
+ * @param void
44
+ *
45
+ * @return void
46
+ */
47
+ public function editAction()
48
+ {
49
+
50
+ }
51
+
52
+ /**
53
+ * New action.
54
+ *
55
+ * @version 0.1
56
+ *
57
+ * @param void
58
+ *
59
+ * @return void
60
+ */
61
+ public function newAction()
62
+ {
63
+
64
+ }
65
+
66
+ /**
67
+ * Save action.
68
+ *
69
+ * @version 0.1
70
+ *
71
+ * @param void
72
+ *
73
+ * @return void
74
+ */
75
+ public function saveAction()
76
+ {
77
+
78
+ }
79
+
80
+ /**
81
+ * Delete action.
82
+ *
83
+ * @version 0.1
84
+ *
85
+ * @param void
86
+ *
87
+ * @return void
88
+ */
89
+ public function deleteAction()
90
+ {
91
+
92
+ }
93
+
94
+ /**
95
+ * Grid action.
96
+ *
97
+ * @version 0.1
98
+ *
99
+ * @param void
100
+ *
101
+ * @return void
102
+ */
103
+ public function gridAction()
104
+ {
105
+ $this->loadLayout();
106
+ $this->getResponse()->setBody(
107
+ $this->getLayout()->createBlock('importedit/adminhtml_flux_grid')->toHtml()
108
+ );
109
+ }
110
+ }
app/code/community/Acegmbh/Flux/controllers/Adminhtml/UploadController.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_Adminhtml_UploadController
4
+ extends Mage_Adminhtml_Controller_Action
5
+ {
6
+ /**
7
+ * Initialisation action.
8
+ *
9
+ * @version 0.1
10
+ *
11
+ * @param void
12
+ *
13
+ * @return object
14
+ */
15
+ protected function _initAction()
16
+ {
17
+ $this->loadLayout()
18
+ ->_setActiveMenu('flickrocket_admin')
19
+ ->_addBreadcrumb(Mage::helper('flux')->__('FlickRocket SOAP Log'), Mage::helper('flux')->__('FlickRocket SOAP Log'));
20
+ return $this;
21
+ }
22
+
23
+ /**
24
+ * Index action.
25
+ *
26
+ * @version 0.1
27
+ *
28
+ * @param void
29
+ *
30
+ * @return void
31
+ */
32
+ public function indexAction()
33
+ {
34
+ $this->_initAction();
35
+ $this->loadLayout();
36
+ $this->_addContent($this->getLayout()->createBlock('adminhtml/template')->setTemplate('flux/upload.phtml'));
37
+ $this->renderLayout();
38
+
39
+ }
40
+
41
+ /**
42
+ * Edit action.
43
+ *
44
+ * @version 0.1
45
+ *
46
+ * @param void
47
+ *
48
+ * @return void
49
+ */
50
+ public function editAction()
51
+ {
52
+
53
+ }
54
+
55
+ /**
56
+ * New action.
57
+ *
58
+ * @version 0.1
59
+ *
60
+ * @param void
61
+ *
62
+ * @return void
63
+ */
64
+ public function newAction()
65
+ {
66
+
67
+ }
68
+
69
+ /**
70
+ * Save action.
71
+ *
72
+ * @version 0.1
73
+ *
74
+ * @param void
75
+ *
76
+ * @return void
77
+ */
78
+ public function saveAction()
79
+ {
80
+
81
+ }
82
+
83
+ /**
84
+ * Delete action.
85
+ *
86
+ * @version 0.1
87
+ *
88
+ * @param void
89
+ *
90
+ * @return void
91
+ */
92
+ public function deleteAction()
93
+ {
94
+
95
+ }
96
+
97
+ /**
98
+ * Grid action.
99
+ *
100
+ * @version 0.1
101
+ *
102
+ * @param void
103
+ *
104
+ * @return void
105
+ */
106
+ public function gridAction()
107
+ {
108
+ $this->loadLayout();
109
+ $this->getResponse()->setBody(
110
+ $this->getLayout()->createBlock('importedit/adminhtml_flux_grid')->toHtml()
111
+ );
112
+ }
113
+ }
app/code/community/Acegmbh/Flux/controllers/Checkout/OnepageController.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ # Controllers are not autoloaded so we will have to do it manually:
3
+ $strPath = Mage::getBaseDir('code') . DIRECTORY_SEPARATOR .
4
+ 'core' . DIRECTORY_SEPARATOR .
5
+ 'Mage' . DIRECTORY_SEPARATOR .
6
+ 'Checkout' . DIRECTORY_SEPARATOR .
7
+ 'controllers' . DIRECTORY_SEPARATOR .
8
+ 'OnepageController.php';
9
+ require_once($strPath);
10
+ class Acegmbh_Flux_Checkout_OnepageController extends Mage_Checkout_OnepageController
11
+ {
12
+ /*
13
+ # Overloaded indexAction
14
+ public function indexAction() {
15
+ // die('Yes, I did it!');
16
+
17
+ parent::indexAction();
18
+ }
19
+ */
20
+ public function saveBillingAction()
21
+ {
22
+ $data = $this->getRequest()->getPost('billing', array());
23
+ //let the normal validation handle this
24
+ if (empty($data['email']) || empty($data['customer_password'])){
25
+
26
+ parent::saveBillingAction();
27
+ return;
28
+
29
+ }
30
+
31
+ $strEmail = $data['email'];
32
+ $strPassword = $data['customer_password'];
33
+ $_SESSION['flux_customer_password'] = $strPassword;
34
+ $strResultCheck = Mage::helper('flux')->checkUserExists($strEmail,
35
+ $strPassword,
36
+ false);
37
+ if( $strResultCheck=='PASSWORD_WRONG' )
38
+ {
39
+ $result = array('error' => 1,
40
+ 'message' => Mage::helper('flux')->__('Ihre E-Mail-Adresse ist bereits in Flux angelegt. Bitte verwenden Sie das Passwort aus Ihrem Flux Account.')
41
+ );
42
+ $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
43
+ }
44
+ else
45
+ {
46
+ parent::saveBillingAction();
47
+ }
48
+
49
+ //die();
50
+ //die('saveBillingAction');
51
+ }
52
+ }
app/code/community/Acegmbh/Flux/controllers/IndexController.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Acegmbh_Flux_IndexController extends
4
+ Mage_Adminhtml_Controller_Action
5
+ {
6
+ public function indexAction()
7
+ {
8
+ $this->loadLayout();
9
+ $this->renderLayout();
10
+ }
11
+ }
app/code/community/Acegmbh/Flux/etc/adminhtml.xml ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <menu>
3
+ <sales>
4
+ <children>
5
+ <flux module="flux">
6
+ <title>FlickRocket SOAP Log</title>
7
+ <sort_order>900</sort_order>
8
+ <action>flux/adminhtml_flux</action>
9
+ </flux>
10
+ </children>
11
+ </sales>
12
+ <flickrocket module="flux">
13
+ <title>Flickrocket</title>
14
+ <sort_order>900</sort_order>
15
+ <children>
16
+ <flickrocket_admin module="flux">
17
+ <title>FlickRocket Admin</title>
18
+ <sort_order>100</sort_order>
19
+ <action>flux/adminhtml_admin</action>
20
+ </flickrocket_admin>
21
+ </children>
22
+ <children>
23
+ <flickrocket_upload module="flux">
24
+ <title>FlickRocket Content Upload</title>
25
+ <sort_order>200</sort_order>
26
+ <action>flux/adminhtml_upload</action>
27
+ </flickrocket_upload>
28
+ </children>
29
+ </flickrocket>
30
+ </menu>
31
+ <acl>
32
+ <resources>
33
+ <admin>
34
+ <children>
35
+ <system>
36
+ <children>
37
+ <config>
38
+ <children>
39
+ <acegmbh_flux>
40
+ <title>FlickRocket Configuration</title>
41
+ <sort_order>900</sort_order>
42
+ </acegmbh_flux>
43
+ </children>
44
+ </config>
45
+ </children>
46
+ </system>
47
+ </children>
48
+ </admin>
49
+ </resources>
50
+ </acl>
51
+ </config>
app/code/community/Acegmbh/Flux/etc/config.xml ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Acegmbh_Flux>
5
+ <version>0.1.0</version>
6
+ </Acegmbh_Flux>
7
+ </modules>
8
+ <admin>
9
+ <routers>
10
+ <flux>
11
+ <use>admin</use>
12
+ <args>
13
+ <module>Acegmbh_Flux</module>
14
+ <frontName>flux</frontName>
15
+ </args>
16
+ </flux>
17
+ </routers>
18
+ </admin>
19
+ <adminhtml>
20
+ <layout>
21
+ <updates>
22
+ <flux>
23
+ <file>acegmbh_flux.xml</file>
24
+ </flux>
25
+ </updates>
26
+ </layout>
27
+ </adminhtml>
28
+
29
+ <frontend>
30
+ <translate>
31
+ <modules>
32
+ <Acegmbh_Flux>
33
+ <files>
34
+ <default>Acegmbh_Flux.csv</default>
35
+ </files>
36
+ </Acegmbh_Flux>
37
+ </modules>
38
+ </translate>
39
+ <layout>
40
+ <updates>
41
+ <dlmanagerlinks>
42
+ <file>flux.xml</file>
43
+ </dlmanagerlinks>
44
+ </updates>
45
+ </layout>
46
+ <routers>
47
+ <checkout>
48
+ <args>
49
+ <modules>
50
+ <Acegmbh_Flux before="Mage_Checkout">Acegmbh_Flux_Checkout</Acegmbh_Flux>
51
+ </modules>
52
+ </args>
53
+ </checkout>
54
+ </routers>
55
+ </frontend>
56
+
57
+ <global>
58
+ <models>
59
+ <flux>
60
+ <class>Acegmbh_Flux_Model</class>
61
+ <resourceModel>flux_mysql4</resourceModel>
62
+ </flux>
63
+ <flux_mysql4>
64
+ <class>Acegmbh_Flux_Model_Mysql4</class>
65
+ <entities>
66
+ <orders>
67
+ <table>flux_orders</table>
68
+ </orders>
69
+ <users>
70
+ <table>flux_users</table>
71
+ </users>
72
+ </entities>
73
+ </flux_mysql4>
74
+ <customer>
75
+ <rewrite>
76
+ <customer>Acegmbh_Flux_Model_Customer</customer> <!-- needed to change pw-hash function effectively -->
77
+ </rewrite>
78
+ </customer>
79
+ <acegmbh_flux>
80
+ <class>Acegmbh_Flux_Model</class>
81
+ </acegmbh_flux>
82
+ </models>
83
+ <resources>
84
+ <flux_setup>
85
+ <setup>
86
+ <module>Acegmbh_Flux</module>
87
+ </setup>
88
+ <connection>
89
+ <use>core_setup</use>
90
+ </connection>
91
+ </flux_setup>
92
+ <flux_write>
93
+ <connection>
94
+ <use>core_write</use>
95
+ </connection>
96
+ </flux_write>
97
+ <flux_read>
98
+ <connection>
99
+ <use>core_read</use>
100
+ </connection>
101
+ </flux_read>
102
+ </resources>
103
+ <blocks>
104
+ <flux>
105
+ <class>Acegmbh_Flux_Block</class>
106
+ </flux>
107
+ </blocks>
108
+ <helpers>
109
+ <flux>
110
+ <class>Acegmbh_Flux_Helper</class>
111
+ </flux>
112
+ </helpers>
113
+ <events>
114
+ <checkout_onepage_controller_success_action>
115
+ <observers>
116
+ <Acegmbh_Flux>
117
+ <type>singleton</type>
118
+ <class>flux/observer</class>
119
+ <method>placeOrder</method>
120
+ </Acegmbh_Flux>
121
+ </observers>
122
+ </checkout_onepage_controller_success_action>
123
+ <!-- regular "create customer" form -->
124
+ <controller_action_predispatch_customer_account_createpost>
125
+ <observers>
126
+ <Acegmbh_Flux>
127
+ <type>singleton</type>
128
+ <class>flux/observer</class>
129
+ <method>checkFluxUser</method>
130
+ </Acegmbh_Flux>
131
+ </observers>
132
+ </controller_action_predispatch_customer_account_createpost>
133
+ <customer_register_success>
134
+ <observers>
135
+ <Acegmbh_Flux>
136
+ <type>singleton</type>
137
+ <class>flux/observer</class>
138
+ <method>createFluxUser</method>
139
+ </Acegmbh_Flux>
140
+ </observers>
141
+ </customer_register_success>
142
+ <customer_save_after>
143
+ <observers>
144
+ <Acegmbh_Flux>
145
+ <type>singleton</type>
146
+ <class>flux/observer</class>
147
+ <method>changeFluxPw</method>
148
+ </Acegmbh_Flux>
149
+ </observers>
150
+ </customer_save_after>
151
+ </events>
152
+ </global>
153
+ <default>
154
+ <acegmbh_flux>
155
+ <flux>
156
+ <flux_theme_id>828</flux_theme_id>
157
+ <flux_email>sandbox@flickrocket.com</flux_email>
158
+ <flux_password>sandbox1971</flux_password>
159
+ <flux_wsdl>http://sandbox.flickrocket.com/services/OnDemandOrder/Service.asmx?WSDL</flux_wsdl>
160
+ </flux>
161
+ </acegmbh_flux>
162
+ </default>
163
+ </config>
app/code/community/Acegmbh/Flux/etc/system.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <tabs>
3
+ <acegmbh translate="label"> <!-- module="all" -->
4
+ <label>Flickrocket Extension</label>
5
+ <sort_order>900</sort_order>
6
+ </acegmbh>
7
+ </tabs>
8
+ <sections>
9
+ <acegmbh_flux translate="label">
10
+ <label>General Settings</label>
11
+ <tab>acegmbh</tab>
12
+ <frontend_type>text</frontend_type>
13
+ <sort_order>999</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ <groups>
18
+ <flux translate="label">
19
+ <label>Configuration</label>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>900</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <flux_theme_id translate="label,comment">
27
+ <label>Theme ID</label>
28
+ <frontend_type>text</frontend_type>
29
+ <sort_order>1</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <comment>Unique Theme ID (see FlickRocket -> Shop -> Themes)</comment>
34
+ </flux_theme_id>
35
+ <flux_email translate="label,comment">
36
+ <label>Email Address</label>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>2</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ <comment>Email of user registered with FlickRocket with Shop Management permission</comment>
43
+ </flux_email>
44
+ <flux_password translate="label,comment">
45
+ <label>Password</label>
46
+ <frontend_type>password</frontend_type>
47
+ <sort_order>3</sort_order>
48
+ <show_in_default>1</show_in_default>
49
+ <show_in_website>1</show_in_website>
50
+ <show_in_store>1</show_in_store>
51
+ <comment>May be empty for generic sandbox environment</comment>
52
+ </flux_password>
53
+ <flux_wsdl translate="label,comment">
54
+ <label>Environment</label>
55
+ <frontend_type>select</frontend_type>
56
+ <source_model>
57
+ acegmbh_flux/adminhtml_system_config_source_wsdlurls
58
+ </source_model>
59
+ <sort_order>4</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ <comment>Select between live (productive) and sandbox (testing)</comment>
64
+ </flux_wsdl>
65
+ </fields>
66
+ </flux>
67
+ </groups>
68
+ </acegmbh_flux>
69
+ </sections>
70
+ </config>
app/code/community/Acegmbh/Flux/sql/flux_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $Installer = $this;
3
+ $Setup = new Mage_Eav_Model_Entity_Setup('core_setup');
4
+ $Setup->startSetup();
5
+
6
+ /**
7
+ * add attribute set 'FlickRocketProduct' and get its Id
8
+ */
9
+ $Setup->addAttributeSet(Mage_Catalog_Model_Product::ENTITY, 'FlickRocketProduct');
10
+ $iIdAttributeSet = $Setup->getAttributeSetId(Mage_Catalog_Model_Product::ENTITY, 'FlickRocketProduct');
11
+
12
+
13
+
14
+ /**
15
+ * get id of 'Default' attribute set
16
+ */
17
+ $attributeSetIdDefault = $Setup->getAttributeSetId(Mage_Catalog_Model_Product::ENTITY, 'Default');
18
+ // echo '--->'.$attributeSetId.'<---';
19
+
20
+ /**
21
+ * get groups of 'Default' attribute set
22
+ */
23
+ $attributes = array();
24
+ $groups = Mage::getModel('eav/entity_attribute_group')
25
+ ->getResourceCollection()
26
+ ->setAttributeSetFilter($attributeSetIdDefault)
27
+ ->setSortOrder()
28
+ ->load();
29
+ foreach ($groups as $node)
30
+ {
31
+ /*
32
+ [attribute_group_id] => 7
33
+ [attribute_set_id] => 4
34
+ [attribute_group_name] => General
35
+ [sort_order] => 1
36
+ [default_id] => 1
37
+ */
38
+ // echo '***'.$node->getAttributeGroupId().'***';
39
+ // echo '***'.$node->getAttributeSetId().'***';
40
+ // echo '***'.$node->getAttributeGroupName().'***';
41
+ // echo '***'.$node->getSortOrder().'***';
42
+ // echo '***'.$node->getDefaultId().'***';
43
+
44
+ /**
45
+ * add attribute group with same name
46
+ */
47
+ $Setup->addAttributeGroup( 'catalog_product',
48
+ 'FlickRocketProduct',
49
+ $node->getAttributeGroupName(),
50
+ $node->getSortOrder());
51
+ $attributeGroupId = $Setup->getAttributeGroup( 'catalog_product',
52
+ 'FlickRocketProduct',
53
+ $node->getAttributeGroupName());
54
+ $attributeGroupId = $attributeGroupId['attribute_group_id'];
55
+
56
+ $iAttributeGroupId = $node->getId();
57
+ $nodeChildren = Mage::getResourceModel('catalog/product_attribute_collection')
58
+ ->setAttributeGroupFilter($iAttributeGroupId)
59
+ //->addFieldToFilter('is_user_defined', true) # I was trying to get user defined attributes.
60
+ ->addVisibleFilter()
61
+ ->load();
62
+ if ($nodeChildren->getSize() > 0)
63
+ {
64
+ foreach ($nodeChildren->getItems() as $child)
65
+ {
66
+ // $child->getAttributeCode() );
67
+ $Setup->addAttributeToGroup(Mage_Catalog_Model_Product::ENTITY,
68
+ $iIdAttributeSet,
69
+ $attributeGroupId,
70
+ $child->getAttributeId(),
71
+ $child->getSortOrder());
72
+
73
+ }
74
+ }
75
+ }
76
+
77
+
78
+ // /**
79
+ // * get attribute group id of 'Default' attribute set of 'FlickRocketProduct' attribute set
80
+ // */
81
+ // $attributes = array();
82
+ // $groups = Mage::getModel('eav/entity_attribute_group')
83
+ // ->getResourceCollection()
84
+ // ->setAttributeSetFilter($iIdAttributeSet)
85
+ // ->setSortOrder()
86
+ // ->load();
87
+ // foreach ($groups as $node)
88
+ // {
89
+ // // preserve the attribute group id for later
90
+ // if( $node->getAttributeGroupName()=='General' )
91
+ // {
92
+ // $iIdAttributeGroup = $node->getAttributeGroupId();
93
+ // }
94
+ // if( $node->getAttributeGroupName()=='FlickRocket Attributes' )
95
+ // {
96
+ // $iIdAttributeGroupFlickRocket = $node->getAttributeGroupId();
97
+ // }
98
+ // }
99
+
100
+ // /**
101
+ // * get all attributes from 'Default' attribute set
102
+ // */
103
+ // $attributeSetId = $Setup->getAttributeSetId(Mage_Catalog_Model_Product::ENTITY, 'Default');
104
+ // $attributes = array();
105
+ // $groups = Mage::getModel('eav/entity_attribute_group')
106
+ // ->getResourceCollection()
107
+ // ->setAttributeSetFilter($attributeSetId)
108
+ // ->setSortOrder()
109
+ // ->load();
110
+ // foreach ($groups as $node)
111
+ // {
112
+ // $nodeChildren = Mage::getResourceModel('catalog/product_attribute_collection')
113
+ // ->setAttributeGroupFilter($node->getId())
114
+ // //->addFieldToFilter('is_user_defined', true) # I was trying to get user defined attributes.
115
+ // ->addVisibleFilter()
116
+ // ->load();
117
+ // if ($nodeChildren->getSize() > 0)
118
+ // {
119
+ // foreach ($nodeChildren->getItems() as $child)
120
+ // {
121
+ // $attr = array(
122
+ // 'id' => $child->getAttributeId(),
123
+ // 'text' => $child->getAttributeCode()
124
+ // );
125
+ // $attributes[] = $attr;
126
+
127
+ // $Setup->addAttributeToGroup(Mage_Catalog_Model_Product::ENTITY,
128
+ // $iIdAttributeSet,
129
+ // $node->getId(),
130
+ // $child->getAttributeId());
131
+ // }
132
+ // }
133
+ // }
134
+
135
+ /**
136
+ * add all 'Default' attributes to 'Default' attribute group of 'FlickRocketProduct' attribute set
137
+ */
138
+ // foreach( $attributes as $attri )
139
+ // {
140
+ // $iIdAttribute = $attri['id'];
141
+ // $Setup->addAttributeToGroup(Mage_Catalog_Model_Product::ENTITY,
142
+ // $iIdAttributeSet,
143
+ // $iIdAttributeGroup,
144
+ // $iIdAttribute);
145
+ // }
146
+
147
+ /**
148
+ * add attribute set group (to sort your attributes into)
149
+ */
150
+ $Setup->addAttributeGroup('catalog_product', 'FlickRocketProduct', 'FlickRocket Attributes', 1000);
151
+
152
+ /**
153
+ * add project_id attribute to attribute-set "FlickRocketProduct"
154
+ */
155
+ $Setup->addAttribute('catalog_product', 'project_id',
156
+ array(
157
+ 'group' => 'FlickRocket Attributes',
158
+ 'input' => 'select',
159
+ 'type' => 'int',
160
+ 'label' => 'Project ID',
161
+ 'backend' => '',
162
+ 'visible' => 1,
163
+ 'required' => 1,
164
+ 'user_defined' => 1,
165
+ 'searchable' => 0,
166
+ 'filterable' => 0,
167
+ 'comparable' => 0,
168
+ 'visible_on_front' => 0,
169
+ 'visible_in_advanced_search' => 0,
170
+ 'is_html_allowed_on_front' => 0,
171
+ 'source' => 'acegmbh_flux/adminhtml_system_config_source_projectids',
172
+ 'note' => 'Identifies the project in the FlickRocket',
173
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
174
+ 'apply_to' => 'downloadable',
175
+ )
176
+ );
177
+ $Setup->updateAttribute('catalog_product', 'project_id', 'apply_to', 'downloadable');
178
+ $attributeId = $Setup->getAttribute('catalog_product','project_id');
179
+ // echo '****'.$iIdAttributeSet.'****';
180
+ // echo '****'.$iIdAttributeGroupFlickRocket.'****';
181
+ // echo '****'.$attributeId.'****';
182
+ // print_r($attributeId);
183
+ // die('666');
184
+ $Setup->addAttributeToSet( 'catalog_product',
185
+ $iIdAttributeSet,
186
+ 'FlickRocket Attributes',
187
+ $attributeId['attribute_id']);
188
+ /**
189
+ * add license_id attribute to attribute-set "FlickRocketProduct"
190
+ */
191
+ $Setup->addAttribute('catalog_product', 'license_id',
192
+ array(
193
+ 'group' => 'FlickRocket Attributes',
194
+ 'input' => 'select',
195
+ 'type' => 'int',
196
+ 'label' => 'License ID',
197
+ 'backend' => '',
198
+ 'visible' => 1,
199
+ 'required' => 1,
200
+ 'user_defined' => 1,
201
+ 'searchable' => 0,
202
+ 'filterable' => 0,
203
+ 'comparable' => 0,
204
+ 'visible_on_front' => 0,
205
+ 'visible_in_advanced_search' => 0,
206
+ 'is_html_allowed_on_front' => 0,
207
+ 'source' => 'acegmbh_flux/adminhtml_system_config_source_licenceids',
208
+ 'note' => 'Select a license defining the DRM restrictions (e.g. 19 for permantent download/up to three devices)',
209
+ 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
210
+ 'apply_to' => 'downloadable',
211
+ )
212
+ );
213
+ $Setup->updateAttribute('catalog_product', 'license_id', 'apply_to', 'downloadable');
214
+ $attributeId = $Setup->getAttribute('catalog_product','license_id');
215
+ $Setup->addAttributeToSet( 'catalog_product',
216
+ $iIdAttributeSet,
217
+ 'FlickRocket Attributes',
218
+ $attributeId['attribute_id']);
219
+
220
+ $Setup->run("
221
+ DROP TABLE IF EXISTS `{$this->getTable('flux_orders')}`;
222
+ CREATE TABLE `{$this->getTable('flux_orders')}` (
223
+ `flux_order_id` int(11) unsigned NOT NULL auto_increment,
224
+ `order_id` int(11) unsigned NOT NULL,
225
+ `store_id` int(11) unsigned NOT NULL,
226
+ `customer_id` int(11) unsigned NOT NULL,
227
+ `request` text DEFAULT NULL,
228
+ `response` text DEFAULT NULL,
229
+ `error` varchar(100) DEFAULT NULL,
230
+ `date` timestamp DEFAULT CURRENT_TIMESTAMP,
231
+ PRIMARY KEY (`flux_order_id`)
232
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
233
+ ");
234
+
235
+ $Setup->endSetup();
app/design/adminhtml/default/default/layout/acegmbh_flux.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <flux_adminhtml_flux_index>
4
+ <reference name="content">
5
+ <block type="flux/adminhtml_flux" name="flux" />
6
+ </reference>
7
+ </flux_adminhtml_flux_index>
8
+ </layout>
app/design/adminhtml/default/default/template/flux/admin.phtml ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
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 default_default
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+
29
+ if ( Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl') == "http://sandbox.flickrocket.com/services/OnDemandOrder/Service.asmx?WSDL"){
30
+
31
+ $livemode = false;
32
+ if ("" == Mage::getStoreConfig('acegmbh_flux/flux/flux_email')){
33
+
34
+ $fluxUser = "sandbox@flickrocket.com";
35
+
36
+ } else {
37
+
38
+ $fluxUser = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
39
+
40
+ }
41
+
42
+ if ("" == Mage::getStoreConfig('acegmbh_flux/flux/flux_password')){
43
+
44
+ $fluxPW = "sandbox1971";
45
+
46
+ } else {
47
+
48
+ $fluxPW = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
49
+
50
+ }
51
+
52
+ } else {
53
+
54
+ $livemode = true;
55
+ $fluxUser = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
56
+ $fluxPW = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
57
+
58
+ }
59
+
60
+
61
+
62
+ if ($livemode){
63
+ ?>
64
+ <iframe src="http://www.flickrocket.com/App/Login.aspx?name=<?php echo $fluxUser;?>&password=<?php echo $fluxPW;?>&externaltype=1" width="100%" height="3000px">
65
+ <?php
66
+ } else{
67
+ ?>
68
+ <iframe src="http://sandbox.flickrocket.com/App/Login.aspx?name=<?php echo $fluxUser;?>&password=<?php echo $fluxPW;?>&externaltype=1" width="100%" height="3000px">
69
+ <?php
70
+ }
71
+ ?>
app/design/adminhtml/default/default/template/flux/upload.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
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 default_default
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+
29
+ if ( Mage::getStoreConfig('acegmbh_flux/flux/flux_wsdl') == "http://sandbox.flickrocket.com/services/OnDemandOrder/Service.asmx?WSDL"){
30
+
31
+ $livemode = false;
32
+ if ("" == Mage::getStoreConfig('acegmbh_flux/flux/flux_email')){
33
+
34
+ $fluxUser = "sandbox@flickrocket.com";
35
+
36
+ } else {
37
+
38
+ $fluxUser = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
39
+
40
+ }
41
+
42
+ if ("" == Mage::getStoreConfig('acegmbh_flux/flux/flux_password')){
43
+
44
+ $fluxPW = "sandbox1971";
45
+
46
+ } else {
47
+
48
+ $fluxPW = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
49
+
50
+ }
51
+
52
+ $fluxURL = "http://sandbox.flickrocket.com/FlickRocketContentTools/?name=" . $fluxUser . "&password=" . $fluxPW . "&theme=1&type=1";
53
+
54
+ } else {
55
+
56
+ $livemode = true;
57
+ $fluxUser = Mage::getStoreConfig('acegmbh_flux/flux/flux_email');
58
+ $fluxPW = Mage::getStoreConfig('acegmbh_flux/flux/flux_password');
59
+ $fluxURL = "http://www.flickrocket.com/FlickRocketContentTools/?name=" . $fluxUser . "&password=" . $fluxPW . "&theme=1&type=1";
60
+
61
+ }
62
+
63
+ //HTML output
64
+ ?>
65
+
66
+
67
+ <script type="text/javascript">
68
+ function popup(URL){
69
+ fenster = window.open(URL, 'FlickRocketContentTools', 'width=702,height=516,resizable=no,scrollbars=no,toolbar=no,status=no,location=no');
70
+ fenster.focus();
71
+ return false;
72
+ }
73
+ </script>
74
+ <br /><br />
75
+ <div Style="text-align:center;">
76
+ <p><h3><?php echo Mage::helper('flux')->__('Content can be uploaded by using one of the following options:');?></h3></p>
77
+ <br />
78
+
79
+ <a href="<?php echo $fluxURL;?>&externaltype=1&theme=" . Mage::getStoreConfig('acegmbh_flux/flux/flux_theme_id')" onclick="return popup(this.href)"><img src="<?php echo $this->getSkinUrl('images/flux/CloudIcon_Html5.png') ?>" alt="Html5"></a>
80
+ <p><h4><?php echo Mage::helper('flux')->__('Web based uploader');?></h4></p>
81
+
82
+ <a href="http://www.flickrocket.com/app/download_components.aspx?name=<?php echo $fluxUser; ?>&password=<?php echo $fluxPW ; ?>&component=FlickRocket" onclick="popup(this.href)"><img style="padding:5px;" src="<?php echo $this->getSkinUrl('images/flux/CloudIcon_Win.png') ?>" alt="Windows"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.flickrocket.com/app/download_components.aspx?name=<?php echo $fluxUser; ?>&password=<?php echo $fluxPW ; ?>&component=FlickRocket" onclick="popup(this.href)"><img style="padding:5px;" src="<?php echo $this->getSkinUrl('images/flux/CloudIcon_Apple.png') ?>" alt="Mac"></a>
83
+ <p><h4><?php echo Mage::helper('flux')->__('Download desktop software (Windows / MacOSX)');?></h4></p>
84
+ </div>
app/design/frontend/base/default/layout/flux.xml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Magento
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 design
23
+ * @package base_default
24
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
25
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
26
+ */
27
+
28
+ -->
29
+ <layout version="0.1.0">
30
+ <downloadable_customer_products translate="label">
31
+ <remove name="downloadable_customer_products_list"></remove>
32
+ <reference name="my.account.wrapper">
33
+ <block type="core/template" name="dlmlinks" template="flux/dlmanagerlinks.phtml"></block>
34
+ </reference>
35
+ </downloadable_customer_products>
36
+ <PRODUCT_TYPE_downloadable translate="label">
37
+ <remove name="product.info.downloadable.samples"></remove>
38
+ <reference name="product.info.downloadable.samples">
39
+ <block type="downloadable/catalog_product_samples" name="product.info.downloadable.samples" as="samples" template="flux/catalog/product/samples.phtml"/>
40
+ </block>
41
+ </reference>
42
+ </PRODUCT_TYPE_downloadable>
43
+ </layout>
app/design/frontend/base/default/template/flux/catalog/product/samples.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Downloadable_Block_Customer_Products_List
30
+ */
31
+ ?>
32
+
33
+ <?php
34
+
35
+ TADA
36
+
37
+ ?>
app/design/frontend/base/default/template/flux/dlmanagerlinks.phtml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php
28
+ /**
29
+ * @see Mage_Downloadable_Block_Customer_Products_List
30
+ */
31
+ ?>
32
+
33
+ <?php
34
+
35
+ $Customer = Mage::getModel('customer/customer')->load(Mage::getSingleton('customer/session')->getId());
36
+ echo "<iframe src=\"http://" . Mage::helper('flux')->prepareLoginEx( $Customer->getEmail(), $Customer->getPasswordHash()) . "&externaltype=1&theme=" . Mage::getStoreConfig('acegmbh_flux/flux/flux_theme_id') . "\" frameBorder=\"0\" width=\"100%\" height=\"1600px\"></iframe>";
37
+
38
+ ?>
app/etc/modules/Acegmbh_Flux.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <modules>
3
+ <Acegmbh_Flux>
4
+ <active>true</active>
5
+ <codePool>community</codePool>
6
+ </Acegmbh_Flux>
7
+ </modules>
8
+ </config>
app/locale/en_US/Acegmbh_Flux.csv ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;; FlickRocket SOAP Log
2
+ "FlickRocket SOAP Log","FlickRocket SOAP Log"
3
+ "ID","ID"
4
+ "Order ID","Order ID"
5
+ "Store ID","Store ID"
6
+ "Customer ID","Customer ID"
7
+ "Request","Request"
8
+ "Response","Response"
9
+ "Error","Error"
10
+ "Order Date","Order Date"
11
+
12
+ ;; Infos while creating a user
13
+ "Ihre E-Mail-Adresse ist bereits in Flux angelegt. Bitte verwenden Sie das Passwort aus Ihrem Flux Account.","Your E-Mail Address is already registered at Flickrocket/FluxPlayer. Please use the password from your existing account."
14
+
15
+ ;; backend texts
16
+ "Flickrocket Extension","Flickrocket Extension"
17
+ "General Settings","General Settings"
18
+ "Configuration","Configuration"
19
+ "Company ID","Company ID"
20
+ "Unique Company ID (see FlickRocket -> Company -> Company data)","Unique Company ID (see FlickRocket -> Company -> Company data)"
21
+ "Theme ID","Theme ID"
22
+ "Unique Theme ID (see FlickRocket -> Shop -> Themes)","Unique Theme ID (see FlickRocket -> Shop -> Themes)"
23
+ "Email Address","Email Address"
24
+ "Email of user registered with FlickRocket with Shop Management permission","Email of registered user with FlickRocket with Shop Management permission"
25
+ "Password","Password"
26
+ "May be empty for generic sandbox environment","May be empty for generic sandbox environment"
27
+ "Environment","Environment"
28
+ "Select between live (productive) and sandbox (testing)","Select between live (productive) and sandbox (testing)"
29
+
30
+ ;; adminhtml page content
31
+ "Content can be uploaded by using one of the following options:";"Content can be uploaded by using one of the following options:"
32
+ "Web based uploader";"Web based uploader"
33
+ "Download desktop software (Windows / MacOSX)";"Download desktop software (Windows / MacOSX)"
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Flickrocket</name>
4
+ <version>1.1.2</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension enables you to sell and rent (optionally DRM protected) digital content such as DVDs (incl. all menus, bonus material, etc.), video (HD+SD), audio books, ebooks (epub and PDF) and packaged content such as HTML, Flash, images, etc. </summary>
10
+ <description>This extension enables you to sell and rent (optionally DRM protected) digital content such as DVDs (incl. all menus, bonus material, etc.), video (HD+SD), audio books, ebooks (epub and PDF) and packaged content such as HTML, Flash, images, etc. &#xD;
11
+ &#xD;
12
+ You can encode, package, encrypt and upload your content right within Magento or use desktop software (free download for Windows and Mac) to get your content ready for sale.&#xD;
13
+ The content distribution is done via our content delivery network (CDN) to ensure a high bandwidth distribution to a world wide audience.</description>
14
+ <notes>First RC</notes>
15
+ <authors><author><name>Volkmar Breitfeld</name><user>VBreitfeld</user><email>volkmar@flickrocket.com</email></author></authors>
16
+ <date>2013-10-23</date>
17
+ <time>15:40:19</time>
18
+ <contents><target name="magecommunity"><dir name="Acegmbh"><dir name="Flux"><dir name="Block"><dir name="Adminhtml"><dir name="Admin"><file name="Grid.php" hash="d7d38e83b1eb1f546921e8db6ac1a30d"/></dir><file name="Admin.php" hash="6557d98fbd393dc5c17df243512b31a6"/><dir name="Flux"><dir name="Edit"><file name="Form.php" hash="b091f3214e32862fb29bd3337bd64955"/><dir name="Tab"><file name="Form.php" hash="2f8f6bc80235d2a5cfb69c7e531fddb6"/></dir><file name="Tabs.php" hash="ffcc392ac99693de3764a062bc679ecc"/></dir><file name="Edit.php" hash="ff168405f809920d01e06ddf35f0ce9f"/><dir name="Grid"><dir name="Render"><file name="Xml.php" hash="72d1776285ccf240deb79b2d539eeeb8"/></dir></dir><file name="Grid.php" hash="9522d5da8b9040747ae28448c54dc02d"/></dir><file name="Flux.php" hash="8b8f0dd7d83f81c00d7783ce1e8fd771"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b4ce1530f7b086a65f875992ef056e2d"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="Licenceids.php" hash="c8e4751bd263f2b5a449e9338e8d05e4"/><file name="Projectids.php" hash="259d3c4f6f4c0a5832e491eab7167309"/><file name="Wsdlurls.php" hash="e61bd809b83323ba6c12377d61dd4d47"/></dir></dir></dir></dir><dir name="Customer"><dir name="Entity"><file name="Customer.php" hash="6db83b89383b2353cd28582a8300395d"/></dir></dir><file name="Customer.php" hash="3623349bda4bb7542658bf83a5b18edc"/><dir name="Flux"><dir name="Soap"><dir name="Response"><file name="ChangeCustomerEMail.php" hash="c2efbbd5fff7a25b4e72f020893a7edc"/><file name="ChangeCustomerPassword.php" hash="7fc7f7052b3228d9bbe3ff042bdd2ec0"/><file name="CheckUserExists.php" hash="036d0ce3a53b062c21cbcf7837687142"/><file name="CreateShopOrder.php" hash="fba8280decfb79433b1781960fd159fb"/><file name="GetLicenses.php" hash="afe375c52cb6a6a63a8aa363386f9ebe"/><file name="GetProjects.php" hash="f2f249ca46ad8d10e561625589d80b66"/><file name="PrepareLogin.php" hash="6662461954f11338c921ef34fa34e6c6"/></dir></dir></dir><dir name="Mysql4"><dir name="Orders"><file name="Collection.php" hash="5974d09282cbd5f964ff7831654e43f5"/></dir><file name="Orders.php" hash="6159a072f030d0a127ec9ee09e6293e4"/><dir name="Users"><file name="Collection.php" hash="9355a78478686097b559a13640dd7976"/></dir><file name="Users.php" hash="ca9d2feb9c5df2ff1676c663f70f5f60"/></dir><file name="Observer.php" hash="3826d845713ead04105cee494942b9c2"/><file name="Orders.php" hash="e019a130619cbae9be12f2a9a54c705f"/><file name="Users.php" hash="e657f74825ea2e5d74990a9076c1ef2f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AdminController.php" hash="f76a58ba7a9bfc69dc440e4eef0903ce"/><file name="FluxController.php" hash="bec5e5a533376cd63d8d013fb7156df4"/><file name="UploadController.php" hash="91f2200f874269bc9123da194fbe23fe"/></dir><dir name="Checkout"><file name="OnepageController.php" hash="e7db64d60a05813b1e8d342ac4f92e4d"/></dir><file name="IndexController.php" hash="34f265af09a75061b27c1cd4f2a3deb0"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3fdf415d9546eaa336314056a84693e2"/><file name="config.xml" hash="04da799b58e5357461797d9356afbe6c"/><file name="system.xml" hash="7f89fc7217fc93180bbd2c5d47686fbd"/></dir><dir name="sql"><dir name="flux_setup"><file name="mysql4-install-0.1.0.php" hash="12a2cd6a2c010d503571190793a55e5b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="acegmbh_flux.xml" hash="7e04b10d2f952c0ef393c366b0f3e2cd"/></dir><dir name="template"><dir name="flux"><file name="admin.phtml" hash="68e180ef66e3f6753a89c13cad2264ef"/><file name="upload.phtml" hash="7d5f8fdc791bef65d969825c02518473"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="flux.xml" hash="fe8e45a73fc3480a43c29082d7730637"/></dir><dir name="template"><dir name="flux"><dir name="catalog"><dir name="product"><file name="samples.phtml" hash="8f4f1d49e22a27a6aabdcc2911113dbf"/></dir></dir><file name="dlmanagerlinks.phtml" hash="e12ee3700bf2460dbe795333d7c647a1"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Acegmbh_Flux.csv" hash="030f7f14d541d94311c066496e0fe833"/></dir></target><target name="mageetc"><dir name="modules"><file name="Acegmbh_Flux.xml" hash="f4cd29414c1144dfb0ecdd68eb092c00"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="flux"><file name="CloudIcon_Apple.png" hash="21e2932e7c092fcccc4d483237619078"/><file name="CloudIcon_Html5.png" hash="87e71303bf577682cd41379cb1ea4dab"/><file name="CloudIcon_Win.png" hash="c1e3d22ae7a272cb073d76a83bcb6abf"/></dir></dir></dir></dir></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
21
+ </package>
skin/adminhtml/default/default/images/flux/CloudIcon_Apple.png ADDED
Binary file
skin/adminhtml/default/default/images/flux/CloudIcon_Html5.png ADDED
Binary file
skin/adminhtml/default/default/images/flux/CloudIcon_Win.png ADDED
Binary file