alert(\''.__('Please supply valid username and password').'\');'; } else { // destroy previous session set in OPAC simbio_security::destroySessionCookie(null, MEMBER_COOKIES_NAME, SWB, false); require SB.'admin/default/session.inc.php'; // regenerate session ID to prevent session hijacking session_regenerate_id(true); // create logon class instance $logon = new admin_logon($username, $password, $sysconf['auth']['user']['method']); if ($sysconf['auth']['user']['method'] == 'ldap') { $ldap_configs = $sysconf['auth']['user']; } if ($logon->adminValid($dbs)) { # if ($sysconf['captcha']['smc']['enable']) { if ($sysconf['captcha']['smc']['type'] == 'recaptcha') { require_once LIB.$sysconf['captcha']['smc']['folder'].'/'.$sysconf['captcha']['smc']['incfile']; $privatekey = $sysconf['captcha']['smc']['privatekey']; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly session_unset(); header("location:index.php?p=login"); die(); } } elseif ($sysconf['captcha']['smc']['type'] == 'others') { # other captchas here } } # // set cookie admin flag setcookie('admin_logged_in', true, time()+14400, SWB); // write log utility::writeLogs($dbs, 'staff', $username, 'Login', 'Login success for user '.$username.' from address '.$_SERVER['REMOTE_ADDR']); echo ''; exit(); } else { // write log utility::writeLogs($dbs, 'staff', $username, 'Login', 'Login FAILED for user '.$username.' from address '.$_SERVER['REMOTE_ADDR']); // message $msg = ''; simbio_security::destroySessionCookie($msg, COOKIES_NAME, SWB.'admin', false); exit(); } } } ?>

Login Repository Fakultas Teknik