as$Uc=>$X){if($X[0]<$bg)unset($Tc[$Uc]);}}$Sc=&$Tc[$b->bruteForceKey()];if(!$Sc)$Sc=array($bg+30*60,0);$Sc[1]++;$tf=serialize($Tc);rewind($p);fwrite($p,$tf);ftruncate($p,strlen($tf));flock($p,LOCK_UN);fclose($p);}$xa=$_POST["auth"];if($xa){$Tc=unserialize(@file_get_contents(get_temp_dir()."/adminer.invalid"));$Sc=$Tc[$b->bruteForceKey()];$Kd=($Sc[1]>30?$Sc[0]-time():0);if($Kd>0)auth_error(lang(array('Too many unsuccessful logins, try again in %d minute.','Too many unsuccessful logins, try again in %d minutes.'),ceil($Kd/60)));session_regenerate_id();$Jg=$xa["driver"];$O=$xa["server"];$V=$xa["username"];$we=(string)$xa["password"];$i=$xa["db"];set_password($Jg,$O,$V,$we);$_SESSION["db"][$Jg][$O][$V][$i]=true;if($xa["permanent"]){$z=base64_encode($Jg)."-".base64_encode($O)."-".base64_encode($V)."-".base64_encode($i);$Je=$b->permanentLogin(true);$ze[$z]="$z:".base64_encode($Je?encrypt_string($we,$Je):"");cookie("adminer_permanent",implode(" ",$ze));}if(count($_POST)==1||DRIVER!=$Jg||SERVER!=$O||$_GET["username"]!==$V||DB!=$i)redirect(auth_url($Jg,$O,$V,$i));}elseif($_POST["logout"]){if($Dc&&!verify_token()){page_header('Logout','Invalid CSRF token. Send the form again.');page_footer("db");exit;}else{foreach(array("pwds","db","dbs","queries")as$z)set_session($z,null);unset_permanent();redirect(substr(preg_replace('~\b(username|db|ns)=[^&]*&~','',ME),0,-1),'Logout successful.');}}elseif($ze&&!$_SESSION["pwds"]){session_regenerate_id();$Je=$b->permanentLogin();foreach($ze
as$z=>$X){list(,$Qa)=explode(":",$X);list($Jg,$O,$V,$i)=array_map('base64_decode',explode("-",$z));set_password($Jg,$O,$V,decrypt_string(base64_decode($Qa),$Je));$_SESSION["db"][$Jg][$O][$V][$i]=true;}}function