Version Notes
Please, feel free to contact us at store@belvg.com
Download this release
Release Info
Developer | Magento Core Team |
Extension | facebookfreebelvg |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- app/code/community/Belvg/All/Helper/Data.php +33 -33
- app/code/community/Belvg/All/etc/config.xml +50 -50
- app/code/community/Belvg/FaceboookFree/controllers/CustomerController.php +85 -21
- app/code/community/Belvg/FaceboookFree/etc/config.xml +1 -1
- app/code/community/Belvg/Newsletterdob/Helper/Data.php +5 -0
- app/code/community/Belvg/Newsletterdob/Model/Mysql4/Setup.php +5 -0
- app/code/community/Belvg/Newsletterdob/etc/config.xml +43 -0
- app/code/community/Belvg/Newsletterdob/sql/newsletterdob_setup/mysql4-install-1.0.1.php +10 -0
- app/design/frontend/default/default/template/facebookfree/block.phtml +16 -23
- app/etc/modules/Belvg_All.xml +6 -6
- app/etc/modules/Belvg_FacebookFree.xml +1 -1
- package.xml +4 -4
app/code/community/Belvg/All/Helper/Data.php
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* BelVG LLC.
|
4 |
-
*
|
5 |
-
* NOTICE OF LICENSE
|
6 |
-
*
|
7 |
-
* This source file is subject to the EULA
|
8 |
-
* that is bundled with this package in the file LICENSE.txt.
|
9 |
-
* It is also available through the world-wide-web at this URL:
|
10 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
-
*
|
12 |
-
/***************************************
|
13 |
-
* MAGENTO EDITION USAGE NOTICE *
|
14 |
-
*****************************************/
|
15 |
-
/* This package designed for Magento COMMUNITY edition
|
16 |
-
* BelVG does not guarantee correct work of this extension
|
17 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
-
* BelVG does not provide extension support in case of
|
19 |
-
* incorrect edition usage.
|
20 |
-
/***************************************
|
21 |
-
* DISCLAIMER *
|
22 |
-
*****************************************/
|
23 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
-
* versions in the future.
|
25 |
-
*****************************************************
|
26 |
-
* @category Belvg
|
27 |
-
* @package Belvg_All
|
28 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
-
*/
|
31 |
-
|
32 |
-
class Belvg_All_Helper_Data extends Mage_Core_Helper_Abstract{
|
33 |
-
|
34 |
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* BelVG LLC.
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the EULA
|
8 |
+
* that is bundled with this package in the file LICENSE.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
11 |
+
*
|
12 |
+
/***************************************
|
13 |
+
* MAGENTO EDITION USAGE NOTICE *
|
14 |
+
*****************************************/
|
15 |
+
/* This package designed for Magento COMMUNITY edition
|
16 |
+
* BelVG does not guarantee correct work of this extension
|
17 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
18 |
+
* BelVG does not provide extension support in case of
|
19 |
+
* incorrect edition usage.
|
20 |
+
/***************************************
|
21 |
+
* DISCLAIMER *
|
22 |
+
*****************************************/
|
23 |
+
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
24 |
+
* versions in the future.
|
25 |
+
*****************************************************
|
26 |
+
* @category Belvg
|
27 |
+
* @package Belvg_All
|
28 |
+
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
29 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
30 |
+
*/
|
31 |
+
|
32 |
+
class Belvg_All_Helper_Data extends Mage_Core_Helper_Abstract{
|
33 |
+
|
34 |
}
|
app/code/community/Belvg/All/etc/config.xml
CHANGED
@@ -1,51 +1,51 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
/**
|
4 |
-
* BelVG LLC.
|
5 |
-
*
|
6 |
-
* NOTICE OF LICENSE
|
7 |
-
*
|
8 |
-
* This source file is subject to the EULA
|
9 |
-
* that is bundled with this package in the file LICENSE.txt.
|
10 |
-
* It is also available through the world-wide-web at this URL:
|
11 |
-
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
-
*
|
13 |
-
/***************************************
|
14 |
-
* MAGENTO EDITION USAGE NOTICE *
|
15 |
-
*****************************************/
|
16 |
-
/* This package designed for Magento COMMUNITY edition
|
17 |
-
* BelVG does not guarantee correct work of this extension
|
18 |
-
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
-
* BelVG does not provide extension support in case of
|
20 |
-
* incorrect edition usage.
|
21 |
-
/***************************************
|
22 |
-
* DISCLAIMER *
|
23 |
-
*****************************************/
|
24 |
-
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
-
* versions in the future.
|
26 |
-
*****************************************************
|
27 |
-
* @category Belvg
|
28 |
-
* @package Belvg_All
|
29 |
-
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
-
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
-
*/
|
32 |
-
-->
|
33 |
-
<config>
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
<helpers>
|
46 |
-
<belvgall>
|
47 |
-
<class>Belvg_All_Helper</class>
|
48 |
-
</belvgall>
|
49 |
-
</helpers>
|
50 |
-
|
51 |
</config>
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* BelVG LLC.
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the EULA
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
12 |
+
*
|
13 |
+
/***************************************
|
14 |
+
* MAGENTO EDITION USAGE NOTICE *
|
15 |
+
*****************************************/
|
16 |
+
/* This package designed for Magento COMMUNITY edition
|
17 |
+
* BelVG does not guarantee correct work of this extension
|
18 |
+
* on any other Magento edition except Magento COMMUNITY edition.
|
19 |
+
* BelVG does not provide extension support in case of
|
20 |
+
* incorrect edition usage.
|
21 |
+
/***************************************
|
22 |
+
* DISCLAIMER *
|
23 |
+
*****************************************/
|
24 |
+
/* Do not edit or add to this file if you wish to upgrade Magento to newer
|
25 |
+
* versions in the future.
|
26 |
+
*****************************************************
|
27 |
+
* @category Belvg
|
28 |
+
* @package Belvg_All
|
29 |
+
* @copyright Copyright (c) 2010 - 2011 BelVG LLC. (http://www.belvg.com)
|
30 |
+
* @license http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt
|
31 |
+
*/
|
32 |
+
-->
|
33 |
+
<config>
|
34 |
+
<modules>
|
35 |
+
<Belvg_All>
|
36 |
+
<version>1.0.0</version>
|
37 |
+
</Belvg_All>
|
38 |
+
</modules>
|
39 |
+
<global>
|
40 |
+
<blocks>
|
41 |
+
<belvgall>
|
42 |
+
<class>Belvg_All_Block</class>
|
43 |
+
</belvgall>
|
44 |
+
</blocks>
|
45 |
+
<helpers>
|
46 |
+
<belvgall>
|
47 |
+
<class>Belvg_All_Helper</class>
|
48 |
+
</belvgall>
|
49 |
+
</helpers>
|
50 |
+
</global>
|
51 |
</config>
|
app/code/community/Belvg/FaceboookFree/controllers/CustomerController.php
CHANGED
@@ -32,27 +32,18 @@
|
|
32 |
|
33 |
class Belvg_FaceboookFree_CustomerController extends Mage_Core_Controller_Front_Action {
|
34 |
|
35 |
-
public function LoginAction()
|
36 |
-
|
37 |
-
$facebook = new Facebook_Api(array(
|
38 |
-
'appId' => Mage::getStoreConfig('facebookfree/settings/appid'),
|
39 |
-
'secret' => Mage::getStoreConfig('facebookfree/settings/secret'),
|
40 |
-
'cookie' => true,
|
41 |
-
));
|
42 |
-
$fb_session = $facebook->getSession();
|
43 |
|
44 |
$me = null;
|
45 |
-
// Session based API call.
|
46 |
-
if ($fb_session) {
|
47 |
-
try {
|
48 |
-
$uid = $facebook->getUser();
|
49 |
-
$me = $facebook->api('/me');
|
50 |
-
} catch (Facebook_Exception $e) {
|
51 |
-
error_log($e);
|
52 |
-
}
|
53 |
-
}
|
54 |
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
$session = Mage::getSingleton('customer/session');
|
57 |
|
58 |
$db_read = Mage::getSingleton('core/resource')->getConnection('facebookfree_read');
|
@@ -86,7 +77,8 @@ class Belvg_FaceboookFree_CustomerController extends Mage_Core_Controller_Front_
|
|
86 |
}
|
87 |
}
|
88 |
|
89 |
-
public function LogoutAction()
|
|
|
90 |
$session = Mage::getSingleton('customer/session');
|
91 |
$session->logout()
|
92 |
->setBeforeAuthUrl(Mage::getUrl());
|
@@ -94,7 +86,8 @@ class Belvg_FaceboookFree_CustomerController extends Mage_Core_Controller_Front_
|
|
94 |
$this->_redirect('customer/account/logoutSuccess');
|
95 |
}
|
96 |
|
97 |
-
private function _registerCustomer($data, &$session)
|
|
|
98 |
$customer = Mage::getModel('customer/customer')->setId(null);
|
99 |
$customer->setData('firstname', $data['first_name']);
|
100 |
$customer->setData('lastname', $data['last_name']);
|
@@ -117,7 +110,8 @@ class Belvg_FaceboookFree_CustomerController extends Mage_Core_Controller_Front_
|
|
117 |
$db_write->query($sql);
|
118 |
}
|
119 |
|
120 |
-
private function _loginPostRedirect(&$session)
|
|
|
121 |
|
122 |
if ($referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME)) {
|
123 |
$referer = Mage::helper('core')->urlDecode($referer);
|
@@ -133,4 +127,74 @@ class Belvg_FaceboookFree_CustomerController extends Mage_Core_Controller_Front_
|
|
133 |
$this->_redirectUrl($session->getBeforeAuthUrl(true));
|
134 |
}
|
135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
}
|
32 |
|
33 |
class Belvg_FaceboookFree_CustomerController extends Mage_Core_Controller_Front_Action {
|
34 |
|
35 |
+
public function LoginAction()
|
36 |
+
{
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
$me = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
+
$cookie = $this->get_facebook_cookie(Mage::getStoreConfig('facebookfree/settings/appid'), Mage::getStoreConfig('facebookfree/settings/secret'));
|
41 |
+
|
42 |
+
$me = (array) json_decode(file_get_contents(
|
43 |
+
'https://graph.facebook.com/me?access_token=' .
|
44 |
+
$cookie['access_token']));
|
45 |
+
|
46 |
+
if (!is_null($me)) {
|
47 |
$session = Mage::getSingleton('customer/session');
|
48 |
|
49 |
$db_read = Mage::getSingleton('core/resource')->getConnection('facebookfree_read');
|
77 |
}
|
78 |
}
|
79 |
|
80 |
+
public function LogoutAction()
|
81 |
+
{
|
82 |
$session = Mage::getSingleton('customer/session');
|
83 |
$session->logout()
|
84 |
->setBeforeAuthUrl(Mage::getUrl());
|
86 |
$this->_redirect('customer/account/logoutSuccess');
|
87 |
}
|
88 |
|
89 |
+
private function _registerCustomer($data, &$session)
|
90 |
+
{
|
91 |
$customer = Mage::getModel('customer/customer')->setId(null);
|
92 |
$customer->setData('firstname', $data['first_name']);
|
93 |
$customer->setData('lastname', $data['last_name']);
|
110 |
$db_write->query($sql);
|
111 |
}
|
112 |
|
113 |
+
private function _loginPostRedirect(&$session)
|
114 |
+
{
|
115 |
|
116 |
if ($referer = $this->getRequest()->getParam(Mage_Customer_Helper_Data::REFERER_QUERY_PARAM_NAME)) {
|
117 |
$referer = Mage::helper('core')->urlDecode($referer);
|
127 |
$this->_redirectUrl($session->getBeforeAuthUrl(true));
|
128 |
}
|
129 |
|
130 |
+
private function get_facebook_cookie($app_id, $app_secret)
|
131 |
+
{
|
132 |
+
if ($_COOKIE['fbsr_' . $app_id] != '') {
|
133 |
+
return $this->get_new_facebook_cookie($app_id, $app_secret);
|
134 |
+
} else {
|
135 |
+
return $this->get_old_facebook_cookie($app_id, $app_secret);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
private function get_old_facebook_cookie($app_id, $app_secret)
|
140 |
+
{
|
141 |
+
$args = array();
|
142 |
+
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
|
143 |
+
ksort($args);
|
144 |
+
$payload = '';
|
145 |
+
foreach ($args as $key => $value) {
|
146 |
+
if ($key != 'sig') {
|
147 |
+
$payload .= $key . '=' . $value;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
if (md5($payload . $app_secret) != $args['sig']) {
|
151 |
+
return array();
|
152 |
+
}
|
153 |
+
return $args;
|
154 |
+
}
|
155 |
+
|
156 |
+
private function get_new_facebook_cookie($app_id, $app_secret)
|
157 |
+
{
|
158 |
+
$signed_request = $this->parse_signed_request($_COOKIE['fbsr_' . $app_id], $app_secret);
|
159 |
+
// $signed_request should now have most of the old elements
|
160 |
+
$signed_request[uid] = $signed_request[user_id]; // for compatibility
|
161 |
+
if (!is_null($signed_request)) {
|
162 |
+
// the cookie is valid/signed correctly
|
163 |
+
// lets change "code" into an "access_token"
|
164 |
+
$access_token_response = file_get_contents("https://graph.facebook.com/oauth/access_token?client_id=$app_id&redirect_uri=&client_secret=$app_secret&code=$signed_request[code]");
|
165 |
+
parse_str($access_token_response);
|
166 |
+
$signed_request[access_token] = $access_token;
|
167 |
+
$signed_request[expires] = time() + $expires;
|
168 |
+
}
|
169 |
+
return $signed_request;
|
170 |
+
}
|
171 |
+
|
172 |
+
private function parse_signed_request($signed_request, $secret)
|
173 |
+
{
|
174 |
+
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
|
175 |
+
|
176 |
+
// decode the data
|
177 |
+
$sig = $this->base64_url_decode($encoded_sig);
|
178 |
+
$data = json_decode($this->base64_url_decode($payload), true);
|
179 |
+
|
180 |
+
if (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {
|
181 |
+
error_log('Unknown algorithm. Expected HMAC-SHA256');
|
182 |
+
return null;
|
183 |
+
}
|
184 |
+
|
185 |
+
// check sig
|
186 |
+
$expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);
|
187 |
+
if ($sig !== $expected_sig) {
|
188 |
+
error_log('Bad Signed JSON signature!');
|
189 |
+
return null;
|
190 |
+
}
|
191 |
+
|
192 |
+
return $data;
|
193 |
+
}
|
194 |
+
|
195 |
+
private function base64_url_decode($input)
|
196 |
+
{
|
197 |
+
return base64_decode(strtr($input, '-_', '+/'));
|
198 |
+
}
|
199 |
+
|
200 |
}
|
app/code/community/Belvg/FaceboookFree/etc/config.xml
CHANGED
@@ -33,7 +33,7 @@
|
|
33 |
<config>
|
34 |
<modules>
|
35 |
<Belvg_FaceboookFree>
|
36 |
-
<version>1.0.
|
37 |
</Belvg_FaceboookFree>
|
38 |
</modules>
|
39 |
<frontend>
|
33 |
<config>
|
34 |
<modules>
|
35 |
<Belvg_FaceboookFree>
|
36 |
+
<version>1.0.3</version>
|
37 |
</Belvg_FaceboookFree>
|
38 |
</modules>
|
39 |
<frontend>
|
app/code/community/Belvg/Newsletterdob/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_Newsletterdob_Helper_Data extends Mage_Core_Helper_Abstract {
|
4 |
+
|
5 |
+
}
|
app/code/community/Belvg/Newsletterdob/Model/Mysql4/Setup.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Belvg_Newsletterdob_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup
|
4 |
+
{
|
5 |
+
}
|
app/code/community/Belvg/Newsletterdob/etc/config.xml
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Belvg_Newsletterdob>
|
5 |
+
<version>1.0.1</version>
|
6 |
+
</Belvg_Newsletterdob>
|
7 |
+
</modules>
|
8 |
+
<global>
|
9 |
+
<models>
|
10 |
+
<newsletterdob>
|
11 |
+
<class>Belvg_Newsletterdob_Model</class>
|
12 |
+
</newsletterdob>
|
13 |
+
<newsletterdob_mysql4>
|
14 |
+
<class>Belvg_Newsletterdob_Model_Mysql4</class>
|
15 |
+
</newsletterdob_mysql4>
|
16 |
+
</models>
|
17 |
+
<resources>
|
18 |
+
<newsletterdob_setup>
|
19 |
+
<setup>
|
20 |
+
<module>Belvg_Newsletterdob</module>
|
21 |
+
</setup>
|
22 |
+
<connection>
|
23 |
+
<use>core_setup</use>
|
24 |
+
</connection>
|
25 |
+
</newsletterdob_setup>
|
26 |
+
<newsletterdob_write>
|
27 |
+
<connection>
|
28 |
+
<use>core_write</use>
|
29 |
+
</connection>
|
30 |
+
</newsletterdob_write>
|
31 |
+
<newsletterdob_read>
|
32 |
+
<connection>
|
33 |
+
<use>core_read</use>
|
34 |
+
</connection>
|
35 |
+
</newsletterdob_read>
|
36 |
+
</resources>
|
37 |
+
<helpers>
|
38 |
+
<newsletterdob>
|
39 |
+
<class>Belvg_Newsletterdob_Helper</class>
|
40 |
+
</newsletterdob>
|
41 |
+
</helpers>
|
42 |
+
</global>
|
43 |
+
</config>
|
app/code/community/Belvg/Newsletterdob/sql/newsletterdob_setup/mysql4-install-1.0.1.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
$installer = $this;
|
4 |
+
|
5 |
+
$installer->startSetup();
|
6 |
+
|
7 |
+
$installer->run("
|
8 |
+
ALTER TABLE `{$this->getTable('newsletter_subscriber')}` ADD `subscriber_dob` DATE NULL DEFAULT NULL;
|
9 |
+
");
|
10 |
+
$installer->endSetup();
|
app/design/frontend/default/default/template/facebookfree/block.phtml
CHANGED
@@ -32,33 +32,29 @@
|
|
32 |
<script language="JavaScript" type="text/javascript">
|
33 |
/*<![CDATA[*/
|
34 |
window.fbAsyncInit = function() {
|
35 |
-
FB.init({appId: '<?php echo $this->getAppId()?>',
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
39 |
FB.Event.subscribe('auth.logout', function(response) {
|
40 |
logout();
|
41 |
});
|
42 |
FB.getLoginStatus(function(response) {
|
43 |
-
if (response.
|
44 |
<?php if (Mage::getSingleton('customer/session')->isLoggedIn() && $uid = $this->checkFbUser()):?>
|
45 |
greet('<?php echo $uid?>');
|
46 |
<?php endif?>
|
47 |
}
|
48 |
-
<?php if (Mage::getSingleton('customer/session')->isLoggedIn()):?>
|
49 |
-
else {
|
50 |
-
$$('.quick-access a.fb_button')[0].remove();
|
51 |
-
}
|
52 |
-
<?php endif?>
|
53 |
});
|
54 |
};
|
55 |
-
(function()
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
}());
|
62 |
|
63 |
function login(){
|
64 |
document.location.href="<?php echo $this->getUrl('facebookfree/customer/login')?>?referer=<?php echo Mage::helper('core')->urlEncode($this->helper('core/url')->getCurrentUrl())?>";
|
@@ -71,21 +67,18 @@ function login(){
|
|
71 |
var src = 'https://graph.facebook.com/'+id+'/picture';
|
72 |
$$('.welcome-msg')[0].insert('<img height="20" src="'+src+'"/>');
|
73 |
});
|
74 |
-
<?php /*if (Mage::getSingleton('customer/session')->isLoggedIn()):?>
|
75 |
-
var lis = $$('.quick-access li');
|
76 |
-
lis[lis.length-1].remove();
|
77 |
-
<?php endif */?>
|
78 |
}
|
79 |
|
80 |
function fblogin(){
|
81 |
FB.login(function(response) {
|
82 |
-
|
|
|
83 |
login();
|
84 |
} else {
|
85 |
// user is not logged in
|
86 |
window.location.reload();
|
87 |
}
|
88 |
-
}, {
|
89 |
return false;
|
90 |
}
|
91 |
/*]]>*/
|
32 |
<script language="JavaScript" type="text/javascript">
|
33 |
/*<![CDATA[*/
|
34 |
window.fbAsyncInit = function() {
|
35 |
+
FB.init({appId: '<?php echo $this->getAppId()?>',
|
36 |
+
status : true,
|
37 |
+
cookie : true,
|
38 |
+
xfbml : true,
|
39 |
+
oauth : true});
|
40 |
+
|
41 |
FB.Event.subscribe('auth.logout', function(response) {
|
42 |
logout();
|
43 |
});
|
44 |
FB.getLoginStatus(function(response) {
|
45 |
+
if (response.status == 'connected') {
|
46 |
<?php if (Mage::getSingleton('customer/session')->isLoggedIn() && $uid = $this->checkFbUser()):?>
|
47 |
greet('<?php echo $uid?>');
|
48 |
<?php endif?>
|
49 |
}
|
|
|
|
|
|
|
|
|
|
|
50 |
});
|
51 |
};
|
52 |
+
(function(d){
|
53 |
+
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
|
54 |
+
js = d.createElement('script'); js.id = id; js.async = true;
|
55 |
+
js.src = "//connect.facebook.net/en_US/all.js";
|
56 |
+
d.getElementsByTagName('head')[0].appendChild(js);
|
57 |
+
}(document));
|
|
|
58 |
|
59 |
function login(){
|
60 |
document.location.href="<?php echo $this->getUrl('facebookfree/customer/login')?>?referer=<?php echo Mage::helper('core')->urlEncode($this->helper('core/url')->getCurrentUrl())?>";
|
67 |
var src = 'https://graph.facebook.com/'+id+'/picture';
|
68 |
$$('.welcome-msg')[0].insert('<img height="20" src="'+src+'"/>');
|
69 |
});
|
|
|
|
|
|
|
|
|
70 |
}
|
71 |
|
72 |
function fblogin(){
|
73 |
FB.login(function(response) {
|
74 |
+
|
75 |
+
if (response.status == 'connected') {
|
76 |
login();
|
77 |
} else {
|
78 |
// user is not logged in
|
79 |
window.location.reload();
|
80 |
}
|
81 |
+
}, {scope:'email,publish_stream'});
|
82 |
return false;
|
83 |
}
|
84 |
/*]]>*/
|
app/etc/modules/Belvg_All.xml
CHANGED
@@ -31,11 +31,11 @@
|
|
31 |
*/
|
32 |
-->
|
33 |
<config>
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
</Belvg_All>
|
40 |
-
|
41 |
</config>
|
31 |
*/
|
32 |
-->
|
33 |
<config>
|
34 |
+
<modules>
|
35 |
+
<Belvg_All>
|
36 |
+
<active>true</active>
|
37 |
+
<codePool>community</codePool>
|
38 |
+
<version>1.0</version>
|
39 |
</Belvg_All>
|
40 |
+
</modules>
|
41 |
</config>
|
app/etc/modules/Belvg_FacebookFree.xml
CHANGED
@@ -35,7 +35,7 @@
|
|
35 |
<Belvg_FaceboookFree>
|
36 |
<active>true</active>
|
37 |
<codePool>community</codePool>
|
38 |
-
<version>1.0.
|
39 |
</Belvg_FaceboookFree>
|
40 |
</modules>
|
41 |
</config>
|
35 |
<Belvg_FaceboookFree>
|
36 |
<active>true</active>
|
37 |
<codePool>community</codePool>
|
38 |
+
<version>1.0.3</version>
|
39 |
</Belvg_FaceboookFree>
|
40 |
</modules>
|
41 |
</config>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>facebookfreebelvg</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt">BelVG EULA</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Facebook connect and publish extension allows to login into store using Facebook credentials. Allows to add configurable iLike button to the product page.</description>
|
11 |
<notes>Please, feel free to contact us at store@belvg.com</notes>
|
12 |
<authors><author><name>Belvg</name><user>auto-converted</user><email>store@belvg.com</email></author></authors>
|
13 |
-
<date>2011-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Belvg"><dir name="All"><dir name="Helper"><file name="Data.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>facebookfreebelvg</name>
|
4 |
+
<version>1.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://store.belvg.com/BelVG-LICENSE-COMMUNITY.txt">BelVG EULA</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Facebook connect and publish extension allows to login into store using Facebook credentials. Allows to add configurable iLike button to the product page.</description>
|
11 |
<notes>Please, feel free to contact us at store@belvg.com</notes>
|
12 |
<authors><author><name>Belvg</name><user>auto-converted</user><email>store@belvg.com</email></author></authors>
|
13 |
+
<date>2011-12-14</date>
|
14 |
+
<time>13:35:08</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Belvg"><dir name="All"><dir name="Helper"><file name="Data.php" hash="c508c83bfba72a300592b1b373f41758"/></dir><dir name="etc"><file name="config.xml" hash="8353012d959534a6afd3d75bfc5d9b83"/><file name="system.xml" hash="20d31eefd3bc699d1db1f78cd2b8f4d2"/></dir></dir><dir name="FaceboookFree"><dir name="Block"><file name="Active.php" hash="813d46911f6500338c30fa5c179e12d3"/><file name="Links.php" hash="a850aed6d41f7e377b1603b5791805e7"/></dir><dir name="Helper"><file name="Active.php" hash="c973b678b89d21748fed2f880e36cf55"/><file name="Data.php" hash="1825805274bce0784ec27ce9bcd1f525"/></dir><dir name="Model"><dir name="Mysql4"><file name="Setup.php" hash="5d7ef9e98a18c04c0d8d1457c96492aa"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Color.php" hash="bd27002596a4bc6018a52618a60b4fcc"/><file name="Layout.php" hash="d8b4cd4c2bb3ae2d40b0a43e84b2812f"/></dir></dir></dir><file name="FaceboookFree.php" hash="6ae1b5b8f461794a42960af5694a0540"/></dir><dir name="controllers"><file name="CustomerController.php" hash="c000f4489f4e4a8829b81a8966d13e7c"/></dir><dir name="etc"><file name="adminhtml.xml" hash="918c2b409a939f35b4e28ce8d1a8d2e9"/><file name="config.xml" hash="e5eb336d2edba98f3ef52a1985473473"/><file name="system.xml" hash="c493ed694d2f9b87f5ecbf5bfcbc628f"/></dir><dir name="sql"><dir name="facebookfree_setup"><file name="mysql4-install-1.0.1.php" hash="4fb61d52de12359987c0f4975093d4b2"/></dir></dir></dir><dir name="Newsletterdob"><dir name="Helper"><file name="Data.php" hash="b714a9786a36eb872a3998cf5589ea73"/></dir><dir name="Model"><dir name="Mysql4"><file name="Setup.php" hash="3f7418aef91928410b3378194ad32378"/></dir></dir><dir name="etc"><file name="config.xml" hash="b865ab1b54be4ee4958970f3c20af111"/></dir><dir name="sql"><dir name="newsletterdob_setup"><file name="mysql4-install-1.0.1.php" hash="5ffbfa5ea1ea16f4bd5ac4da56f319b2"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="facebookfree.xml" hash="a4f91867847b391dd2c833907863b0bb"/></dir><dir name="template"><dir name="facebookfree"><dir name="like"><dir name="product"><dir name="view"><file name="addto.phtml" hash="2587002138a3be0944e98079309e8524"/></dir></dir><file name="head.phtml" hash="b618691ffc33a0e71ecf82c8137829e4"/></dir><file name="block.phtml" hash="044dde73ae6b4987fbb262f95c0df2a7"/><file name="checkoutlogin.phtml" hash="3f2fbfe2b973338bd595b1664f67d0b4"/><file name="login.phtml" hash="d229b7c2f3e704e1b51616f235024d0c"/><file name="top.links.phtml" hash="4b2e33ac3ab51f53c0616c09da1150ee"/></dir></dir></dir></dir></dir></target><target name="magelib"><dir name="Facebook"><file name="Api.php" hash="daf56a2b2c80b069f92ce7e4bee1782f"/><file name="Exception.php" hash="6992e5cc68e456c0841a002cbd92a12b"/><file name="fb_ca_chain_bundle.crt" hash="c3055d03e94bbee13c7c6cc3a76083d9"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="belvg"><file name="facebookfree.css" hash="c211abe25deeef7c6c31059efa58d701"/></dir></dir><dir name="images"><dir name="belvg"><file name="fb.gif" hash="865312ef4436675a9c79bacb7c97407f"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Belvg_All.xml" hash="d322d1671821c290a5fa099381431b2d"/><file name="Belvg_FacebookFree.xml" hash="66d0b8516103f3d29d31d38bd28c4c96"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|