diff options
author | Sem <sembrestels@riseup.net> | 2012-09-24 18:16:43 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-09-24 18:16:43 +0200 |
commit | 0b21941bed977701ab2d7be6a91711901ac02992 (patch) | |
tree | 7b1c51f427c63f4dcc13c55da91a5061a2252777 | |
parent | e826cb586ba363babddad98164bf4c8999aec300 (diff) | |
download | elgg-0b21941bed977701ab2d7be6a91711901ac02992.tar.gz elgg-0b21941bed977701ab2d7be6a91711901ac02992.tar.bz2 |
Added "remember me" support for OpenID
-rw-r--r-- | actions/openid_client/login.php | 3 | ||||
-rw-r--r-- | return.php | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/actions/openid_client/login.php b/actions/openid_client/login.php index 604374ced..2a6896a61 100644 --- a/actions/openid_client/login.php +++ b/actions/openid_client/login.php @@ -6,6 +6,7 @@ elgg_load_library('openid_consumer'); $provider = get_input('openid_provider'); +$persistent = get_input('persistent', false); if ($provider == 'others') { $provider = get_input('openid_url'); @@ -13,7 +14,7 @@ if ($provider == 'others') { $consumer = new ElggOpenIDConsumer($store); $consumer->setURL($provider); -$consumer->setReturnURL(elgg_get_site_url() . 'mod/openid_client/return.php'); +$consumer->setReturnURL(elgg_get_site_url() . "mod/openid_client/return.php?persistent=$persistent"); $html = $consumer->requestAuthentication(); if ($html) { diff --git a/return.php b/return.php index ab0fc622a..b37f25bd9 100644 --- a/return.php +++ b/return.php @@ -14,9 +14,11 @@ require_once dirname(dirname(dirname(__FILE__))).'/engine/start.php'; elgg_load_library('openid_consumer');
elgg_load_library('openid_client');
+$persistent = get_input('persistent', false);
+
// get user data from the response
$consumer = new ElggOpenIDConsumer($store);
-$url = elgg_get_site_url() . 'mod/openid_client/return.php';
+$url = elgg_get_site_url() . "mod/openid_client/return.php?persistent=$persistent";
$consumer->setReturnURL($url);
$data = $consumer->completeAuthentication();
if (!$data || !$data['openid_identifier']) {
@@ -48,7 +50,7 @@ if ($users) { if ($user) {
// log in user and maybe update account (admin setting, user prompt?)
try {
- login($user);
+ login($user, $persistent);
} catch (LoginException $e) {
register_error($e->getMessage());
forward();
|