Lexity_Live - Version 1.2.0

Version Notes

Bug fixes and improvements to overall stability.

Download this release

Release Info

Developer Lexity
Extension Lexity_Live
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.0 to 1.2.0

app/code/local/LexityLive/Model/Core.php CHANGED
@@ -10,8 +10,7 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
10
  $readConnection = $resource->getConnection('core_read');
11
  $tableName = $resource->getTableName('api/user');
12
  $results = $readConnection->fetchALL("SELECT * FROM api_user where username = 'lexity_live' LIMIT 1");
13
-
14
- return (isset($results[0]) && $results[0]["email"] == 'support@lexity.com');
15
  }
16
 
17
  public function add_lexity_user($api_key)
@@ -32,7 +31,7 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
32
  'username' => 'lexity_live',
33
  'firstname' => 'lexity',
34
  'lastname' => 'lexity',
35
- 'email' => 'support@lexity.com',
36
  'api_key' => $api_key,
37
  'api_key_confirmation' => $api_key,
38
  'is_active' => 1,
@@ -59,9 +58,11 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
59
  switch (count($hashArr)) {
60
  case 1:
61
  $token = $hash;
 
62
  case 2:
63
  $token = $hashArr[0];
64
  $skey = $hashArr[1];
 
65
  }
66
  $hashed_token = $token;
67
 
@@ -71,7 +72,6 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
71
 
72
  $admin_user = Mage::getSingleton('admin/session');
73
  $admin_email = $admin_user->getUser()->getEmail();
74
-
75
  $uri = "https://lexity.com/api/account/create?app="
76
  . $this->app_name
77
  . "&platform=" . $this->platform . "&password=" . $token
@@ -86,7 +86,7 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
86
  # initiate handshake
87
  $client = new Varien_Http_Client($uri);
88
  $response = $client->request('GET');
89
- $body = $response->getRawBody();
90
 
91
  $decode = json_decode($body);
92
  if (!isset($decode->error) && isset($decode->public_id)) {
@@ -114,9 +114,11 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
114
  switch (count($hashArr)) {
115
  case 1:
116
  $token = $hash;
 
117
  case 2:
118
  $token = $hashArr[0];
119
  $skey = $hashArr[1];
 
120
  }
121
 
122
  Mage::app()->getCacheInstance()->cleanType('config');
@@ -130,9 +132,6 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
130
  . "&email=" . urlencode($login_email)
131
  . "&domain=" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
132
 
133
- if (isset($skey)) {
134
- $redirect_url .= "&skey=${skey}";
135
- }
136
  if (!empty($target)) {
137
  $redirect_url .= "&target=${target}";
138
  }
@@ -145,13 +144,16 @@ class LexityLive_Model_Core extends Mage_Core_Model_Config
145
  Mage::app()->getCacheInstance()->cleanType('config');
146
  $public_id = Mage::getStoreConfig('lexity/live/public_id');
147
  if (empty($public_id)) {
148
- $token = null;
 
149
  if (!$this->has_lexity_user()) {
150
- $token = md5(uniqid());
151
  $this->add_lexity_user($token);
 
 
 
 
152
  }
153
-
154
- return $this->create_account($token);
155
  }
156
 
157
  return $this->get_lexity_login_url($target);
10
  $readConnection = $resource->getConnection('core_read');
11
  $tableName = $resource->getTableName('api/user');
12
  $results = $readConnection->fetchALL("SELECT * FROM api_user where username = 'lexity_live' LIMIT 1");
13
+ return isset($results[0]);
 
14
  }
15
 
16
  public function add_lexity_user($api_key)
31
  'username' => 'lexity_live',
32
  'firstname' => 'lexity',
33
  'lastname' => 'lexity',
34
+ 'email' => 'support+live@lexity.com',
35
  'api_key' => $api_key,
36
  'api_key_confirmation' => $api_key,
37
  'is_active' => 1,
58
  switch (count($hashArr)) {
59
  case 1:
60
  $token = $hash;
61
+ break;
62
  case 2:
63
  $token = $hashArr[0];
64
  $skey = $hashArr[1];
65
+ break;
66
  }
67
  $hashed_token = $token;
68
 
72
 
73
  $admin_user = Mage::getSingleton('admin/session');
74
  $admin_email = $admin_user->getUser()->getEmail();
 
75
  $uri = "https://lexity.com/api/account/create?app="
76
  . $this->app_name
77
  . "&platform=" . $this->platform . "&password=" . $token
86
  # initiate handshake
87
  $client = new Varien_Http_Client($uri);
88
  $response = $client->request('GET');
89
+ $body = $response->getBody();
90
 
91
  $decode = json_decode($body);
