PWD; $USR = strtolower($data->USR); # do the username and password match? if ( ($userid == $USR) && ($password == $PASSWD) ) { $authenticated = true; } else { $authenticated = false; # add login failure to failed logins log $logFailed = new GS_Logging_Class('failedlogins.log'); $logFailed->add('Username',$userid); $logFailed->add('Reason','Invalid Password'); } # end password match check } else { # user doesnt exist in this system $authenticated = false; # add login failure to failed logins log $logFailed = new GS_Logging_Class('failedlogins.log'); $logFailed->add('Username',$userid); $logFailed->add('Reason','Invalid User'); } # is this successful? if( $authenticated ) { # YES - set the login cookie, then redirect user to secure panel create_cookie(); exec_action('successful-login-end'); redirect($cookie_redirect); } else { # NO - show error message $error = i18n_r('LOGIN_FAILED'); $logFailed->save(); } # end authenticated check } # end error check } # end submission check ?>