$baseURL="https://kellie.tsoftsoft.com/";
?>
//How does this process work for doing that?
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \n####################testAuth\nL(".__line__."-auth3.php) ".__file__:"";
//"DONE" means we have a live one, index.php takes over
//"STOP" means we do NOT have a live one, put up a different screen, do not go to index.php
$systeMessage .= (isset($systeMessage)?$systeMessage:"")."\nL(".__line__."-auth3.php) ".__file__;
function checkLegit(): bool{
global $l,$g,$testAuth;
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Checking if the legit key exists in session":"";
if (!isset($_SESSION['legit'])) return false;
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) - legit key exists. Checking if the expiry key exists in session":"";
if (!isset($_SESSION['expiry']) || ($_SESSION['expiry'] < date("YmdHis"))){ // expired === does not exist
$_SESSION = [];
session_destroy();
return false;
}
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) - passed expiry checks. Decrypting the old legit key":"";
$legit = h2($_SESSION['legit'],false,$l,$g);
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Returing True if good legit key, or false if not":"";
return ($legit === 'LegitemateSession');
}
$Droot = $_SERVER['DOCUMENT_ROOT'];
$SendJournalLink = null;
//Let index.php (or one of its minions) decide what to do with any sendJornalLink anchor[s]
$SendJournalLink = isset($_COOKIE['journal'])
?"Click here to upload your journal(s)"
:false;
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Got me some Droot($Droot)":"";
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Got me some SendJournalLink($SendJournalLink)":"";
//##########################################################################################
//##########################################################################################
if (checkLegit()){
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nCL(".__line__."-auth3.php) checked Legit - and made it":"";
$systeMessage .= "\n line ".__line__."-auth3.php;found a Legit session, setting it for now +30 days";
$_SESSION['expiry'] = date('YmdHis',strtotime('+30 days'));
return;
}else{
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Checked Legit - and DID NOT MAKE IT":"";
}
// die($testAuth);
$loginTries = isset($_COOKIE['loginTries'])
? (int)$_COOKIE['loginTries']
: 0;
/*
echo "
";
var_dump($_POST);
echo "
";
die();
/* ========================= */
if (isset($_POST['login-id']))
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) login-id(".$_POST['login-id'].")":"";
if (isset($_POST['login-pw']))
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) login-pw(".$_POST['login-pw'].")":"";
if (isset($_POST['login-id']) && isset($_POST['login-pw'])){
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Checking val.php":"";
require_once("$Droot/i/iData/val.php");
if (isset($_SESSION['legit']) && checkLegit()){
die("\n\n\nHard Stop");
return;
}
$systeMessage .= "\nline ".__line__."-auth3.phpCredentials did not match your profile Please try again";
//##########################################################################################
// if credentials sent but NOT valid
//##########################################################################################
// (maybe badBot - sleep 1.326 seconds)
$loginTries++;
setcookie(
'loginTries',
$loginTries,
time() + 30,
'/'
);
if ($loginTries > 5){
require_once("$Droot/i/badBot_happy_info.php");
die();
}
// this falls through to the bottom where it is done
// require_once("$Droot/i/login.php");
// die();
}Else{
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Either login-id or login-pw was not sent":"";
$systeMessage.="\n Not logged-in, and no login-credentials supplied";
}
//##########################################################################################
//Does the user have a Journal cookie? (so, not logged-in, and no credentials sent, no valid session)
//##########################################################################################
if (isset($_COOKIE['journal'])){
// Send register.php for the new user (and actually treat the user like NOT a badBot)
$testAuth .= (isset($testAuth) && !empty($testAuth))?" \nL(".__line__."-auth3.php) Journal Cookie found, should go to Register.php":"";
$systeMessage.="\n Journal cookie found - going to Register.php";
require_once("$Droot/i/register.php");
die();
}
//##########################################################################################
//
//OTHERWISE (not logged-in, no journal cookie, no credentials)
//send the login screen.
//STOP
$systeMessage .= "\ndid not find complete credentials, loading Login.php";
//echo " $testAuth$systeMessage";
//die();
require_once("$Droot/i/login.php");
die();
Camping
$GET_s=(isset($_GET['s']) && $_GET['s']!=='')?$GET_s=(int)h2($_GET['s'],0,$l,$g):0;
$page = isset($_GET['page'])?$_GET['page']:'';
$title="Dashboard";
switch($page){
case 'where':
case 'food':
case 'gear':
$title = $trip_name;
break;
case 'when':
$title = 'when';
break;
}
?>
☰
( ! ) Warning: Undefined variable $title in E:\wamp64\www\Kellie\kellie.tsoftsoft.com\index.php on line 116
Call Stack
#
Time
Memory
Function
Location
1
0.0022
431080
{main}( )
...\index.php:0
( ! ) Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in E:\wamp64\www\Kellie\kellie.tsoftsoft.com\index.php on line 116