Reamaze - Version 1.0.3

Version Notes

Update authkey generation for single-sign-on
Add min-height to reamaze iframes
Some minor bug fixes

Download this release

Release Info

Developer Reamaze
Extension Reamaze
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/community/Reamaze/Reamaze/Block/Js.php CHANGED
@@ -24,7 +24,7 @@ class Reamaze_Reamaze_Block_Js extends Mage_Core_Block_Template {
24
  'id' => $customer->getId(),
25
  'email' => $customer->getEmail(),
26
  'name' => $customer->getName(),
27
- 'authkey' => $reamazeHelper->getAuthKey($customer->getId()),
28
  'data' => $customerData
29
  );
30
  }
@@ -48,18 +48,20 @@ class Reamaze_Reamaze_Block_Js extends Mage_Core_Block_Template {
48
  {
49
  $data = array();
50
 
51
- $customerTotals = Mage::getResourceModel('sales/sale_collection')
52
- ->setCustomerFilter($customer)
53
- ->load()
54
- ->getTotals();
 
55
 
56
- if ($customerLifetimeSales = $customerTotals->getLifetime()) {
57
- $data['Total Sales'] = Mage::helper('core')->formatCurrency($customerLifetimeSales, false);
58
- }
59
 
60
- if ($customerAvgSale = $customerTotals->getAvgSale()) {
61
- $data['Avg Sale'] = Mage::helper('core')->formatCurrency($customerAvgSale, false);
62
- }
 
63
 
64
  $customerPrimaryBillingAddress = $customer->getPrimaryBillingAddress();
65
 
24
  'id' => $customer->getId(),
25
  'email' => $customer->getEmail(),
26
  'name' => $customer->getName(),
27
+ 'authkey' => $reamazeHelper->getAuthKey($customer->getId(), $customer->getEmail()),
28
  'data' => $customerData
29
  );
30
  }
