]> andersk Git - sql-web.git/blobdiff - login.php
jbarnold: contact.php
[sql-web.git] / login.php
index f11e80ebb597a694827c5213e5aa8e1984e3edd1..5e2d3109e2086ac8683780e11cb7a7665d93165a 100644 (file)
--- a/login.php
+++ b/login.php
@@ -9,23 +9,25 @@ if (isSSL()) {
        }
 }
 
-if (empty($err) && isPost()) {
-       
+if (isPost() && empty($err)) {
+
        if (isSSL()) {
-           $Login = new Login($SSLUsername);
-               $Login->update($SSLCred['Name'],$SSLCred['Email']);
-               sess('Login', $Login);
+               $Login = $LoginSSL;
        } else {
                $Login = new Login($i_u, $i_p);
-               if ($Login->exists() && !$Login->isEnabled()) {
-                       $err[] = 'Account not active. <a href="signup">Did you signup yet?</a>.';
-               } elseif (!$Login->exists()) {
-                       $err[] = 'Nonexistant account or invalid password.';
-               } elseif (!$Login->canLogin()) {
-                       $err[] = 'That account is no longer valid. Please contact the staff.';
-               } else {
-                       sess('Login', $Login);
-               }
+       }
+       
+       if ($Login->exists() && !$Login->isEnabled()) {
+               $err[] = 'Account not active. <a href="signup">Did you signup yet?</a>.';
+       } elseif (!$Login->exists()) {
+               $err[] = 'Nonexistant account or invalid password.';
+       } elseif (!$Login->canLogin()) {
+               $err[] = 'That account is no longer valid. Please contact the staff.';
+       }
+
+       if (empty($err)) {
+               sess('UserId', $Login->getUserId());
+               redirect('main');
        }
 
 }
This page took 0.744926 seconds and 4 git commands to generate.