mobile_assistant_connector - Version 1.2.6

Version Notes

Added:
- support of SUPEE-6788 patch

Fixed:
- non defined currencies

*Works only with release of app (2.6.1) and higher

Download this release

Release Info

Developer eMagicOne
Extension mobile_assistant_connector
Version 1.2.6
Comparing to
See all releases


Code changes from version 1.2.5 to 1.2.6

app/code/community/Emagicone/Mobassistantconnector/Helper/Access.php CHANGED
@@ -31,13 +31,13 @@ class Emagicone_Mobassistantconnector_Helper_Access extends Mage_Core_Helper_Abs
31
  if ($date === false || ($timestamp - (int)$date) > self::MAX_LIFETIME)
32
  {
33
  $sessions = Mage::getModel("emagicone_mobassistantconnector/sessions")->getCollection();
34
- $sessions->addFieldToFilter('`date_added`', array('lt' => ($timestamp - self::MAX_LIFETIME)));
35
  foreach ($sessions as $session) {
36
  $session->delete();
37
  }
38
 
39
  $attempts = Mage::getModel("emagicone_mobassistantconnector/failed")->getCollection();
40
- $attempts->addFieldToFilter('`date_added`', array('lt' => ($timestamp - self::MAX_LIFETIME)));
41
  foreach ($attempts as $attempt) {
42
  $attempt->delete();
43
  }
@@ -83,8 +83,8 @@ class Emagicone_Mobassistantconnector_Helper_Access extends Mage_Core_Helper_Abs
83
  $timestamp = time();
84
 
85
  $sessions = Mage::getModel("emagicone_mobassistantconnector/sessions")->getCollection();
86
- $sessions->addFieldToFilter('`date_added`', array('gt' => ($timestamp - self::MAX_LIFETIME)));
87
- $sessions->addFieldToFilter('`session_key`', array('eq' => $key));
88
 
89
  if($sessions->getSize() > 0) {
90
  return true;
@@ -121,8 +121,8 @@ class Emagicone_Mobassistantconnector_Helper_Access extends Mage_Core_Helper_Abs
121
 
122
 
123
  $attempts = Mage::getModel("emagicone_mobassistantconnector/failed")->getCollection();
124
- $attempts->addFieldToFilter('`date_added`', array('gt' => ($timestamp - self::MAX_LIFETIME)));
125
- $attempts->addFieldToFilter('`ip`', array('eq' => $_SERVER['REMOTE_ADDR']));
126
  $count_failed_attempts = $attempts->getSize();
127
 
128
  self::setDelay((int)$count_failed_attempts);
31
  if ($date === false || ($timestamp - (int)$date) > self::MAX_LIFETIME)
32
  {
33
  $sessions = Mage::getModel("emagicone_mobassistantconnector/sessions")->getCollection();
34
+ $sessions->addFieldToFilter('date_added', array('lt' => ($timestamp - self::MAX_LIFETIME)));
35
  foreach ($sessions as $session) {
36
  $session->delete();
37
  }
38
 
39
  $attempts = Mage::getModel("emagicone_mobassistantconnector/failed")->getCollection();
40
+ $attempts->addFieldToFilter('date_added', array('lt' => ($timestamp - self::MAX_LIFETIME)));
41
  foreach ($attempts as $attempt) {
42
  $attempt->delete();
43
  }
83
  $timestamp = time();
84
 
85
  $sessions = Mage::getModel("emagicone_mobassistantconnector/sessions")->getCollection();
86
+ $sessions->addFieldToFilter('date_added', array('gt' => ($timestamp - self::MAX_LIFETIME)));
87
+ $sessions->addFieldToFilter('session_key', array('eq' => $key));
88
 
89
  if($sessions->getSize() > 0) {
90
  return true;
121
 
122
 
123
  $attempts = Mage::getModel("emagicone_mobassistantconnector/failed")->getCollection();
124
+ $attempts->addFieldToFilter('date_added', array('gt' => ($timestamp - self::MAX_LIFETIME)));
125
+ $attempts->addFieldToFilter('ip', array('eq' => $_SERVER['REMOTE_ADDR']));
126
  $count_failed_attempts = $attempts->getSize();
127
 
128
  self::setDelay((int)$count_failed_attempts);
app/code/community/Emagicone/Mobassistantconnector/Helper/Data.php CHANGED
@@ -154,8 +154,13 @@ class Emagicone_Mobassistantconnector_Helper_Data extends Mage_Core_Helper_Abstr
154
 
155
  if(strlen($convert_to) == 3){
156
  try {
157
- $price = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $convert_to);
158
  // $price = $this->currencyConvert($price, $baseCurrencyCode, $convert_to);
 
 
 
 
 
159
  $iso_code = $convert_to;
160
  } catch(Exception $e) {
161
  Mage::log(
154
 
155
  if(strlen($convert_to) == 3){
156
  try {
157
+ // $price2 = Mage::helper('directory')->currencyConvert($price, $baseCurrencyCode, $convert_to);
158
  // $price = $this->currencyConvert($price, $baseCurrencyCode, $convert_to);
159
+
160
+ $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();
161
+ $rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));
162
+ $price = $price * $rates[$convert_to];
163
+
164
  $iso_code = $convert_to;
165
  } catch(Exception $e) {
166
  Mage::log(
app/code/community/Emagicone/Mobassistantconnector/Model/Observer.php CHANGED
@@ -97,8 +97,8 @@ class Emagicone_Mobassistantconnector_Model_Observer
97
  $deviceCurrencyCode = $value['push_currency_code'];
98
  $app_connection_id = $value['app_connection_id'];
99
 
100
- $total = $order->getBaseGrandTotal();
101
  // $total = $order->getSubtotalInclTax();
 
102
  $total = number_format(floatval($total), 2, '.', ' ');
103
 
104
  if(empty($deviceCurrencyCode) || strval($deviceCurrencyCode) == 'base_currency') {
97
  $deviceCurrencyCode = $value['push_currency_code'];
98
  $app_connection_id = $value['app_connection_id'];
99
 
 
100
  // $total = $order->getSubtotalInclTax();
101
+ $total = $order->getBaseGrandTotal();
102
  $total = number_format(floatval($total), 2, '.', ' ');
103
 
104
  if(empty($deviceCurrencyCode) || strval($deviceCurrencyCode) == 'base_currency') {
app/code/community/Emagicone/Mobassistantconnector/controllers/IndexController.php CHANGED
@@ -28,7 +28,7 @@ class Emagicone_Mobassistantconnector_IndexController extends Mage_Core_Controll
28
  private $hash_only;
29
  private $session_key;
30
  const GSM_URL = 'https://android.googleapis.com/gcm/send';
31
- const MB_VERSION = '90';
32
 
33
  public function indexAction()
34
  {
28
  private $hash_only;
29
  private $session_key;
30
  const GSM_URL = 'https://android.googleapis.com/gcm/send';
31
+ const MB_VERSION = '91';
32
 
33
  public function indexAction()
34
  {
app/code/community/Emagicone/Mobassistantconnector/etc/config.xml CHANGED
@@ -28,36 +28,36 @@
28
  </args>
29
  </mobassistantconnector>
30
  </routers>
31
- <translate>
32
- <modules>
33
- <translations>
34
- <files>
35
- <default>Emagicone_Mobassistantconnector.csv</default>
36
- </files>
37
- </translations>
38
- </modules>
39
- </translate>
40
  </frontend>
41
 
42
  <admin>
43
  <routers>
44
- <mobassistantconnectoradmin>
45
- <use>admin</use>
46
  <args>
47
- <module>Emagicone_Mobassistantconnector</module>
48
- <frontName>mobassistantconnector</frontName>
 
49
  </args>
50
- </mobassistantconnectoradmin>
51
  </routers>
52
  </admin>
53
 
54
  <global>
55
- <helpers>
56
- <mobassistantconnector>
57
- <class>Emagicone_Mobassistantconnector_Helper</class>
58
- </mobassistantconnector>
59
- </helpers>
60
-
61
  <models>
62
  <sales>
63
  <rewrite>
@@ -103,7 +103,7 @@
103
  </emagicone_mobassistantconnector_order_change>
104
  </observers>
105
  </sales_order_save_after>
106
- <customer_register_success>
107
  <observers>
108
  <emagicone_mobassistantconnector_customer_register_success>
109
  <type>model</type>
@@ -113,16 +113,16 @@
113
  </observers>
114
  </customer_register_success>
115
  </events>
116
- <layout>
117
- <updates>
118
- <emagicone_mobassistantconnector>
119
- <file>emagicone_mobassistantconnector.xml</file>
120
- </emagicone_mobassistantconnector>
121
- </updates>
122
- </layout>
123
  </global>
124
-
125
- <adminhtml>
126
  <translate>
127
  <modules>
128
  <translations>
@@ -132,7 +132,7 @@
132
  </translations>
133
  </modules>
134
  </translate>
135
- <layout>
136
  <updates>
137
  <mobassistantconnector>
138
  <file>mobassistantconnector.xml</file>
@@ -140,5 +140,5 @@
140
  </updates>
141
  </layout>
142
  </adminhtml>
143
-
144
  </config>
28
  </args>
29
  </mobassistantconnector>
30
  </routers>
31
+ <translate>
32
+ <modules>
33
+ <translations>
34
+ <files>
35
+ <default>Emagicone_Mobassistantconnector.csv</default>
36
+ </files>
37
+ </translations>
38
+ </modules>
39
+ </translate>
40
  </frontend>
41
 
42
  <admin>
43
  <routers>
44
+ <adminhtml>
 
45
  <args>
46
+ <modules>
47
+ <mobassistantconnectoradmin before="Mage_Adminhtml">Emagicone_Mobassistantconnector_Adminhtml</mobassistantconnectoradmin>
48
+ </modules>
49
  </args>
50
+ </adminhtml>
51
  </routers>
52
  </admin>
53
 
54
  <global>
55
+ <helpers>
56
+ <mobassistantconnector>
57
+ <class>Emagicone_Mobassistantconnector_Helper</class>
58
+ </mobassistantconnector>
59
+ </helpers>
60
+
61
  <models>
62
  <sales>
63
  <rewrite>
103
  </emagicone_mobassistantconnector_order_change>
104
  </observers>
105
  </sales_order_save_after>
106
+ <customer_register_success>
107
  <observers>
108
  <emagicone_mobassistantconnector_customer_register_success>
109
  <type>model</type>
113
  </observers>
114
  </customer_register_success>
115
  </events>
116
+ <layout>
117
+ <updates>
118
+ <emagicone_mobassistantconnector>
119
+ <file>emagicone_mobassistantconnector.xml</file>
120
+ </emagicone_mobassistantconnector>
121
+ </updates>
122
+ </layout>
123
  </global>
124
+
125
+ <adminhtml>
126
  <translate>
127
  <modules>
128
  <translations>
132
  </translations>
133
  </modules>
134
  </translate>
135
+ <layout>
136
  <updates>
137
  <mobassistantconnector>
138
  <file>mobassistantconnector.xml</file>
140
  </updates>
141
  </layout>
142
  </adminhtml>
143
+
144
  </config>
package.xml CHANGED
@@ -1,22 +1,24 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mobile_assistant_connector</name>
4
- <version>1.2.5</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GNU</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Mobile Assistant Connector</summary>
10
  <description>Mobile Assistant Connector</description>
11
- <notes>Fixed:&#xD;
12
- - thumbnails&#xD;
13
- - installation process&#xD;
 
 
14
  &#xD;
15
  *Works only with release of app (2.6.1) and higher</notes>
16
  <authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
17
- <date>2015-08-05</date>
18
- <time>16:15:17</time>
19
- <contents><target name="magecommunity"><dir name="Emagicone"><dir name="Mobassistantconnector"><dir name="Helper"><file name="Access.php" hash="2aaa400c32b63a6ce62859c73153f9c0"/><file name="Data.php" hash="79373ea580d4d1daae80a4e7080778b3"/></dir><dir name="Model"><file name="Defpassword.php" hash="921e5344ba325ddf1aaba6aeb2202696"/><file name="Failed.php" hash="7da654c3cf1e9a3f5a55da7f36192117"/><file name="Login.php" hash="bedbce507924854910524fbabe1c4948"/><file name="Observer.php" hash="bb18972490df3223aeb473d917a2acf4"/><file name="Order.php" hash="f3d5529e0504ea0265cb661e03f41109"/><file name="Password.php" hash="66e2050ecc7b56deb654b5476ac1746c"/><dir name="Resource"><dir name="Failed"><file name="Collection.php" hash="18980688d80660f6a663a2c4dce20f54"/></dir><file name="Failed.php" hash="a69ca1239d3400097fabc415ee02751b"/><dir name="Sessions"><file name="Collection.php" hash="397e9a6f637472b59abe42bca09ea616"/></dir><file name="Sessions.php" hash="4d9f6cdd340fd95549d287c6107285ac"/></dir><file name="Sessions.php" hash="e3a32e26446e4cd27032c99dde8d4cfa"/></dir><dir name="controllers"><file name="IndexController.php" hash="1afcfac5c2c4564b5d888e711e2bcf7b"/><dir name="adminhtml"><file name="IndexController.php" hash="ef5ca028e534cbf81b39a643885c9511"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="333ed888c7f8a1e067821b6547e34340"/><file name="config.xml" hash="69a6a6843d6490efdee1038603474556"/><file name="system.xml" hash="916fe7ee643e4dcb15a5498219605896"/></dir><dir name="sql"><dir name="emagicone_mobassistantconnector_setup"><file name="install-1.2.1.php" hash="2394c0bf43b7c8f15fa83d957ed15ffd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Emagicone_Mobassistantconnector.xml" hash="7bb654478173d96ad294000fc9625820"/></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/><file name="__Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/></dir><dir name="en_US"><file name="Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/><file name="__Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/></dir><dir name="es_ES"><file name="Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/><file name="__Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/></dir><dir name="fr_FR"><file name="Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/><file name="__Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/></dir><dir name="ru_RU"><file name="Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/><file name="__Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/></dir><dir name="uk_UA"><file name="Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/><file name="__Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mobassistantconnector.xml" hash="b5c4d423be8de0c5d73d64783dcb9a3c"/></dir><dir name="template"><dir name="mobassistantconnector"><file name="jsinit.phtml" hash="785c82b5cf6b2a7dc94a1436d1c9115f"/></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min>1.0</min><max>3.0</max></extension><extension><name>json</name><min>1.0</min><max>3.0</max></extension><extension><name>date</name><min>1.0</min><max>3.0</max></extension></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>mobile_assistant_connector</name>
4
+ <version>1.2.6</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl.html">GNU</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Mobile Assistant Connector</summary>
10
  <description>Mobile Assistant Connector</description>
11
+ <notes>Added:&#xD;
12
+ - support of SUPEE-6788 patch&#xD;
13
+ &#xD;
14
+ Fixed:&#xD;
15
+ - non defined currencies&#xD;
16
  &#xD;
17
  *Works only with release of app (2.6.1) and higher</notes>
18
  <authors><author><name>eMagicOne</name><user>mobile</user><email>mobile@emagicone.com</email></author></authors>
19
+ <date>2015-11-04</date>
20
+ <time>15:56:07</time>
21
+ <contents><target name="magecommunity"><dir name="Emagicone"><dir name="Mobassistantconnector"><dir name="Helper"><file name="Access.php" hash="c6f4c96ca225bbc72cb829c59f7808f1"/><file name="Data.php" hash="efa0278512e07a2b87bcb4ee3fe80470"/></dir><dir name="Model"><file name="Defpassword.php" hash="921e5344ba325ddf1aaba6aeb2202696"/><file name="Failed.php" hash="7da654c3cf1e9a3f5a55da7f36192117"/><file name="Login.php" hash="bedbce507924854910524fbabe1c4948"/><file name="Observer.php" hash="324a82764d34bd6684c727c7936a291b"/><file name="Order.php" hash="f3d5529e0504ea0265cb661e03f41109"/><file name="Password.php" hash="66e2050ecc7b56deb654b5476ac1746c"/><dir name="Resource"><dir name="Failed"><file name="Collection.php" hash="18980688d80660f6a663a2c4dce20f54"/></dir><file name="Failed.php" hash="a69ca1239d3400097fabc415ee02751b"/><dir name="Sessions"><file name="Collection.php" hash="397e9a6f637472b59abe42bca09ea616"/></dir><file name="Sessions.php" hash="4d9f6cdd340fd95549d287c6107285ac"/></dir><file name="Sessions.php" hash="e3a32e26446e4cd27032c99dde8d4cfa"/></dir><dir name="controllers"><file name="IndexController.php" hash="3b011082e4f14fcbe18dd662e35f7981"/><dir name="adminhtml"><file name="IndexController.php" hash="ef5ca028e534cbf81b39a643885c9511"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="333ed888c7f8a1e067821b6547e34340"/><file name="config.xml" hash="e15f9bd21e1efaaec3cf04080e74e5f7"/><file name="system.xml" hash="916fe7ee643e4dcb15a5498219605896"/></dir><dir name="sql"><dir name="emagicone_mobassistantconnector_setup"><file name="install-1.2.1.php" hash="2394c0bf43b7c8f15fa83d957ed15ffd"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Emagicone_Mobassistantconnector.xml" hash="7bb654478173d96ad294000fc9625820"/></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/><file name="__Emagicone_Mobassistantconnector.csv" hash="eaf733f81ff47627c4389d487c93709f"/></dir><dir name="en_US"><file name="Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/><file name="__Emagicone_Mobassistantconnector.csv" hash="510d79a25c0bfb7a096aab57d8c5b458"/></dir><dir name="es_ES"><file name="Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/><file name="__Emagicone_Mobassistantconnector.csv" hash="acc37c432dd8b4134844291931b70fbf"/></dir><dir name="fr_FR"><file name="Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/><file name="__Emagicone_Mobassistantconnector.csv" hash="76c48723a6bbd59534781fd3c7f6d86e"/></dir><dir name="ru_RU"><file name="Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/><file name="__Emagicone_Mobassistantconnector.csv" hash="2346397cbe029dcc724717b953a3f38c"/></dir><dir name="uk_UA"><file name="Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/><file name="__Emagicone_Mobassistantconnector.csv" hash="cad0e0c3ec7603e6b886d815357d1766"/></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="mobassistantconnector.xml" hash="b5c4d423be8de0c5d73d64783dcb9a3c"/></dir><dir name="template"><dir name="mobassistantconnector"><file name="jsinit.phtml" hash="785c82b5cf6b2a7dc94a1436d1c9115f"/></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><extension><name>curl</name><min>1.0</min><max>3.0</max></extension><extension><name>json</name><min>1.0</min><max>3.0</max></extension><extension><name>date</name><min>1.0</min><max>3.0</max></extension></required></dependencies>
24
  </package>