]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/login.php
checks for user and sub in validate and better error check in remote save
[quix0rs-gnu-social.git] / actions / login.php
index 9f9c473b513d3436316f8b0dd9035f405ca47fda..3a93c466facd4ffe6b5707d01033cd4c81f2b6fc 100644 (file)
@@ -44,19 +44,25 @@ class LoginAction extends Action {
                                return;
                        }
                        # success!
-                       common_redirect(common_local_url('all',
-                                                                                        array('nickname' =>
-                                                                                                  $nickname)));
+                       $url = common_get_returnto();
+                       if ($url) {
+                               # We don't have to return to it again
+                               common_set_returnto(NULL);
+                       } else {
+                               $url = common_local_url('all',
+                                                                               array('nickname' =>
+                                                                                         $nickname));
+                       }
+                       common_redirect($url);
                } else {
                        $this->show_form(_t('Incorrect username or password.'));
                }
        }
 
        function show_form($error=NULL) {
-
                common_show_header(_t('Login'));
-               if (!is_null($error)) {
-                       common_element('div', array('class' => 'error'), $msg);
+               if ($error) {
+                       common_element('div', array('class' => 'error'), $error);
                }
                common_element_start('form', array('method' => 'POST',
                                                                                   'id' => 'login',