Version Notes
Fourth release of social login
Download this release
Release Info
Developer | LoginRadius Team |
Extension | LoginRadius |
Version | 1.2.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.0 to 1.2.1
- app/code/community/Loginradius/Sociallogin/Block/Sociallogin.php +108 -107
- app/code/community/Loginradius/Sociallogin/etc/config.xml +1 -1
- app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/{mysql4-install-1.2.0.php → mysql4-install-1.2.1.php} +0 -0
- app/design/frontend/default/default/layout/sociallogin.xml +1 -1
- package.xml +5 -5
app/code/community/Loginradius/Sociallogin/Block/Sociallogin.php
CHANGED
@@ -1,108 +1,109 @@
|
|
1 |
-
<?php
|
2 |
-
class Loginradius_Sociallogin_Block_Sociallogin extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
public function _prepareLayout()
|
5 |
-
{
|
6 |
-
return parent::_prepareLayout();
|
7 |
-
}
|
8 |
-
public function getSociallogin()
|
9 |
-
{
|
10 |
-
if (!$this->hasData('sociallogin')) {
|
11 |
-
$this->setData('sociallogin', Mage::registry('sociallogin'));
|
12 |
-
}
|
13 |
-
return $this->getData('sociallogin');
|
14 |
-
}
|
15 |
-
public function user_is_already_login() {
|
16 |
-
if( Mage::getSingleton('customer/session')->isLoggedIn() ){
|
17 |
-
return true;
|
18 |
-
}
|
19 |
-
return false;
|
20 |
-
}
|
21 |
-
public function getApikey()
|
22 |
-
{
|
23 |
-
return Mage::getStoreConfig('sociallogin_options/messages/appid');
|
24 |
-
}
|
25 |
-
public function getShowDefault()
|
26 |
-
{
|
27 |
-
return Mage::getStoreConfig('sociallogin_options/messages/showdefault');
|
28 |
-
}
|
29 |
-
public function getApiSecret()
|
30 |
-
{
|
31 |
-
return Mage::getStoreConfig('sociallogin_options/messages/appkey');
|
32 |
-
}
|
33 |
-
public function getRedirectOption(){
|
34 |
-
|
35 |
-
return Mage::getStoreConfig('sociallogin_options/messages/redirect');
|
36 |
-
}
|
37 |
-
public function getApiOption(){
|
38 |
-
|
39 |
-
return Mage::getStoreConfig('sociallogin_options/messages/api');
|
40 |
-
}
|
41 |
-
|
42 |
-
public function getEmailRequired(){
|
43 |
-
|
44 |
-
return Mage::getStoreConfig('sociallogin_options/messages/emailrequired');
|
45 |
-
}
|
46 |
-
public function getCallBack(){
|
47 |
-
|
48 |
-
return Mage::getStoreConfig('sociallogin_options/messages/call');
|
49 |
-
}
|
50 |
-
public function getProfileResult($ApiSecrete)
|
51 |
-
{
|
52 |
-
if(isset($_REQUEST['token'])) {
|
53 |
-
$ValidateUrl = "http://hub.loginradius.com/userprofile.ashx?token=".$_REQUEST['token']."&apisecrete="
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
curl_setopt($curl_handle,
|
73 |
-
curl_setopt($curl_handle,
|
74 |
-
|
75 |
-
|
76 |
-
curl_setopt($curl_handle,
|
77 |
-
$
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
$
|
83 |
-
$
|
84 |
-
|
85 |
-
curl_setopt($ch,
|
86 |
-
$
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
$
|
98 |
-
$
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
108 |
}
|
1 |
+
<?php
|
2 |
+
class Loginradius_Sociallogin_Block_Sociallogin extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
public function getSociallogin()
|
9 |
+
{
|
10 |
+
if (!$this->hasData('sociallogin')) {
|
11 |
+
$this->setData('sociallogin', Mage::registry('sociallogin'));
|
12 |
+
}
|
13 |
+
return $this->getData('sociallogin');
|
14 |
+
}
|
15 |
+
public function user_is_already_login() {
|
16 |
+
if( Mage::getSingleton('customer/session')->isLoggedIn() ){
|
17 |
+
return true;
|
18 |
+
}
|
19 |
+
return false;
|
20 |
+
}
|
21 |
+
public function getApikey()
|
22 |
+
{
|
23 |
+
return Mage::getStoreConfig('sociallogin_options/messages/appid');
|
24 |
+
}
|
25 |
+
public function getShowDefault()
|
26 |
+
{
|
27 |
+
return Mage::getStoreConfig('sociallogin_options/messages/showdefault');
|
28 |
+
}
|
29 |
+
public function getApiSecret()
|
30 |
+
{
|
31 |
+
return Mage::getStoreConfig('sociallogin_options/messages/appkey');
|
32 |
+
}
|
33 |
+
public function getRedirectOption(){
|
34 |
+
|
35 |
+
return Mage::getStoreConfig('sociallogin_options/messages/redirect');
|
36 |
+
}
|
37 |
+
public function getApiOption(){
|
38 |
+
|
39 |
+
return Mage::getStoreConfig('sociallogin_options/messages/api');
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getEmailRequired(){
|
43 |
+
|
44 |
+
return Mage::getStoreConfig('sociallogin_options/messages/emailrequired');
|
45 |
+
}
|
46 |
+
public function getCallBack(){
|
47 |
+
|
48 |
+
return Mage::getStoreConfig('sociallogin_options/messages/call');
|
49 |
+
}
|
50 |
+
public function getProfileResult($ApiSecrete)
|
51 |
+
{
|
52 |
+
if(isset($_REQUEST['token'])) {
|
53 |
+
$ValidateUrl = "http://hub.loginradius.com/userprofile.ashx?token=".$_REQUEST['token']."&apisecrete=".trim($ApiSecrete);
|
54 |
+
return $this->getApiCall($ValidateUrl);
|
55 |
+
}
|
56 |
+
}
|
57 |
+
public function getApiResult($ApiKey, $ApiSecrete)
|
58 |
+
{
|
59 |
+
if ( !empty($ApiKey) && !empty($ApiSecrete) && preg_match('/^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i', $ApiKey) && preg_match('/^\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\}?$/i', $ApiSecrete) ) {
|
60 |
+
$url = "https://hub.loginradius.com/getappinfo/$ApiKey/$ApiSecrete";
|
61 |
+
return $this->getApiCall($url);
|
62 |
+
}
|
63 |
+
else {
|
64 |
+
return false;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
public function getApiCall($url)
|
68 |
+
{
|
69 |
+
|
70 |
+
if ( $this->getApiOption() == 'curl' ){
|
71 |
+
$curl_handle = curl_init();
|
72 |
+
curl_setopt($curl_handle, CURLOPT_URL, $url);
|
73 |
+
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 3);
|
74 |
+
curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);
|
75 |
+
if (ini_get('open_basedir') == '' && (ini_get('safe_mode') == 'Off' or !ini_get('safe_mode'))) {
|
76 |
+
curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
|
77 |
+
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
|
78 |
+
$JsonResponse = curl_exec($curl_handle);
|
79 |
+
}else {
|
80 |
+
curl_setopt($curl_handle, CURLOPT_HEADER, 1);
|
81 |
+
$url = curl_getinfo($curl_handle, CURLINFO_EFFECTIVE_URL);
|
82 |
+
curl_close($curl_handle);
|
83 |
+
$ch = curl_init();
|
84 |
+
$url = str_replace('?','/?',$url);
|
85 |
+
curl_setopt($ch, CURLOPT_URL, $url);
|
86 |
+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
87 |
+
$JsonResponse = curl_exec($ch);
|
88 |
+
curl_close($ch);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
elseif($this->getApiOption() == 'fopen') {
|
92 |
+
|
93 |
+
$JsonResponse = file_get_contents($url);
|
94 |
+
}else {
|
95 |
+
|
96 |
+
$method = 'GET';
|
97 |
+
$client = new Varien_Http_Client($url);
|
98 |
+
$response = $client->request($method);
|
99 |
+
$JsonResponse = $response->getBody();
|
100 |
+
}
|
101 |
+
if ($JsonResponse) {
|
102 |
+
return json_decode($JsonResponse);
|
103 |
+
}
|
104 |
+
else {
|
105 |
+
return "something went wrong, Can not get api response.";
|
106 |
+
}
|
107 |
+
|
108 |
+
}
|
109 |
}
|
app/code/community/Loginradius/Sociallogin/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Loginradius_Sociallogin>
|
5 |
-
<version>1.2.
|
6 |
</Loginradius_Sociallogin>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Loginradius_Sociallogin>
|
5 |
+
<version>1.2.1</version>
|
6 |
</Loginradius_Sociallogin>
|
7 |
</modules>
|
8 |
<frontend>
|
app/code/community/Loginradius/Sociallogin/sql/sociallogin_setup/{mysql4-install-1.2.0.php → mysql4-install-1.2.1.php}
RENAMED
File without changes
|
app/design/frontend/default/default/layout/sociallogin.xml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
-
<layout version="1.2.
|
3 |
<default>
|
4 |
<reference name="right">
|
5 |
<block type="sociallogin/sociallogin" name="sociallogin" template="sociallogin/sociallogin.phtml" />
|
1 |
<?xml version="1.0"?>
|
2 |
+
<layout version="1.2.1">
|
3 |
<default>
|
4 |
<reference name="right">
|
5 |
<block type="sociallogin/sociallogin" name="sociallogin" template="sociallogin/sociallogin.phtml" />
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>LoginRadius</name>
|
4 |
-
<version>1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Social Login for Magento</summary>
|
10 |
<description>Add Social Login to your Magento website and also get accurate User Profile Data and Social Analytics.</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>LoginRadius Team</name><user>LoginRadius</user><email>developers@loginradius.com</email></author></authors>
|
13 |
-
<date>2012-
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>LoginRadius</name>
|
4 |
+
<version>1.2.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>GNU General Public License (GPL)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Social Login for Magento</summary>
|
10 |
<description>Add Social Login to your Magento website and also get accurate User Profile Data and Social Analytics.</description>
|
11 |
+
<notes>Fourth release of social login</notes>
|
12 |
<authors><author><name>LoginRadius Team</name><user>LoginRadius</user><email>developers@loginradius.com</email></author></authors>
|
13 |
+
<date>2012-10-11</date>
|
14 |
+
<time>17:16:45</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Loginradius"><dir name="Sociallogin"><dir name="Block"><file name="Auth.php" hash="e4563c133d7a52e32a33de71f86e21df"/><file name="Info.php" hash="be7d35ed710f898000f03ae5426d755a"/><file name="Sociallogin.php" hash="9d56ce6a067c2c40907b3c82466598ae"/></dir><dir name="Helper"><file name="Data.php" hash="8a82c0ca3478c9aa5cef4db99003d311"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Sociallogin"><file name="Collection.php" hash="a32296c7f53c420ca655439416771653"/></dir><file name="Sociallogin.php" hash="ed906cba7eb16d8b0a343baf8baa9b42"/></dir><file name="Sociallogin.php" hash="c71f4160bba6b0b26c4cf38b9448b22b"/><dir name="Source"><file name="Uihover.php" hash="6c6ba75ff19328c512dea06b3ce73484"/><file name="Uihover2.php" hash="ce80c1d278040b7e11bb353baf0cc275"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="52b71377f2312311d48d56f2f4ae5d26"/><file name="inc.php" hash="0268ecb5f1b2e0befc4d1534798a2f51"/></dir><dir name="etc"><file name="config.xml" hash="1f585f48abcfbdc5bafcb24be1c8b6e1"/><file name="system.xml" hash="6f23fd5b68eec18ecab9a981a484daab"/><file name="widget.xml" hash="1e21bd95f5b940dc0d924c86c531c870"/></dir><dir name="sql"><dir name="sociallogin_setup"><file name="mysql4-install-1.2.1.php" hash="6598e12a0948680a0e2826ed7c5486bc"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="sociallogin.xml" hash="515c603ee838ba4080e071f9a129c612"/></dir><dir name="template"><dir name="sociallogin"><file name="sociallogin.phtml" hash="854274fd61c7d21517a54b8017fe2701"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Loginradius_Sociallogin.xml" hash="6c5bb03c460936006692aa1d01d142ba"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|