]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
♫ Don't you forget about me ♫
authorEvan Prodromou <evan@prodromou.name>
Tue, 18 Nov 2008 02:49:47 +0000 (21:49 -0500)
committerEvan Prodromou <evan@prodromou.name>
Tue, 18 Nov 2008 02:49:47 +0000 (21:49 -0500)
darcs-hash:20081118024947-84dde-46f68dff10cd2b5665fbd482f90ac83601df4228.gz

actions/finishopenidlogin.php
actions/openidlogin.php

index f09027e9e0a64f14086407b6e1d60ae38eb64b25..b8008afb208e4b34ab47f93973f977ed61e441bd 100644 (file)
@@ -134,6 +134,10 @@ class FinishopenidloginAction extends Action {
                                # oid_update_user($user, $sreg);
                                common_set_user($user->nickname);
                                common_real_login(true);
+                               if ($_SESSION['openid_rememberme']) {
+                                       common_rememberme($user);
+                               }
+                               unset($_SESSION['openid_rememberme']);
                                $this->go_home($user->nickname);
                        } else {
                                $this->save_values($display, $canonical, $sreg);
@@ -229,6 +233,10 @@ class FinishopenidloginAction extends Action {
                oid_set_last($display);                                                    
                common_set_user($user->nickname);
                common_real_login(true);
+               if ($_SESSION['openid_rememberme']) {
+                       common_rememberme($user);
+               }
+               unset($_SESSION['openid_rememberme']);
                common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)));
        }
 
@@ -264,6 +272,10 @@ class FinishopenidloginAction extends Action {
                oid_set_last($display);
                common_set_user($user->nickname);
                common_real_login(true);
+               if ($_SESSION['openid_rememberme']) {
+                       common_rememberme($user);
+               }
+               unset($_SESSION['openid_rememberme']);
                $this->go_home($user->nickname);
        }
 
index b066b9aa4ecdb349381d1e0c4fbd38e7aa7b563b..1b289dbeab3ab8e865be36e190890614685b9677 100644 (file)
@@ -37,9 +37,17 @@ class OpenidloginAction extends Action {
                                return;
                        }
 
+                       $rememberme = $this->boolean('rememberme');
+                       
+                       common_ensure_session();
+                       
+                       $_SESSION['openid_rememberme'] = $rememberme;
+                       
                        $result = oid_authenticate($openid_url,
                                                                           'finishopenidlogin');
+                       
                        if (is_string($result)) { # error message
+                               unset($_SESSION['openid_rememberme']);
                                $this->show_form($result, $openid_url);
                        }
                } else {
@@ -74,6 +82,9 @@ class OpenidloginAction extends Action {
                common_input('openid_url', _('OpenID URL'),
                                         $openid_url,
                                         _('Your OpenID URL'));
+               common_checkbox('rememberme', _('Remember me'), false,
+                               _('Automatically login in the future; ' .
+                                  'not for shared computers!'));
                common_submit('submit', _('Login'));
                common_element_end('form');
                common_show_footer();