Liveagent - Version 3.0.8

Version Notes

- minor changes in API fixing redirect to secured page

Download this release

Release Info

Developer Quality Unit, LLC
Extension Liveagent
Version 3.0.8
Comparing to
See all releases


Code changes from version 3.0.7 to 3.0.8

app/code/local/Qualityunit/Liveagent/Helper/Connect.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @copyright Copyright (c) 2015 Quality Unit s.r.o.
4
- * @author Martin Devecka, Martin Pullmann
5
  * @package WpLiveAgentPlugin
6
  * @version 1.0.0
7
  *
@@ -29,7 +29,10 @@ class Qualityunit_Liveagent_Helper_Connect {
29
  curl_close($ch);
30
  $decodedResponse = json_decode($curl_response);
31
  if (!isset($decodedResponse->response)) {
32
- throw new Qualityunit_Liveagent_Exception_Base('Connection failed. Please try again...');
 
 
 
33
  }
34
  if ($info['http_code'] != 200) {
35
  throw new Qualityunit_Liveagent_Exception_Base('Connection failed with error "' . $decodedResponse->response->errormessage . '"');
1
  <?php
2
  /**
3
  * @copyright Copyright (c) 2015 Quality Unit s.r.o.
4
+ * @author Martin Pullmann
5
  * @package WpLiveAgentPlugin
6
  * @version 1.0.0
7
  *
29
  curl_close($ch);
30
  $decodedResponse = json_decode($curl_response);
31
  if (!isset($decodedResponse->response)) {
32
+ if (($info['http_code'] == 301) || ($info['http_code'] == 302)) {
33
+ throw new Qualityunit_Liveagent_Exception_Base('Connection failed. The request has been redirected to '.$info['redirect_url']);
34
+ }
35
+ throw new Qualityunit_Liveagent_Exception_Base('Connection failed with error '.$info['http_code'].'. Please try again...');
36
  }
37
  if ($info['http_code'] != 200) {
38
  throw new Qualityunit_Liveagent_Exception_Base('Connection failed with error "' . $decodedResponse->response->errormessage . '"');
app/code/local/Qualityunit/Liveagent/controllers/Adminhtml/LiveagentController.php CHANGED
@@ -227,6 +227,9 @@ class Qualityunit_Liveagent_Adminhtml_LiveagentController extends Mage_Adminhtml
227
  private function sendConnectRequest($url, $email, $apikey) {
228
  $connectHelper = new Qualityunit_Liveagent_Helper_Connect();
229
  try {
 
 
 
230
  $response = $connectHelper->connectWithLA($url, $email, $apikey);
231
  $this->saveAccountDetails($email, $url, $apikey, $response->authtoken);
232
  } catch (Qualityunit_Liveagent_Exception_Base $e) {
@@ -238,7 +241,7 @@ class Qualityunit_Liveagent_Adminhtml_LiveagentController extends Mage_Adminhtml
238
 
239
  private function saveAccountDetails($email, $domain, $apiKey, $authToken) {
240
  if ((strpos($domain, 'http:') === false) && (strpos($domain, 'https:') === false)) {
241
- $this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME, 'http://' . $domain . '.ladesk.com/');
242
  } else {
243
  if (substr($domain, -1) != '/') {
244
  $domain .= '/';
227
  private function sendConnectRequest($url, $email, $apikey) {
228
  $connectHelper = new Qualityunit_Liveagent_Helper_Connect();
229
  try {
230
+ if ((strpos($url, 'http:') !== false) && (strpos($url, '.ladesk.com') !== false)) {
231
+ $url = str_replace('http:', 'https:', $url);
232
+ }
233
  $response = $connectHelper->connectWithLA($url, $email, $apikey);
234
  $this->saveAccountDetails($email, $url, $apikey, $response->authtoken);
235
  } catch (Qualityunit_Liveagent_Exception_Base $e) {
241
 
242
  private function saveAccountDetails($email, $domain, $apiKey, $authToken) {
243
  if ((strpos($domain, 'http:') === false) && (strpos($domain, 'https:') === false)) {
244
+ $this->settings->setOption(Qualityunit_Liveagent_Helper_Settings::LA_URL_SETTING_NAME, 'https://' . $domain . '.ladesk.com/');
245
  } else {
246
  if (substr($domain, -1) != '/') {
247
  $domain .= '/';
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Liveagent</name>
4
- <version>3.0.7</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl-3.0.txt">GPLv3</license>
7
  <channel>community</channel>
@@ -9,11 +9,11 @@
9
  <summary>LiveAgent plugin integrates well known help desk and live chat software into any Magento installation. No HTML knowledge is required.</summary>
10
  <description>Magento-LiveAgent plugin integrates full featured help desk and live chat software Live Agent into any Magento installation.&#xD;
11
  Start by entering your existing account details or easily create one and then just choose which button you want to use for you shop. You are done in few clicks!</description>
12
- <notes>- installation SQL bug fix</notes>
13
  <authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
14
- <date>2015-12-18</date>
15
- <time>11:38:13</time>
16
- <contents><target name="magelocal"><dir name="Qualityunit"><dir name="Liveagent"><dir name="Block"><file name="AccountConnect.php" hash="8e1d5a6f83b283c440fccaf7c60c3c10"/><file name="Base.php" hash="86155f5e3264655ceb130dab28c405b6"/><file name="Buttoncode.php" hash="5a7c60199f39ac77d7ccfb2bec3ce2a7"/><file name="Signup.php" hash="4b5c66377a62f53696866964a386cef5"/></dir><dir name="Exception"><file name="Base.php" hash="c54d68353f3f7d765baac10f8900af16"/><file name="ConnectFailed.php" hash="af790857c2ee9972eb1dd0df6b90de68"/><file name="ConnectProblem.php" hash="dd2df3be3af51a621b7ec9df1fd5f8fb"/><file name="SignupFailed.php" hash="88fadc5990ec7a6fce5e1feb8c931ffa"/></dir><dir name="Helper"><file name="Account.php" hash="f4b560d1baff04f76f3fb03051e030f8"/><file name="Connect.php" hash="ff7d4707a8897ffc7c9f720fa7ff9f20"/><file name="Data.php" hash="9bd5c406141e8b7e62d725815bde5d2e"/><file name="Settings.php" hash="0ccc392ed93d70a39608b49e66dd993a"/></dir><dir name="Model"><file name="Buttons.php" hash="3c8e6136df4111c3100919b107ba6726"/><file name="Liveagent.php" hash="2c08986c55f107c7398c8f4e7ba99737"/><dir name="Mysql4"><dir name="Buttons"><file name="Collection.php" hash="64edb5ecfc9b1511ae155f347e9a0e6b"/></dir><file name="Buttons.php" hash="5c2fd7184c1bb88b381ef8440bfe1e4f"/><dir name="Liveagent"><file name="Collection.php" hash="29675fde5a317fdf980a549f40502b8e"/></dir><file name="Liveagent.php" hash="559e305b52289e79f9038aea53a85a48"/><dir name="Settings"><file name="Collection.php" hash="d9dfc6b2abadf95ad6dbdee9f52f9c28"/></dir><file name="Settings.php" hash="cdded3171b84b02ed4ad360dd3cb7b71"/></dir><file name="Settings.php" hash="2a8a09ccebe4fc6368597422ea5f66e6"/><file name="Status.php" hash="4e2f42f52c7cdc51388ce9dee5d2f85a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LiveagentController.php" hash="06fd82a6e114265b876d9d3852c031cf"/></dir><file name="IndexController.php" hash="2af5a61bf7319c38c97a48e0f3723598"/></dir><dir name="etc"><file name="config.xml" hash="fa781b6bacd44ff97435f4f52721d93e"/></dir><dir name="sql"><dir name="liveagent_setup"><file name="mysql4-install-0.1.0.php" hash="aaf89c3a8e551318bae3891e44c4d06e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="liveagent.xml" hash="5a77968b68e659dc21bdad2605210333"/></dir><dir name="template"><dir name="liveagent"><file name="button.phtml" hash="dfe28e1f477153f996c8718a49a758cd"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="liveagent.xml" hash="a352f2029be0457410b0939c3aa4b62f"/></dir><dir name="template"><dir name="liveagent"><file name="button.phtml" hash="102ff91b93dfe01c8ac1ba4e6ed5d2ae"/><file name="report.phtml" hash="2100c3c18095186bd660c6cb66c00fc5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Qualityunit_Liveagent.xml" hash="d14a360dc3dd4c32fa4204270f426612"/></dir></target><target name="magelocale"><dir name="en_US"><file name="qualityunit_liveagent.csv" hash="ddb1b449beb20afedd1d63abb446fc4e"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="liveagent"><dir name="css"><file name="animation.css" hash="e114422983f975cac20edbe5a12fdb37"/><dir name="fonts"><file name="OpenSans-Bold-webfont.eot" hash="7e78b345bbb56eb154a32396524b5650"/><file name="OpenSans-Bold-webfont.svg" hash="ba40976c12378dfdcd0c0b1b2747421b"/><file name="OpenSans-Bold-webfont.ttf" hash="0b6240e6a9217e44e77bbda8a2ed2bb0"/><file name="OpenSans-Bold-webfont.woff" hash="769a36776804007ab23b7266b22be392"/><file name="OpenSans-Light-webfont.eot" hash="5d5f7deb21a0609f0b12ae5332cfb6b9"/><file name="OpenSans-Light-webfont.svg" hash="93d6578a9051feb87bf857cbb3cabdb7"/><file name="OpenSans-Light-webfont.ttf" hash="4eb5ea0a1bc989d3bfeb9423be53e78f"/><file name="OpenSans-Light-webfont.woff" hash="798bf3bb0819ff94c7c8fd0142f58d22"/><file name="OpenSans-Regular-webfont.eot" hash="3b721cb588d7b323137bd456c237b116"/><file name="OpenSans-Regular-webfont.svg" hash="3b461c91b64d27057676c1a4562b3a15"/><file name="OpenSans-Regular-webfont.ttf" hash="50700928d66c83bc7501ce99690b265a"/><file name="OpenSans-Regular-webfont.woff" hash="9e002ce4035a849d41b9ba83993083d7"/></dir><file name="la_logo.svg" hash="686ec663e568d38de97df58b915f95f6"/><file name="lock.png" hash="7380f52e49851581388b2cd7c8a5d7bd"/><file name="ok_icon.png" hash="e66785de1c506b6f9635d97f35e0c7df"/><file name="report.css" hash="6d75d81d824b4f02db7ab63e595a85cc"/><file name="responsive.css" hash="a3dff048c1feec42f1efc8f066a70a0f"/><file name="style.css" hash="236fa1cec84b5b26261b244cf355659b"/><file name="video.jpg" hash="57d38a4cb802f6009f2f3b0a768d6fc2"/></dir><dir name="js"><file name="jquery-1.11.3.min.js" hash="895323ed2f7258af4fae2c738c8aea49"/><file name="jquery-no-conflict.js" hash="644f0006e36a235d2a6df494bed48636"/><file name="jquery.alphanum.js" hash="3610a43bb5a6892f7e1aae03f05582c2"/><file name="jquery.cookie.js" hash="d5528dde0006c78be04817327c2f9b6f"/><file name="jquery.validate.min.js" hash="d7342d64b483db4cdc836047765c07f3"/><file name="lasignup.js" hash="909a3b89631232c9d782139eb00ecdc4"/></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>7.5.0</max></php><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Liveagent</name>
4
+ <version>3.0.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.gnu.org/licenses/gpl-3.0.txt">GPLv3</license>
7
  <channel>community</channel>
9
  <summary>LiveAgent plugin integrates well known help desk and live chat software into any Magento installation. No HTML knowledge is required.</summary>
10
  <description>Magento-LiveAgent plugin integrates full featured help desk and live chat software Live Agent into any Magento installation.&#xD;
11
  Start by entering your existing account details or easily create one and then just choose which button you want to use for you shop. You are done in few clicks!</description>
12
+ <notes>- minor changes in API fixing redirect to secured page</notes>
13
  <authors><author><name>Quality Unit, LLC</name><user>support</user><email>support@qualityunit.com</email></author></authors>
14
+ <date>2016-02-04</date>
15
+ <time>05:32:39</time>
16
+ <contents><target name="magelocal"><dir name="Qualityunit"><dir name="Liveagent"><dir name="Block"><file name="AccountConnect.php" hash="8e1d5a6f83b283c440fccaf7c60c3c10"/><file name="Base.php" hash="86155f5e3264655ceb130dab28c405b6"/><file name="Buttoncode.php" hash="5a7c60199f39ac77d7ccfb2bec3ce2a7"/><file name="Signup.php" hash="4b5c66377a62f53696866964a386cef5"/></dir><dir name="Exception"><file name="Base.php" hash="c54d68353f3f7d765baac10f8900af16"/><file name="ConnectFailed.php" hash="af790857c2ee9972eb1dd0df6b90de68"/><file name="ConnectProblem.php" hash="dd2df3be3af51a621b7ec9df1fd5f8fb"/><file name="SignupFailed.php" hash="88fadc5990ec7a6fce5e1feb8c931ffa"/></dir><dir name="Helper"><file name="Account.php" hash="f4b560d1baff04f76f3fb03051e030f8"/><file name="Connect.php" hash="792d5a829bb069c14186665ae587f465"/><file name="Data.php" hash="9bd5c406141e8b7e62d725815bde5d2e"/><file name="Settings.php" hash="0ccc392ed93d70a39608b49e66dd993a"/></dir><dir name="Model"><file name="Buttons.php" hash="3c8e6136df4111c3100919b107ba6726"/><file name="Liveagent.php" hash="2c08986c55f107c7398c8f4e7ba99737"/><dir name="Mysql4"><dir name="Buttons"><file name="Collection.php" hash="64edb5ecfc9b1511ae155f347e9a0e6b"/></dir><file name="Buttons.php" hash="5c2fd7184c1bb88b381ef8440bfe1e4f"/><dir name="Liveagent"><file name="Collection.php" hash="29675fde5a317fdf980a549f40502b8e"/></dir><file name="Liveagent.php" hash="559e305b52289e79f9038aea53a85a48"/><dir name="Settings"><file name="Collection.php" hash="d9dfc6b2abadf95ad6dbdee9f52f9c28"/></dir><file name="Settings.php" hash="cdded3171b84b02ed4ad360dd3cb7b71"/></dir><file name="Settings.php" hash="2a8a09ccebe4fc6368597422ea5f66e6"/><file name="Status.php" hash="4e2f42f52c7cdc51388ce9dee5d2f85a"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LiveagentController.php" hash="05f6610407d02de85dc8e96806be2165"/></dir><file name="IndexController.php" hash="2af5a61bf7319c38c97a48e0f3723598"/></dir><dir name="etc"><file name="config.xml" hash="fa781b6bacd44ff97435f4f52721d93e"/></dir><dir name="sql"><dir name="liveagent_setup"><file name="mysql4-install-0.1.0.php" hash="aaf89c3a8e551318bae3891e44c4d06e"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="liveagent.xml" hash="5a77968b68e659dc21bdad2605210333"/></dir><dir name="template"><dir name="liveagent"><file name="button.phtml" hash="dfe28e1f477153f996c8718a49a758cd"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="liveagent.xml" hash="a352f2029be0457410b0939c3aa4b62f"/></dir><dir name="template"><dir name="liveagent"><file name="button.phtml" hash="102ff91b93dfe01c8ac1ba4e6ed5d2ae"/><file name="report.phtml" hash="2100c3c18095186bd660c6cb66c00fc5"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Qualityunit_Liveagent.xml" hash="d14a360dc3dd4c32fa4204270f426612"/></dir></target><target name="magelocale"><dir name="en_US"><file name="qualityunit_liveagent.csv" hash="ddb1b449beb20afedd1d63abb446fc4e"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="liveagent"><dir name="css"><file name="animation.css" hash="e114422983f975cac20edbe5a12fdb37"/><dir name="fonts"><file name="OpenSans-Bold-webfont.eot" hash="7e78b345bbb56eb154a32396524b5650"/><file name="OpenSans-Bold-webfont.svg" hash="ba40976c12378dfdcd0c0b1b2747421b"/><file name="OpenSans-Bold-webfont.ttf" hash="0b6240e6a9217e44e77bbda8a2ed2bb0"/><file name="OpenSans-Bold-webfont.woff" hash="769a36776804007ab23b7266b22be392"/><file name="OpenSans-Light-webfont.eot" hash="5d5f7deb21a0609f0b12ae5332cfb6b9"/><file name="OpenSans-Light-webfont.svg" hash="93d6578a9051feb87bf857cbb3cabdb7"/><file name="OpenSans-Light-webfont.ttf" hash="4eb5ea0a1bc989d3bfeb9423be53e78f"/><file name="OpenSans-Light-webfont.woff" hash="798bf3bb0819ff94c7c8fd0142f58d22"/><file name="OpenSans-Regular-webfont.eot" hash="3b721cb588d7b323137bd456c237b116"/><file name="OpenSans-Regular-webfont.svg" hash="3b461c91b64d27057676c1a4562b3a15"/><file name="OpenSans-Regular-webfont.ttf" hash="50700928d66c83bc7501ce99690b265a"/><file name="OpenSans-Regular-webfont.woff" hash="9e002ce4035a849d41b9ba83993083d7"/></dir><file name="la_logo.svg" hash="686ec663e568d38de97df58b915f95f6"/><file name="lock.png" hash="7380f52e49851581388b2cd7c8a5d7bd"/><file name="ok_icon.png" hash="e66785de1c506b6f9635d97f35e0c7df"/><file name="report.css" hash="6d75d81d824b4f02db7ab63e595a85cc"/><file name="responsive.css" hash="a3dff048c1feec42f1efc8f066a70a0f"/><file name="style.css" hash="236fa1cec84b5b26261b244cf355659b"/><file name="video.jpg" hash="57d38a4cb802f6009f2f3b0a768d6fc2"/></dir><dir name="js"><file name="jquery-1.11.3.min.js" hash="895323ed2f7258af4fae2c738c8aea49"/><file name="jquery-no-conflict.js" hash="644f0006e36a235d2a6df494bed48636"/><file name="jquery.alphanum.js" hash="3610a43bb5a6892f7e1aae03f05582c2"/><file name="jquery.cookie.js" hash="d5528dde0006c78be04817327c2f9b6f"/><file name="jquery.validate.min.js" hash="d7342d64b483db4cdc836047765c07f3"/><file name="lasignup.js" hash="909a3b89631232c9d782139eb00ecdc4"/></dir></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>7.5.0</max></php><extension><name>curl</name><min></min><max></max></extension></required></dependencies>
19
  </package>