48
  {
49
  $data = array();
50
 
51
+ try {
52
+ $customerTotals = Mage::getResourceModel('sales/sale_collection')
53
+ ->setCustomerFilter($customer)
54
+ ->load()
55
+ ->getTotals();
56
 
57
+ if ($customerLifetimeSales = $customerTotals->getLifetime()) {
58
+ $data['Total Sales'] = Mage::helper('core')->formatCurrency($customerLifetimeSales, false);
59
+ }
60
 
61
+ if ($customerAvgSale = $customerTotals->getAvgSale()) {
62
+ $data['Avg Sale'] = Mage::helper('core')->formatCurrency($customerAvgSale, false);
63
+ }
64
+ } catch (Exception $e) {}
65
 
66
  $customerPrimaryBillingAddress = $customer->getPrimaryBillingAddress();
67
 
app/code/community/Reamaze/Reamaze/Helper/Data.php CHANGED
@@ -34,12 +34,12 @@ class Reamaze_Reamaze_Helper_Data extends Mage_Core_Helper_Data {
34
  return Mage::getStoreConfig(self::XML_PATH_ACCOUNT_NAME, $store);
35
  }
36
 
37
- public function getSSOKey($store = null) {
38
- return Mage::getStoreConfig(self::XML_PATH_SSO_KEY, $store);
39
  }
40
 
41
- public function getAuthKey($userId, $store = null) {
42
- return hash('sha256', $userId . ':' . $this->getSSOKey($store));
43
  }
44
 
45
  public function getDomain() {
34
  return Mage::getStoreConfig(self::XML_PATH_ACCOUNT_NAME, $store);
35
  }
36
 
37
+ public function getSSOKey() {
38
+ return Mage::getStoreConfig(self::XML_PATH_SSO_KEY);
39
  }
40
 
41
+ public function getAuthKey($userId, $userEmail) {
42
+ return hash_hmac('sha256', $userId . ':' . $userEmail, $this->getSSOKey());
43
  }
44
 
45
  public function getDomain() {
app/design/adminhtml/default/default/template/reamaze/reamaze/adminhtml_customer_edit_tab_conversations.phtml CHANGED
@@ -10,12 +10,13 @@
10
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
11
  var _user = {
12
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
13
- "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId()); ?>",
 
14
  "parent_url": window.location.href
15
  };
16
 
17
  var url = _baseUrl + '/admin/users' + '?' + $jq.param({external_ref: '<?php echo $this->getCustomer()->getId(); ?>', sso: _user, widget: 1, app: 'magento'});
18
- var embedEle = $jq('<iframe/>').attr({width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_widget_user_conversations"});
19
  $chartContainer.html(embedEle);
20
 
21
  $jq.receiveMessage(function(e) {
10
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
11
  var _user = {
12
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
13
+ "email": "<?php echo Mage::getSingleton('admin/session')->getUser()->getEmail(); ?>",
14
+ "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId(), Mage::getSingleton('admin/session')->getUser()->getEmail()); ?>",
15
  "parent_url": window.location.href
16
  };
17
 
18
  var url = _baseUrl + '/admin/users' + '?' + $jq.param({external_ref: '<?php echo $this->getCustomer()->getId(); ?>', sso: _user, widget: 1, app: 'magento'});
19
+ var embedEle = $jq('<iframe/>').attr({style: "min-height: 400px;", width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_widget_user_conversations"});
20
  $chartContainer.html(embedEle);
21
 
22
  $jq.receiveMessage(function(e) {
app/design/adminhtml/default/default/template/reamaze/reamaze/adminhtml_dashboard_chart.phtml CHANGED
@@ -10,12 +10,13 @@
10
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
11
  var _user = {
12
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
13
- "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId()); ?>",
 
14
  "parent_url": window.location.href
15
  };
16
 
17
  var url = _baseUrl + '/admin/reports/<?php echo $this->getData("chart_id"); ?>' + '?' + $jq.param({sso: _user, widget: 1, app: 'magento'});
18
- var embedEle = $jq('<iframe/>').attr({width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_widget_chart_" + '<?php echo $this->getData("chart_id"); ?>'});
19
  $chartContainer.html(embedEle);
20
 
21
  $jq.receiveMessage(function(e) {
10
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
11
  var _user = {
12
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
13
+ "email": "<?php echo Mage::getSingleton('admin/session')->getUser()->getEmail(); ?>",
14
+ "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId(), Mage::getSingleton('admin/session')->getUser()->getEmail()); ?>",
15
  "parent_url": window.location.href
16
  };
17
 
18
  var url = _baseUrl + '/admin/reports/<?php echo $this->getData("chart_id"); ?>' + '?' + $jq.param({sso: _user, widget: 1, app: 'magento'});
19
+ var embedEle = $jq('<iframe/>').attr({style: "min-height: 400px;", width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_widget_chart_" + '<?php echo $this->getData("chart_id"); ?>'});
20
  $chartContainer.html(embedEle);
21
 
22
  $jq.receiveMessage(function(e) {
app/design/adminhtml/default/default/template/reamaze/reamaze/adminhtml_dashboard_conversations.phtml CHANGED
@@ -10,7 +10,8 @@
10
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
11
  var _user = {
12
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
13
- "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId()); ?>",
 
14
  "parent_url": window.location.href
15
  };
16
  var params = {
@@ -21,7 +22,7 @@
21
  };
22
 
23
  var url = _baseUrl + '/admin/dashboard?' + $jq.param(params);
24
- var embedEle = $jq('<iframe/>').attr({width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_widget_conversations_<?php echo $this->getData('conversations_id'); ?>"});
25
  $conversationsContainer.html(embedEle);
26
 
27
  $jq.receiveMessage(function(e) {
10
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
11
  var _user = {
12
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
13
+ "email": "<?php echo Mage::getSingleton('admin/session')->getUser()->getEmail(); ?>",
14
+ "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId(), Mage::getSingleton('admin/session')->getUser()->getEmail()); ?>",
15
  "parent_url": window.location.href
16
  };
17
  var params = {
22
  };
23
 
24
  var url = _baseUrl + '/admin/dashboard?' + $jq.param(params);
25
+ var embedEle = $jq('<iframe/>').attr({style: "min-height: 400px;", width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_widget_conversations_<?php echo $this->getData('conversations_id'); ?>"});
26
  $conversationsContainer.html(embedEle);
27
 
28
  $jq.receiveMessage(function(e) {
app/design/adminhtml/default/default/template/reamaze/reamaze/dashboard.phtml CHANGED
@@ -3,12 +3,13 @@
3
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
4
  var _user = {
5
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
6
- "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId()); ?>",
 
7
  "parent_url": window.location.href
8
  };
9
 
10
  var url = _baseUrl + '/admin/<?php echo $this->getData("actionPath"); ?>?' + $jq.param({sso: _user, framed: 1, app: 'magento'});
11
- var embedEle = $jq('<iframe/>').attr({width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_embed"});
12
  $jq("#reamaze-dashboard").append(embedEle);
13
 
14
  $jq.receiveMessage(function(e) {
3
  var _baseUrl = "https://<?php echo Mage::helper('reamaze_reamaze')->getAccountName()?>.<?php echo Mage::helper('reamaze_reamaze')->getDomain(); ?>";
4
  var _user = {
5
  "id": "<?php echo Mage::getSingleton('admin/session')->getUser()->getId(); ?>",
6
+ "email": "<?php echo Mage::getSingleton('admin/session')->getUser()->getEmail(); ?>",
7
+ "authkey": "<?php echo Mage::helper('reamaze_reamaze')->getAuthKey(Mage::getSingleton('admin/session')->getUser()->getId(), Mage::getSingleton('admin/session')->getUser()->getEmail()); ?>",
8
  "parent_url": window.location.href
9
  };
10
 
11
  var url = _baseUrl + '/admin/<?php echo $this->getData("actionPath"); ?>?' + $jq.param({sso: _user, framed: 1, app: 'magento'});
12
+ var embedEle = $jq('<iframe/>').attr({style: "min-height: 400px;", width: "100%", src: url, scrolling: "no", frameborder: "0", allowtransparency: "true", name: "_embed"});
13
  $jq("#reamaze-dashboard").append(embedEle);
14
 
15
  $jq.receiveMessage(function(e) {
app/design/adminhtml/default/default/template/reamaze/reamaze/system/config/helpme.phtml CHANGED
@@ -16,7 +16,7 @@
16
  function async_load() {
17
  var s = document.createElement('script');
18
  s.type = 'text/javascript'; s.async = true;
19
- s.src = '<?php echo $this->getData("js_path"); ?>';
20
  var x = document.getElementsByTagName('script')[0];
21
  x.parentNode.insertBefore(s, x);
22
  }
16
  function async_load() {
17
  var s = document.createElement('script');
18
  s.type = 'text/javascript'; s.async = true;
19
+ s.src = '//d3itxuyrq7vzpz.cloudfront.net/assets/reamaze.js';
20
  var x = document.getElementsByTagName('script')[0];
21
  x.parentNode.insertBefore(s, x);
22
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Reamaze</name>
4
- <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License v2.0</license>
7
  <channel>community</channel>
@@ -42,11 +42,13 @@ Try It Free for 14 Days (No credit card required)&#xD;
42
  &#xD;
43
  http://www.reamaze.com&#xD;
44
  </description>
45
- <notes>Move reamaze.js initialization to header</notes>
 
 
46
  <authors><author><name>Reamaze</name><user>reamaze</user><email>support@reamaze.com</email></author></authors>
47
- <date>2014-02-04</date>
48
- <time>07:06:21</time>
49
- <contents><target name="magecommunity"><dir name="Reamaze"><dir name="Reamaze"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Conversations.php" hash="c84f1e6bfb2f8058cbce35d72c575de3"/></dir></dir></dir><file name="Main.php" hash="e19f02965be7f371d80e5ac260c8ebe1"/><dir name="System"><dir name="Config"><file name="HelpMe.php" hash="2ecdd68bc5936e193057d2695756b11f"/><file name="RunSetupButton.php" hash="be7d7dc223834a954c237cf659c574e7"/></dir></dir></dir><file name="Js.php" hash="07b7d560316df9f6e62804b9ffd5d7e4"/></dir><dir name="Helper"><file name="Data.php" hash="ea232b7ef91ab5558fcfdd31e8875c3d"/></dir><dir name="Model"><file name="AdminObserver.php" hash="c83b2c0e2947784e7bf5bf096d587e98"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="DashboardCharts.php" hash="0223cfbf60aa139b8811e2de9be547ee"/><file name="DashboardConversations.php" hash="41199f1c4ebbe9ae7394dcab3ed9c1ac"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MainController.php" hash="48fefc3c8f7d054c535cef92f52cb036"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="47f4f64a53c60fc1d1d3a91b9782c32c"/><file name="config.xml" hash="3f1323217fbe6061ef9a0cb68df17d41"/><file name="system.xml" hash="ac994d7eb8455f39e4d36d49ffa5eb32"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="reamaze_reamaze.xml" hash="eefb4693281ba659039c9270dafcd682"/></dir><dir name="template"><dir name="reamaze"><dir name="reamaze"><file name="adminhtml_customer_edit_tab_conversations.phtml" hash="50749c251ffec094413931633168d89e"/><file name="adminhtml_dashboard_chart.phtml" hash="ff9c7361b1e41c1f667f2729ed087b74"/><file name="adminhtml_dashboard_conversations.phtml" hash="5b5c1a7b97864e041739b7501f103b6a"/><file name="dashboard.phtml" hash="9ff6e3d911b9991d908828f2796cf566"/><file name="jquery.phtml" hash="b657c2b6846cb341066d6f1233a4d29d"/><file name="setup.phtml" hash="65897e5bc78389b2db68024f94978d33"/><dir name="system"><dir name="config"><file name="helpme.phtml" hash="4052236e81d4330d610fb77946ecff3d"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="reamaze_reamaze.xml" hash="6022cae9d7f6c6a9a6bedaf1992d364c"/></dir><dir name="template"><dir name="reamaze"><dir name="reamaze"><file name="js.phtml" hash="8cb40a99ad8f233b0c89340336a8499a"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Reamaze_Reamaze.xml" hash="642f93ee26c6e304e46c88be89625f7b"/></dir></target><target name="mageweb"><dir name="js"><dir name="reamaze"><file name="jquery.ba-postmessage.js" hash="c9817980bd783037351b5416882e97c6"/><file name="jquery.deparam.js" hash="a236e89a0310e5c3579bc7bf51eff93c"/><file name="jquery.migrate.js" hash="03acd09da7a9775916e244c240467ac1"/><file name="jquery.min.js" hash="a1fe315f64e4b8c36f9c4e42b5a66dca"/><file name="jquery.min.map" hash="0bec84859c7b4d4907f51b748b0a5012"/><file name="jquery.noConflict.js" hash="7e1379465d667c5605e62ce1abf29a31"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="reamaze"><file name="dashboard.css" hash="72177b032a3a5b429ce6cb5972ce4ec8"/></dir></dir></dir></dir></target></contents>
50
  <compatible/>
51
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
52
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Reamaze</name>
4
+ <version>1.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License v2.0</license>
7
  <channel>community</channel>
42
  &#xD;
43
  http://www.reamaze.com&#xD;
44
  </description>
45
+ <notes>Update authkey generation for single-sign-on&#xD;
46
+ Add min-height to reamaze iframes&#xD;
47
+ Some minor bug fixes</notes>
48
  <authors><author><name>Reamaze</name><user>reamaze</user><email>support@reamaze.com</email></author></authors>
49
+ <date>2014-02-13</date>
50
+ <time>06:20:07</time>
51
+ <contents><target name="magecommunity"><dir name="Reamaze"><dir name="Reamaze"><dir name="Block"><dir name="Adminhtml"><dir name="Customer"><dir name="Edit"><dir name="Tab"><file name="Conversations.php" hash="c84f1e6bfb2f8058cbce35d72c575de3"/></dir></dir></dir><file name="Main.php" hash="e19f02965be7f371d80e5ac260c8ebe1"/><dir name="System"><dir name="Config"><file name="HelpMe.php" hash="2ecdd68bc5936e193057d2695756b11f"/><file name="RunSetupButton.php" hash="be7d7dc223834a954c237cf659c574e7"/></dir></dir></dir><file name="Js.php" hash="c551b633f4eedc91fc8bdccdf06a4dec"/></dir><dir name="Helper"><file name="Data.php" hash="92cf1fcbc9a3d47ac6645302169acee5"/></dir><dir name="Model"><file name="AdminObserver.php" hash="c83b2c0e2947784e7bf5bf096d587e98"/><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Source"><file name="DashboardCharts.php" hash="0223cfbf60aa139b8811e2de9be547ee"/><file name="DashboardConversations.php" hash="41199f1c4ebbe9ae7394dcab3ed9c1ac"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MainController.php" hash="48fefc3c8f7d054c535cef92f52cb036"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="47f4f64a53c60fc1d1d3a91b9782c32c"/><file name="config.xml" hash="3f1323217fbe6061ef9a0cb68df17d41"/><file name="system.xml" hash="ac994d7eb8455f39e4d36d49ffa5eb32"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="reamaze_reamaze.xml" hash="eefb4693281ba659039c9270dafcd682"/></dir><dir name="template"><dir name="reamaze"><dir name="reamaze"><file name="adminhtml_customer_edit_tab_conversations.phtml" hash="7968e9e6b6fc4e3a4f3899e77b59e1bd"/><file name="adminhtml_dashboard_chart.phtml" hash="a180f2968c9d979af096a06befdc98e4"/><file name="adminhtml_dashboard_conversations.phtml" hash="6cda3fd15e853cec666a73ad43af3efe"/><file name="dashboard.phtml" hash="66b41c0880a4afe106da64a159601ec1"/><file name="jquery.phtml" hash="b657c2b6846cb341066d6f1233a4d29d"/><file name="setup.phtml" hash="65897e5bc78389b2db68024f94978d33"/><dir name="system"><dir name="config"><file name="helpme.phtml" hash="83aeed703dafc0278a59be512bdc6e7c"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="reamaze_reamaze.xml" hash="6022cae9d7f6c6a9a6bedaf1992d364c"/></dir><dir name="template"><dir name="reamaze"><dir name="reamaze"><file name="js.phtml" hash="8cb40a99ad8f233b0c89340336a8499a"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Reamaze_Reamaze.xml" hash="642f93ee26c6e304e46c88be89625f7b"/></dir></target><target name="mageweb"><dir name="js"><dir name="reamaze"><file name="jquery.ba-postmessage.js" hash="c9817980bd783037351b5416882e97c6"/><file name="jquery.deparam.js" hash="a236e89a0310e5c3579bc7bf51eff93c"/><file name="jquery.migrate.js" hash="03acd09da7a9775916e244c240467ac1"/><file name="jquery.min.js" hash="a1fe315f64e4b8c36f9c4e42b5a66dca"/><file name="jquery.min.map" hash="0bec84859c7b4d4907f51b748b0a5012"/><file name="jquery.noConflict.js" hash="7e1379465d667c5605e62ce1abf29a31"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="reamaze"><file name="dashboard.css" hash="72177b032a3a5b429ce6cb5972ce4ec8"/></dir></dir></dir></dir></target></contents>
52
  <compatible/>
53
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
54
  </package>