92
  if (!isset($decode->error) && isset($decode->public_id)) {
114
  switch (count($hashArr)) {
115
  case 1:
116
  $token = $hash;
117
+ break;
118
  case 2:
119
  $token = $hashArr[0];
120
  $skey = $hashArr[1];
121
+ break;
122
  }
123
 
124
  Mage::app()->getCacheInstance()->cleanType('config');
132
  . "&email=" . urlencode($login_email)
133
  . "&domain=" . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
134
 
 
 
 
135
  if (!empty($target)) {
136
  $redirect_url .= "&target=${target}";
137
  }
144
  Mage::app()->getCacheInstance()->cleanType('config');
145
  $public_id = Mage::getStoreConfig('lexity/live/public_id');
146
  if (empty($public_id)) {
147
+ $token = md5(uniqid());
148
+
149
  if (!$this->has_lexity_user()) {
 
150
  $this->add_lexity_user($token);
151
+ } else {
152
+ $user = Mage::getModel('api/user')->loadByUsername("lexity_live");
153
+ $user->setApiKey($token);
154
+ $user->save();
155
  }
156
+ $this->create_account($token);
 
157
  }
158
 
159
  return $this->get_lexity_login_url($target);
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lexity_Live</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license>BSD License</license>
7
  <channel>community</channel>
@@ -20,11 +20,11 @@ See how your traffic improves over time and when your peak hours of business are
20
  See Where Your Customers Spend Their Time&#xD;
21
  &#xD;
22
  What pages do your customers look at and for how long? Where are they dropping off? Find out by tracking each individual customer and seeing their realtime behavior in your ecommerce store. Detailed path and page analysis reports for unique visitors include time on site, down to the second.</description>
23
- <notes>Support for installation of multiple Lexity extensions.</notes>
24
  <authors><author><name>Lexity</name><user>lexity</user><email>support@lexity.com</email></author></authors>
25
- <date>2012-08-05</date>
26
- <time>02:35:03</time>
27
- <contents><target name="magelocal"><dir name="LexityLive"><dir name="Block"><file name="Live.php" hash="eba95b73fc106ee5f16f79007900bce4"/></dir><dir name="Helper"><file name="Data.php" hash="81b07c4eb066f3f6ca74ac7f288ea3d1"/></dir><dir name="Model"><dir name="Core"><file name="Api.php" hash="0ca1f11c4dbd825832c0141d0a8103bf"/></dir><file name="Core.php" hash="94e43c47dbe3e1f9c4149506cfb7aa73"/><dir name="Order"><file name="Api.php" hash="793c3381f2b330162edff20d032aa87a"/></dir></dir><dir name="controllers"><file name="CoreController.php" hash="825255d558bf9b79877bb89d67c95153"/><file name="MarketingController.php" hash="2654936fd724a1c15b376cf3fa0be089"/></dir><dir name="etc"><file name="api.xml" hash="2839f8ced7d210be5d75616876de301b"/><file name="config.xml" hash="f747cf1797200f99cc1f66c6d924fd30"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="LexityLive.xml" hash="90f47f9fefe55580e1e77f118100c3a1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="lexitylive"><file name="live.phtml" hash="b654ecf70b4e8c99658b15fe8bd6e990"/></dir></dir></dir></dir></dir></target></contents>
28
  <compatible/>
29
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Lexity_Live</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license>BSD License</license>
7
  <channel>community</channel>
20
  See Where Your Customers Spend Their Time&#xD;
21
  &#xD;
22
  What pages do your customers look at and for how long? Where are they dropping off? Find out by tracking each individual customer and seeing their realtime behavior in your ecommerce store. Detailed path and page analysis reports for unique visitors include time on site, down to the second.</description>
23
+ <notes>Bug fixes and improvements to overall stability.</notes>
24
  <authors><author><name>Lexity</name><user>lexity</user><email>support@lexity.com</email></author></authors>
25
+ <date>2012-08-28</date>
26
+ <time>20:50:11</time>
27
+ <contents><target name="magelocal"><dir name="LexityLive"><dir name="Block"><file name="Live.php" hash="eba95b73fc106ee5f16f79007900bce4"/></dir><dir name="Helper"><file name="Data.php" hash="81b07c4eb066f3f6ca74ac7f288ea3d1"/></dir><dir name="Model"><dir name="Core"><file name="Api.php" hash="0ca1f11c4dbd825832c0141d0a8103bf"/></dir><file name="Core.php" hash="816a8decbd743507d413920faa1375f8"/><dir name="Order"><file name="Api.php" hash="793c3381f2b330162edff20d032aa87a"/></dir></dir><dir name="controllers"><file name="CoreController.php" hash="825255d558bf9b79877bb89d67c95153"/><file name="MarketingController.php" hash="2654936fd724a1c15b376cf3fa0be089"/></dir><dir name="etc"><file name="api.xml" hash="2839f8ced7d210be5d75616876de301b"/><file name="config.xml" hash="f747cf1797200f99cc1f66c6d924fd30"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="LexityLive.xml" hash="90f47f9fefe55580e1e77f118100c3a1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="lexitylive"><file name="live.phtml" hash="b654ecf70b4e8c99658b15fe8bd6e990"/></dir></dir></dir></dir></dir></target></contents>
28
  <compatible/>
29
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
30
  </package>