Janrain_Engage_Plugin - Version 1.0.3

Version Notes

- Fixed layout xml filename
- Hide login links for authenticated users
- Updated exception handling

Download this release

Release Info

Developer Magento Core Team
Extension Janrain_Engage_Plugin
Version 1.0.3
Comparing to
See all releases


Code changes from version 1.0.2 to 1.0.3

app/code/local/Janrain/Engage/Block/Auth.php CHANGED
@@ -27,7 +27,10 @@ class Janrain_Engage_Block_Auth extends Mage_Core_Block_Template implements Mage
27
}
28
29
protected function _toHtml() {
30
- return $this->rpx_small_buttons();
31
}
32
33
protected function _prepareLayout() {
27
}
28
29
protected function _toHtml() {
30
+ $content = '';
31
+ if (Mage::getSingleton('customer/session')->isLoggedIn() == false)
32
+ $content = $this->rpx_small_buttons();
33
+ return $content;
34
}
35
36
protected function _prepareLayout() {
app/code/local/Janrain/Engage/Helper/Rpxcall.php CHANGED
@@ -7,7 +7,8 @@ class Janrain_Engage_Helper_Rpxcall extends Mage_Core_Helper_Abstract {
7
}
8
9
public function rpxLookupSave() {
10
- if($lookup_rp = $this->rpxLookupRpCall()){
11
if($lookup_rp->realm)
12
$uiConfig = $this->rpxUiConfigCall($lookup_rp->realm, $lookup_rp->realmScheme);
13
@@ -22,8 +23,11 @@ class Janrain_Engage_Helper_Rpxcall extends Mage_Core_Helper_Abstract {
22
Mage::getConfig()->reinit();
23
24
return true;
25
- }
26
27
return false;
28
}
29
7
}
8
9
public function rpxLookupSave() {
10
+ try {
11
+ $lookup_rp = $this->rpxLookupRpCall();
12
if($lookup_rp->realm)
13
$uiConfig = $this->rpxUiConfigCall($lookup_rp->realm, $lookup_rp->realmScheme);
14
23
Mage::getConfig()->reinit();
24
25
return true;
26
27
+ } catch (Exception $e) {
28
+ Mage::getSingleton('adminhtml/session')->addWarning('Could not retrieve account info. Please try again');
29
+ }
30
+
31
return false;
32
}
33
app/code/local/Janrain/Engage/controllers/RpxController.php CHANGED
@@ -97,36 +97,42 @@ class Janrain_Engage_RpxController extends Mage_Customer_AccountController {
97
$key = $this->getRequest()->getParam('ses');
98
$token = Mage::getSingleton('engage/session')->getData($key);
99
$auth_info = Mage::helper('engage/rpxcall')->rpxAuthInfoCall($token);
100
-
101
- $customer = Mage::helper('engage/identifiers')->get_customer($auth_info->profile->identifier);
102
-
103
- if ($customer===false) {
104
- $this->loadLayout();
105
- $block = Mage::getSingleton('core/layout')->getBlock('customer_form_register');
106
- $form_data = $block->getFormData();
107
-
108
- if(isset($auth_info->profile) && isset($auth_info->profile->verifiedEmail))
109
- $email = $auth_info->profile->verifiedEmail;
110
- else if(isset($auth_info->profile) && isset($auth_info->profile->email))
111
- $email = $auth_info->profile->email;
112
- else
113
- $email = '';
114
-
115
- $firstName = Mage::helper('engage/rpxcall')->getFirstName($auth_info);
116
- $lastName = Mage::helper('engage/rpxcall')->getLastName($auth_info);
117
-
118
- $form_data->setEmail($email);
119
- $form_data->setFirstname($firstName);
120
- $form_data->setLastname($lastName);
121
- $profile = Mage::helper('engage')->buildProfile($auth_info);
122
- Mage::getSingleton('engage/session')->setIdentifier($profile);
123
-
124
- $this->renderLayout();
125
- return;
126
} else {
127
- Mage::getSingleton('engage/session')->setLoginRequest(true);
128
- $session->login($customer->getEmail(), 'REQUIRED_SECOND_PARAM');
129
- $this->_loginPostRedirect();
130
}
131
}
132
97
$key = $this->getRequest()->getParam('ses');
98
$token = Mage::getSingleton('engage/session')->getData($key);
99
$auth_info = Mage::helper('engage/rpxcall')->rpxAuthInfoCall($token);
100
+ if(isset($auth_info['stat']) && $auth_info['stat']=='ok') {
101
+ $customer = Mage::helper('engage/identifiers')->get_customer($auth_info->profile->identifier);
102
+
103
+ if ($customer === false) {
104
+ $this->loadLayout();
105
+ $block = Mage::getSingleton('core/layout')->getBlock('customer_form_register');
106
+ if($block !== false) {
107
+ $form_data = $block->getFormData();
108
+
109
+ if(isset($auth_info->profile) && isset($auth_info->profile->verifiedEmail))
110
+ $email = $auth_info->profile->verifiedEmail;
111
+ else if(isset($auth_info->profile) && isset($auth_info->profile->email))
112
+ $email = $auth_info->profile->email;
113
+ else
114
+ $email = '';
115
+
116
+ $firstName = Mage::helper('engage/rpxcall')->getFirstName($auth_info);
117
+ $lastName = Mage::helper('engage/rpxcall')->getLastName($auth_info);
118
+
119
+ $form_data->setEmail($email);
120
+ $form_data->setFirstname($firstName);
121
+ $form_data->setLastname($lastName);
122
+ }
123
+ $profile = Mage::helper('engage')->buildProfile($auth_info);
124
+ Mage::getSingleton('engage/session')->setIdentifier($profile);
125
+
126
+ $this->renderLayout();
127
+ return;
128
+ } else {
129
+ Mage::getSingleton('engage/session')->setLoginRequest(true);
130
+ $session->login($customer->getEmail(), 'REQUIRED_SECOND_PARAM');
131
+ $this->_loginPostRedirect();
132
+ }
133
} else {
134
+ $session->addWarning('Could not retrieve account info. Please try again.');
135
+ $this->_redirect('customer/account/login');
136
}
137
}
138
app/code/local/Janrain/Engage/etc/config.xml CHANGED
@@ -3,14 +3,14 @@
3
<config>
4
<modules>
5
<Janrain_Engage>
6
- <version>1.0.2</version>
7
</Janrain_Engage>
8
</modules>
9
<frontend>
10
<layout>
11
<updates>
12
<engage>
13
- <file>janrain_engage.xml</file>
14
</engage>
15
</updates>
16
</layout>
3
<config>
4
<modules>
5
<Janrain_Engage>
6
+ <version>1.0.3</version>
7
</Janrain_Engage>
8
</modules>
9
<frontend>
10
<layout>
11
<updates>
12
<engage>
13
+ <file>Janrain_Engage.xml</file>
14
</engage>
15
</updates>
16
</layout>
app/code/local/Janrain/Engage/sql/engage_setup/{mysql4-install-1.0.2.php → mysql4-install-1.0.3.php} RENAMED
File without changes
package.xml CHANGED
@@ -1,7 +1,7 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>Janrain_Engage_Plugin</name>
4
- <version>1.0.2</version>
5
<stability>stable</stability>
6
<license>Apache Software Licence</license>
7
<channel>community</channel>
@@ -10,11 +10,13 @@
10
<description>Connects your website to the social networks and makes it easy for your users to login with an existing identity profile from social networks or identity providers like Facebook, Twitter, Google and Yahoo, to speed up online registration. Enable users to share their activities (comments, purchases, reviews) from your site with friends on the social networks to drive qualified referral traffic back to your site, and let users invite their friends to join your site.&#xD;
11
&#xD;
12
Sign up for an account at &lt;a href="http://www.janrain.com/products/engage/get-janrain-engage" target="_blank"&gt;janrain.com&lt;/a&gt;.</description>
13
- <notes>Working Version</notes>
14
- <authors><author><name>Bryce Hamrick</name><user>bhamrick</user><email>bryce@janrain.com</email></author><author><name>Janrain</name><user>Janrain</user><email>magento@janrain.com</email></author></authors>
15
- <date>2011-03-11</date>
16
- <time>17:23:34</time>
17
- <contents><target name="magelocal"><dir name="Janrain"><dir name="Engage"><dir name="Block"><file name="Accountdata.php" hash="d191d3400498180f5abb18958a1d24c8"/><file name="Auth.php" hash="bc9178901a810ea19b5ae26e512f83e1"/><file name="Info.php" hash="5d82cecfab65e1446f0a1be4f7639afc"/><file name="Share.php" hash="3e5d791a5ad59c432ae81a01f7a5a3e2"/></dir><dir name="Helper"><file name="Data.php" hash="a459ce7b6d89626aa6733b3332cdcaef"/><file name="Identifiers.php" hash="0ce70399da045b1737d0447d63b2bb95"/><file name="Rpxcall.php" hash="3eb64139db932dd9a8de7dcb32c70e83"/></dir><dir name="Model"><file name="Customer.php" hash="6bdfec355f0396dba19df2330f7beefe"/><file name="Identifiers.php" hash="474ac9fd4d386eec1ada05a19947af4e"/><dir name="Mysql4"><dir name="Identifiers"><file name="Collection.php" hash="e4b5714402da64d4127d155f713dd102"/></dir><file name="Identifiers.php" hash="7417902ae79030317ba9f4c89b94d56d"/></dir><file name="Observer.php" hash="6f2d4de4cf9cd62f9861a332332d380f"/><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="63dbeb555b0328e5de9a414023b3c67e"/></dir></dir></dir><file name="Session.php" hash="2d22a0c1cef86704021f8c4e20b0960d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LookupController.php" hash="32e87c5f0415be82d4a0b54b29fd1c40"/></dir><file name="IndexController.php" hash="7de3e6f4a97f684c53f544bf5dc4bf3a"/><file name="RpxController.php" hash="01bacbf6002de04815fcf2a1e4456d34"/></dir><dir name="etc"><file name="config.xml" hash="0f31245b6de17155839d099be4bbe29b"/><file name="system.xml" hash="b8ef2e5b474c41ad3e22bdf643099ccc"/><file name="widget.xml" hash="a1ab9af781bd0008fda8cedba4f60df6"/></dir><dir name="sql"><dir name="engage_setup"><file name="mysql4-install-1.0.2.php" hash="2ce66b0568ed83142c04c2ff03f0db0c"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="janrain"><file name="providers_icons16.png" hash="3c27e54384c7b8016962f4b1a52f60a3"/><file name="providers_icons32.png" hash="f2623ed6cdc02d182761633ce56c8d62"/><file name="rpx_xdcomm.html" hash="9b9130d8aafb8a4be6b36b18c3db1035"/><file name="stylesheet.css" hash="89da18e7191c53b8c55146971f7fb6ea"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Janrain_Engage.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageetc"><dir name="modules"><file name="Janrain_Engage.xml" hash="fc970ee3b01aa20d142665fecd3a97fb"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="Janrain_Engage.xml" hash="98d1fe3fd7b441629ba8366d86e5978d"/></dir><dir name="template"><dir name="janrain"><dir name="engage"><file name="dashboard.phtml" hash="28ce7b8e4f1b56eb675257e3bc606472"/><file name="duplicate.phtml" hash="bba081ce0c222119e0e9211076b17693"/><file name="register.phtml" hash="308fee19c99b61ff77e2de2eae63f3f2"/><file name="scripts.phtml" hash="581ca7202aa33bf1ff7f45aaa1dde2ad"/><file name="styles.phtml" hash="3b21a9fae92d4a374ce7d9fcaba93b8f"/></dir></dir></dir></dir></dir></dir></target></contents>
18
<compatible/>
19
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>Janrain_Engage_Plugin</name>
4
+ <version>1.0.3</version>
5
<stability>stable</stability>
6
<license>Apache Software Licence</license>
7
<channel>community</channel>
10
<description>Connects your website to the social networks and makes it easy for your users to login with an existing identity profile from social networks or identity providers like Facebook, Twitter, Google and Yahoo, to speed up online registration. Enable users to share their activities (comments, purchases, reviews) from your site with friends on the social networks to drive qualified referral traffic back to your site, and let users invite their friends to join your site.&#xD;
11
&#xD;
12
Sign up for an account at &lt;a href="http://www.janrain.com/products/engage/get-janrain-engage" target="_blank"&gt;janrain.com&lt;/a&gt;.</description>
13
+ <notes>- Fixed layout xml filename&#xD;
14
+ - Hide login links for authenticated users&#xD;
15
+ - Updated exception handling</notes>
16
+ <authors><author><name>Bryce Hamrick</name><user>auto-converted</user><email>bryce@janrain.com</email></author></authors>
17
+ <date>2011-03-14</date>
18
+ <time>19:25:23</time>
19
+ <contents><target name="magelocal"><dir name="Janrain"><dir name="Engage"><dir name="Block"><file name="Accountdata.php" hash="d191d3400498180f5abb18958a1d24c8"/><file name="Auth.php" hash="b60e990ffd60b42f8ab061f41b06984b"/><file name="Info.php" hash="5d82cecfab65e1446f0a1be4f7639afc"/><file name="Share.php" hash="3e5d791a5ad59c432ae81a01f7a5a3e2"/></dir><dir name="Helper"><file name="Data.php" hash="a459ce7b6d89626aa6733b3332cdcaef"/><file name="Identifiers.php" hash="0ce70399da045b1737d0447d63b2bb95"/><file name="Rpxcall.php" hash="3b95efc3c2b4d18d59cc55651960bf12"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Identifiers"><file name="Collection.php" hash="e4b5714402da64d4127d155f713dd102"/></dir><file name="Identifiers.php" hash="7417902ae79030317ba9f4c89b94d56d"/></dir><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Setup.php" hash="63dbeb555b0328e5de9a414023b3c67e"/></dir></dir></dir><file name="Customer.php" hash="6bdfec355f0396dba19df2330f7beefe"/><file name="Identifiers.php" hash="474ac9fd4d386eec1ada05a19947af4e"/><file name="Observer.php" hash="6f2d4de4cf9cd62f9861a332332d380f"/><file name="Session.php" hash="2d22a0c1cef86704021f8c4e20b0960d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LookupController.php" hash="32e87c5f0415be82d4a0b54b29fd1c40"/></dir><file name="IndexController.php" hash="7de3e6f4a97f684c53f544bf5dc4bf3a"/><file name="RpxController.php" hash="bcecb0596db700ffd345c49fbd1e79eb"/></dir><dir name="etc"><file name="config.xml" hash="f698124bf338653b00014527bdfd0bbb"/><file name="system.xml" hash="b8ef2e5b474c41ad3e22bdf643099ccc"/><file name="widget.xml" hash="a1ab9af781bd0008fda8cedba4f60df6"/></dir><dir name="sql"><dir name="engage_setup"><file name="mysql4-install-1.0.3.php" hash="2ce66b0568ed83142c04c2ff03f0db0c"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="janrain"><file name="providers_icons16.png" hash="3c27e54384c7b8016962f4b1a52f60a3"/><file name="providers_icons32.png" hash="f2623ed6cdc02d182761633ce56c8d62"/><file name="rpx_xdcomm.html" hash="9b9130d8aafb8a4be6b36b18c3db1035"/><file name="stylesheet.css" hash="89da18e7191c53b8c55146971f7fb6ea"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Janrain_Engage.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></target><target name="mageetc"><dir name="modules"><file name="Janrain_Engage.xml" hash="fc970ee3b01aa20d142665fecd3a97fb"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="Janrain_Engage.xml" hash="98d1fe3fd7b441629ba8366d86e5978d"/></dir><dir name="template"><dir name="janrain"><dir name="engage"><file name="dashboard.phtml" hash="28ce7b8e4f1b56eb675257e3bc606472"/><file name="duplicate.phtml" hash="bba081ce0c222119e0e9211076b17693"/><file name="register.phtml" hash="308fee19c99b61ff77e2de2eae63f3f2"/><file name="scripts.phtml" hash="581ca7202aa33bf1ff7f45aaa1dde2ad"/><file name="styles.phtml" hash="3b21a9fae92d4a374ce7d9fcaba93b8f"/></dir></dir></dir></dir></dir></dir></target></contents>
20
<compatible/>
21
+ <dependencies/>
22
</package>