]> andersk Git - sql-web.git/blobdiff - login.php
contact: page formatting
[sql-web.git] / login.php
index 441c778ddbf24d855f5ed214fe6a7de249ae6f2e..98a59a5d995b73383c1903444782243b37fb10c6 100644 (file)
--- a/login.php
+++ b/login.php
@@ -6,32 +6,28 @@ require_once('mitsql.lib.php');
 if (isSSL()) {
        if (is_null($SSLCred)) {
                $err[] = 'Please install a valid certificate.';
-       } else {
-           $Login2 = new Login($SSLUsername);
-           if (!(empty($SSLUsername) || $Login2->exists())) {
-               addUser($cred);
-               $Login = new Login($SSLUsername);
-           }
        }
 }
 
-if (empty($err) && isPost()) {
-       
+if (isPost() && empty($err)) {
+
        if (isSSL()) {
-           $Login = new Login($SSLUsername);
-               $Login->update($cred['Name'],$cred['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="do/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.047743 seconds and 4 git commands to generate.