Version Notes
Tagove will help you cut the waiting time for phone calls to reach out your customers.
Download this release
Release Info
Developer | Tagove Chat |
Extension | JTT_Tagove |
Version | 1.0.5 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.5
- app/code/community/JTT/Tagove/Block/Script.php +10 -13
- package.xml +4 -4
app/code/community/JTT/Tagove/Block/Script.php
CHANGED
@@ -21,24 +21,28 @@ class JTT_Tagove_Block_Script extends Mage_Core_Block_Template
|
|
21 |
*/
|
22 |
private function getPostUrlContents($url,$data){
|
23 |
|
|
|
|
|
24 |
if(function_exists('curl_init')){
|
25 |
$ch = curl_init();
|
26 |
|
27 |
// define options
|
28 |
$optArray = array(
|
29 |
-
CURLOPT_URL => '
|
30 |
CURLOPT_RETURNTRANSFER => true,
|
31 |
CURLOPT_POSTFIELDS =>1,
|
|
|
32 |
CURLOPT_POSTFIELDS=>http_build_query($data)
|
33 |
);
|
34 |
|
35 |
curl_setopt_array($ch, $optArray);
|
36 |
|
37 |
$result = curl_exec($ch);
|
|
|
38 |
return $result;
|
39 |
} else {
|
40 |
|
41 |
-
return file_get_contents('
|
42 |
'http' => array(
|
43 |
'method' => 'POST',
|
44 |
'header' => 'Content-type: application/x-www-form-urlencoded',
|
@@ -59,12 +63,13 @@ class JTT_Tagove_Block_Script extends Mage_Core_Block_Template
|
|
59 |
$tagove_password = Mage::getStoreConfig('tagove_options/jtt_tagove/tagove_password');
|
60 |
|
61 |
$result = $this->getPostUrlContents('user/login',array(
|
62 |
-
'
|
63 |
-
'Login'=>'Login',
|
64 |
'Email'=>$tagove_email,
|
65 |
'Password'=>$tagove_password,
|
66 |
));
|
67 |
|
|
|
|
|
68 |
if(stripos($result, 'error') !== false)
|
69 |
{
|
70 |
return "Login Failed";
|
@@ -73,15 +78,7 @@ class JTT_Tagove_Block_Script extends Mage_Core_Block_Template
|
|
73 |
else {
|
74 |
|
75 |
|
76 |
-
$chat_script =
|
77 |
-
(function() {
|
78 |
-
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
|
79 |
-
var refferer = (document.referrer) ? encodeURIComponent(document.referrer.substr(document.referrer.indexOf('://')+1)) : '';
|
80 |
-
var location = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : '';
|
81 |
-
po.src = '//".TAGOVE_URL."/chat/getstatus/(site_uid)/$result/?r='+refferer+'&l='+location;
|
82 |
-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
|
83 |
-
})();</script>";
|
84 |
-
// $chat_code;//die;
|
85 |
|
86 |
|
87 |
return $chat_script;
|
21 |
*/
|
22 |
private function getPostUrlContents($url,$data){
|
23 |
|
24 |
+
|
25 |
+
|
26 |
if(function_exists('curl_init')){
|
27 |
$ch = curl_init();
|
28 |
|
29 |
// define options
|
30 |
$optArray = array(
|
31 |
+
CURLOPT_URL => 'https://'.TAGOVE_URL.'/'.$url,
|
32 |
CURLOPT_RETURNTRANSFER => true,
|
33 |
CURLOPT_POSTFIELDS =>1,
|
34 |
+
CURLOPT_SSL_VERIFYPEER => false,
|
35 |
CURLOPT_POSTFIELDS=>http_build_query($data)
|
36 |
);
|
37 |
|
38 |
curl_setopt_array($ch, $optArray);
|
39 |
|
40 |
$result = curl_exec($ch);
|
41 |
+
|
42 |
return $result;
|
43 |
} else {
|
44 |
|
45 |
+
return file_get_contents('https://'.TAGOVE_URL.'/'.$url,false,stream_context_create(array(
|
46 |
'http' => array(
|
47 |
'method' => 'POST',
|
48 |
'header' => 'Content-type: application/x-www-form-urlencoded',
|
63 |
$tagove_password = Mage::getStoreConfig('tagove_options/jtt_tagove/tagove_password');
|
64 |
|
65 |
$result = $this->getPostUrlContents('user/login',array(
|
66 |
+
'v2' => true,
|
|
|
67 |
'Email'=>$tagove_email,
|
68 |
'Password'=>$tagove_password,
|
69 |
));
|
70 |
|
71 |
+
|
72 |
+
|
73 |
if(stripos($result, 'error') !== false)
|
74 |
{
|
75 |
return "Login Failed";
|
78 |
else {
|
79 |
|
80 |
|
81 |
+
$chat_script = $result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
|
84 |
return $chat_script;
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>JTT_Tagove</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
@@ -42,9 +42,9 @@ Check your operator console on your web browser, log into <a href="http://app
|
|
42 |
For questions and suggestions, please use the contact form on the <a href="http://www.tagove.com/contact/">contact page</a>.</description>
|
43 |
<notes>Tagove will help you cut the waiting time for phone calls to reach out your customers.</notes>
|
44 |
<authors><author><name>Tagove Chat</name><user>tagove</user><email>info@tagove.com</email></author></authors>
|
45 |
-
<date>
|
46 |
-
<time>
|
47 |
-
<contents><target name="magecommunity"><dir name="JTT"><dir name="Tagove"><dir name="Block"><file name="Script.php" hash="
|
48 |
<compatible/>
|
49 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
50 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>JTT_Tagove</name>
|
4 |
+
<version>1.0.5</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
7 |
<channel>community</channel>
|
42 |
For questions and suggestions, please use the contact form on the <a href="http://www.tagove.com/contact/">contact page</a>.</description>
|
43 |
<notes>Tagove will help you cut the waiting time for phone calls to reach out your customers.</notes>
|
44 |
<authors><author><name>Tagove Chat</name><user>tagove</user><email>info@tagove.com</email></author></authors>
|
45 |
+
<date>2016-01-16</date>
|
46 |
+
<time>15:45:09</time>
|
47 |
+
<contents><target name="magecommunity"><dir name="JTT"><dir name="Tagove"><dir name="Block"><file name="Script.php" hash="76b246dcf4c4a252b822207aff789d1b"/></dir><dir name="Helper"><file name="Data.php" hash="604d07874db4b308cacfd06418bb1ebb"/></dir><dir name="etc"><file name="config.xml" hash="130ce3527950e75d0741d0955fc5fe00"/><file name="system.xml" hash="cd6cf1a28fa51c39e123a25e958a7187"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="JTT_Tagove.xml" hash="cc525e36507cb0812fa74d675be110d9"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="tagove.xml" hash="ba4882b68e602687ee6b9a945c8e4f42"/></dir><dir name="template"><dir name="tagove"><file name="main.phtml" hash="0e0e8614e5da928e3be11989097a00b0"/></dir></dir></dir></dir></dir></target></contents>
|
48 |
<compatible/>
|
49 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
50 |
</package>
|