Beispiel #1
0
 private function post()
 {
     //Check to see what button was pressed
     if (param('btnLogin')) {
         //Check to make sure that everything is filled out
         if (param('txtEmail') && param('txtPassword')) {
             $result = AuthenticationUtil::login(param('txtEmail'), param('txtPassword'));
             //Check to see if the login succeeded
             if ($result) {
                 return '<h3>Login Failed: ' . $result . '</h3>';
             } else {
                 header('Location: /index.php');
                 exit;
             }
         } else {
             return '<h3>Login Failed: Missing fields.</h3>';
         }
     } elseif (param('btnRegister')) {
         header('Location: /pages/users/login.php?page=register');
     }
     return false;
 }