Version Notes
smp login updated
Download this release
Release Info
| Developer | KremsaDigital |
| Extension | StarSMP_Customers_Tracking_Integration |
| Version | 1.0.7 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.6 to 1.0.7
- js/KremsaDigital/StarSocial/smp_login.php +22 -16
- package.xml +5 -5
js/KremsaDigital/StarSocial/smp_login.php
CHANGED
|
@@ -1,6 +1,4 @@
|
|
| 1 |
<?php
|
| 2 |
-
if(!empty($_POST['tkn']))
|
| 3 |
-
{
|
| 4 |
if (!defined('MAGENTO_ROOT'))
|
| 5 |
define('MAGENTO_ROOT', getcwd());
|
| 6 |
|
|
@@ -13,24 +11,32 @@ $mageFilename = MAGENTO_ROOT . '/../../../app/Mage.php';
|
|
| 13 |
|
| 14 |
require_once $mageFilename;
|
| 15 |
umask(0);
|
| 16 |
-
Mage::app();
|
| 17 |
|
| 18 |
require_once(Mage::getBaseDir('lib') . '/KremsaDigital/StarSocial/starsmp.php');
|
| 19 |
|
| 20 |
define("SMP_CLIENT_ID", Mage::getStoreConfig('starsocial/conf/client_id'));
|
| 21 |
define("SMP_CLIENT_SECRET", Mage::getStoreConfig('starsocial/conf/client_secret'));
|
| 22 |
|
| 23 |
-
|
| 24 |
-
Mage::getSingleton('core/session', array('name'=>'frontend'))
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
}
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
}
|
| 1 |
<?php
|
|
|
|
|
|
|
| 2 |
if (!defined('MAGENTO_ROOT'))
|
| 3 |
define('MAGENTO_ROOT', getcwd());
|
| 4 |
|
| 11 |
|
| 12 |
require_once $mageFilename;
|
| 13 |
umask(0);
|
| 14 |
+
Mage::app('default');
|
| 15 |
|
| 16 |
require_once(Mage::getBaseDir('lib') . '/KremsaDigital/StarSocial/starsmp.php');
|
| 17 |
|
| 18 |
define("SMP_CLIENT_ID", Mage::getStoreConfig('starsocial/conf/client_id'));
|
| 19 |
define("SMP_CLIENT_SECRET", Mage::getStoreConfig('starsocial/conf/client_secret'));
|
| 20 |
|
| 21 |
+
Mage::getSingleton('core/session', array('name' => 'frontend'));
|
| 22 |
+
$core_session = Mage::getSingleton('core/session', array('name' => 'frontend'));
|
| 23 |
+
$session = Mage::getSingleton('customer/session', array('name' => 'frontend'));
|
| 24 |
+
|
| 25 |
+
if (!empty($_POST['tkn'])) {
|
| 26 |
+
$ret = $_POST['tkn'] != $core_session->getSmpToken() ? "updated" : "not_changed";
|
| 27 |
+
$core_session->setSmpToken($_POST['tkn']);
|
| 28 |
+
echo json_encode(array("result" => $ret));
|
| 29 |
+
} else {
|
| 30 |
+
$customer = $session->getCustomer();
|
| 31 |
+
$isLoggedIn = $session->isLoggedIn();
|
| 32 |
+
if ($isLoggedIn) {
|
| 33 |
+
$signed_request = StarSMP::create_signed_request(array(
|
| 34 |
+
"email" => $customer->getEmail()
|
| 35 |
+
), SMP_CLIENT_SECRET);
|
| 36 |
+
|
| 37 |
+
echo json_encode(array("signedRequest" => $signed_request));
|
| 38 |
+
} else {
|
| 39 |
+
echo json_encode(array("signedRequest" => ""));
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
}
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>StarSMP_Customers_Tracking_Integration</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -21,11 +21,11 @@ StarSMP Universal Tag Features: 
|
|
| 21 |
- add custom tracking codes
|
| 22 |
- automatically deploys to your Magento e-shop
|
| 23 |
- control access to your tracking codes</description>
|
| 24 |
-
<notes>
|
| 25 |
<authors><author><name>KremsaDigital</name><user>kremsa_design</user><email>kremsa.office.sk@gmail.com</email></author></authors>
|
| 26 |
-
<date>2014-10-
|
| 27 |
-
<time>
|
| 28 |
-
<contents><target name="magecommunity"><dir name="KremsaDigital"><dir name="StarSocial"><dir name="Helper"><file name="Data.php" hash="85963ac4a639c694b7db915ef5905c44"/></dir><dir name="Model"><file name="Observer.php" hash="6d4acd24a0b80e70dc7ea57143dacd13"/><file name="Track.php" hash="3de832a0f158cd173a036b93eb0dd028"/></dir><dir name="etc"><file name="adminhtml.xml" hash="735e6dfffa1e18830ec0f9a061eaa480"/><file name="config.xml" hash="61597357d6b60c410183b07ba296129b"/><file name="system.xml" hash="5c4f4fdb3735ea7c3396dcf681509e86"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="KremsaDesign_StarSocial.xml" hash="f07ad022b4e7aaa1c67f0bd9d2458f99"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="StarSocial.xml" hash="44aa76355559f1ab659e76fa5767dbd2"/></dir><dir name="template"><dir name="starsocial"><file name="tags-checkout.phtml" hash="f1986a33e545c1246ad07fa7fa5d2a4b"/><file name="tags.phtml" hash="833114f709760c4b7dd578675a9d564e"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="KremsaDigital"><dir name="StarSocial"><file name="channel.html" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="smp_login.php" hash="
|
| 29 |
<compatible/>
|
| 30 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 31 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>StarSMP_Customers_Tracking_Integration</name>
|
| 4 |
+
<version>1.0.7</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
| 21 |
- add custom tracking codes
|
| 22 |
- automatically deploys to your Magento e-shop
|
| 23 |
- control access to your tracking codes</description>
|
| 24 |
+
<notes>smp login updated</notes>
|
| 25 |
<authors><author><name>KremsaDigital</name><user>kremsa_design</user><email>kremsa.office.sk@gmail.com</email></author></authors>
|
| 26 |
+
<date>2014-10-18</date>
|
| 27 |
+
<time>13:31:22</time>
|
| 28 |
+
<contents><target name="magecommunity"><dir name="KremsaDigital"><dir name="StarSocial"><dir name="Helper"><file name="Data.php" hash="85963ac4a639c694b7db915ef5905c44"/></dir><dir name="Model"><file name="Observer.php" hash="6d4acd24a0b80e70dc7ea57143dacd13"/><file name="Track.php" hash="3de832a0f158cd173a036b93eb0dd028"/></dir><dir name="etc"><file name="adminhtml.xml" hash="735e6dfffa1e18830ec0f9a061eaa480"/><file name="config.xml" hash="61597357d6b60c410183b07ba296129b"/><file name="system.xml" hash="5c4f4fdb3735ea7c3396dcf681509e86"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="KremsaDesign_StarSocial.xml" hash="f07ad022b4e7aaa1c67f0bd9d2458f99"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="StarSocial.xml" hash="44aa76355559f1ab659e76fa5767dbd2"/></dir><dir name="template"><dir name="starsocial"><file name="tags-checkout.phtml" hash="f1986a33e545c1246ad07fa7fa5d2a4b"/><file name="tags.phtml" hash="833114f709760c4b7dd578675a9d564e"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="KremsaDigital"><dir name="StarSocial"><file name="channel.html" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="smp_login.php" hash="5c930b782c47cc798254c7b60f998aee"/></dir></dir></dir></target><target name="magelib"><dir name="KremsaDigital"><dir name="StarSocial"><file name="starsmp.php" hash="d6c0f4ca17813c9ce955fab7b10cb40a"/></dir></dir></target></contents>
|
| 29 |
<compatible/>
|
| 30 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 31 |
</package>
|
