]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
remove redirect to OTP on login from login, register
authorEvan Prodromou <evan@status.net>
Mon, 11 Jan 2010 06:58:33 +0000 (22:58 -0800)
committerEvan Prodromou <evan@status.net>
Mon, 11 Jan 2010 06:58:33 +0000 (22:58 -0800)
actions/login.php
actions/register.php

index 8694de188e73575e398e265b5a9c0323f5db33c9..9c47d88b140f54074e328af2fdce7e1579c1cc74 100644 (file)
@@ -132,12 +132,6 @@ class LoginAction extends Action
 
         $url = common_get_returnto();
 
-        if (common_config('site', 'ssl') == 'sometimes' && // mixed environment
-            0 != strcasecmp(common_config('site', 'server'), common_config('site', 'sslserver'))) {
-            $this->redirectFromSSL($user, $url, $this->boolean('rememberme'));
-            return;
-        }
-
         if ($url) {
             // We don't have to return to it again
             common_set_returnto(null);
@@ -282,31 +276,4 @@ class LoginAction extends Action
         $nav = new LoginGroupNav($this);
         $nav->show();
     }
-
-    function redirectFromSSL($user, $returnto, $rememberme)
-    {
-        try {
-            $login_token = Login_token::makeNew($user);
-        } catch (Exception $e) {
-            $this->serverError($e->getMessage());
-            return;
-        }
-
-        $params = array();
-
-        if (!empty($returnto)) {
-            $params['returnto'] = $returnto;
-        }
-
-        if (!empty($rememberme)) {
-            $params['rememberme'] = $rememberme;
-        }
-
-        $target = common_local_url('otp',
-                                   array('user_id' => $login_token->user_id,
-                                         'token' => $login_token->token),
-                                   $params);
-
-        common_redirect($target, 303);
-    }
 }
index ec6534eee042ff49a02b547a26a13cbe361c79f4..6339ea1171b654076aa4eb31fa676bf26b754284 100644 (file)
@@ -260,16 +260,6 @@ class RegisterAction extends Action
                 // Re-init language env in case it changed (not yet, but soon)
                 common_init_language();
 
-                if (common_config('site', 'ssl') == 'sometimes' && // mixed environment
-                    0 != strcasecmp(common_config('site', 'server'), common_config('site', 'sslserver'))) {
-
-                    $url = common_local_url('all',
-                                            array('nickname' =>
-                                                  $user->nickname));
-                    $this->redirectFromSSL($user, $url, $this->boolean('rememberme'));
-                    return;
-                }
-
                 $this->showSuccess();
             } else {
                 $this->showForm(_('Invalid username or password.'));
@@ -589,32 +579,5 @@ class RegisterAction extends Action
         $nav = new LoginGroupNav($this);
         $nav->show();
     }
-
-    function redirectFromSSL($user, $returnto, $rememberme)
-    {
-        try {
-            $login_token = Login_token::makeNew($user);
-        } catch (Exception $e) {
-            $this->serverError($e->getMessage());
-            return;
-        }
-
-        $params = array();
-
-        if (!empty($returnto)) {
-            $params['returnto'] = $returnto;
-        }
-
-        if (!empty($rememberme)) {
-            $params['rememberme'] = $rememberme;
-        }
-
-        $target = common_local_url('otp',
-                                   array('user_id' => $login_token->user_id,
-                                         'token' => $login_token->token),
-                                   $params);
-
-        common_redirect($target, 303);
-    }
 }