diff --git a/pool/base.php b/pool/base.php index 5b24c4ab..a109a23c 100644 --- a/pool/base.php +++ b/pool/base.php @@ -334,7 +334,9 @@ function validUserPass($user, $pass) $key = 'ckp'.rand(1000000,9999999); $_SESSION['ckpkey'] = $key; $_SESSION[$key] = array('who' => $user, 'id' => $user); + return true; } + return false; } # function logout() @@ -364,6 +366,8 @@ function requestRegister() # function tryLogInOut() { + global $loginfailed; + // If already logged in, it will ignore User/Pass if (isset($_SESSION['ckpkey'])) { @@ -373,21 +377,29 @@ function tryLogInOut() } else { + $login = getparam('Login', false); + if (nuem($login)) + return; + $user = getparam('User', false); if ($user !== NULL) $user = loginStr($user); if (nuem($user)) + { + $loginfailed = true; return; + } $pass = getparam('Pass', false); if (nuem($pass)) + { + $loginfailed = true; return; + } - $login = getparam('Login', false); - if (nuem($login)) - return; - - validUserPass($user, $pass); + $valid = validUserPass($user, $pass); + if (!$valid) + $loginfailed = true; } } # diff --git a/pool/page.php b/pool/page.php index e4ec64dd..4ecccb6c 100644 --- a/pool/page.php +++ b/pool/page.php @@ -163,7 +163,7 @@ h1 {margin-top: 20px; float:middle; font-size: 20px;} # function pgtop($info, $dotop, $user, $douser) { - global $site_title; + global $site_title, $loginfailed; $phr = '?THs'; $plb = '?'; @@ -288,6 +288,8 @@ function pgtop($info, $dotop, $user, $douser) $top .= " You need to enable javascript to use"; $top .= " the $site_title web site."; + if ($loginfailed === true) + $top .= '
Login Failed
'; if (isset($info['u_nopayaddr'])) $top .= '
Please set a payout address on your account!
'; if (isset($info['u_noemail'])) diff --git a/pool/prime.php b/pool/prime.php index 539ef33b..6ee31cfb 100644 --- a/pool/prime.php +++ b/pool/prime.php @@ -3,6 +3,9 @@ global $stt; $stt = microtime(); # +global $loginfailed; +$loginfailed = false; +# include_once('param.php'); include_once('base.php'); #