various bugfixes

This commit is contained in:
Joey Kimsey
2024-12-18 08:58:35 -05:00
parent a859fb7ace
commit 5fe1c3aafe
34 changed files with 92 additions and 72 deletions

View File

@ -94,7 +94,6 @@ $(document).ready(function() {
});
});
// with the dynamic footer, you need to adjust the content padding to make sure the footer doesn't overlap the content
document.addEventListener('DOMContentLoaded', function () {
const toggleButton = document.getElementById('dark-mode-toggle');
const enableButton = document.getElementById('dark-mode-toggle-button');

View File

@ -20,6 +20,7 @@ use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Session;
use TheTempusProject\Bedrock\Functions\Cookie;
use TheTempusProject\Classes\DatabaseModel;
use TheTempusProject\Classes\Config;
use TheTempusProject\TheTempusProject as App;
class Sessions extends DatabaseModel {
@ -56,9 +57,11 @@ class Sessions extends DatabaseModel {
$user = new User;
// @todo lets put this on some sort of realistic checking regime other than check everything every time
if ( $sessionID == false ) {
Debug::log( 'sessionID false' );
return false;
}
if ( !Check::id( $sessionID ) ) {
Debug::log( 'sessionID not id' );
return false;
}
$data = self::$db->get( $this->tableName, [ 'ID', '=', $sessionID ] );
@ -115,12 +118,12 @@ class Sessions extends DatabaseModel {
public function checkCookie( $cookieToken, $create = false ) {
$user = new User;
if ( $cookieToken === false ) {
Debug::info( 'cookieToken false' );
return false;
}
$data = self::$db->get( $this->tableName, [ 'token', '=', $cookieToken ] );
if ( !$data->count() ) {
Debug::info( 'sessions->checkCookie - Session token not found.' );
return false;
}
$session = $data->first();
@ -155,9 +158,10 @@ class Sessions extends DatabaseModel {
* @return {bool}
*/
public function newSession( $expire = null, $override = false, $remember = false, $userID = null ) {
if ( ! isset( $expire ) ) {
if ( empty( $expire ) ) {
// default Session Expiration is 24 hours
$expire = ( time() + ( 3600 * 24 ) );
$expireLimit = Config::getValue( 'main/loginTimer' );
$expire = ( time() + $expireLimit );
Debug::log( 'Using default expiration time' );
}
$lastPage = App::getUrl();

View File

@ -13,7 +13,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta property="og:url" content="{CURRENT_URL}">
<meta name='twitter:card' content='summary_large_image' />
<meta name='twitter:card' content='summary_large_image'>
<title>{TITLE}</title>
<meta itemprop="name" content="{TITLE}">
<meta name="twitter:title" content="{TITLE}">
@ -30,10 +30,10 @@
{ROBOT}
<link rel="icon" href="{ROOT_URL}images/favicon.ico">
<!-- Required CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="{BOOTSTRAP_CDN}css/bootstrap.min.css" crossorigin="anonymous">
<!-- RSS -->
<link rel="alternate" href="{ROOT_URL}blog/rss" title="{TITLE} Feed" type="application/rss+xml" />
<link rel="alternate" href="{ROOT_URL}blog/rss" title="{TITLE} Feed" type="application/rss+xml">
<!-- Custom styles for this template -->
{TEMPLATE_CSS_INCLUDES}
</head>
@ -42,7 +42,7 @@
<header class="p-3 text-bg-dark">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<img src="{ROOT_URL}{LOGO}" class="bi me-2" width="40" height="32" role="img" aria-label="{SITENAME} Logo" />
<img src="{ROOT_URL}{LOGO}" class="bi me-2" width="40" height="32" role="img" aria-label="{SITENAME} Logo">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
{SITENAME}
</a>

View File

@ -14,7 +14,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 10%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.b" value="B_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.b" value="B_[]">
</th>
</tr>
</thead>

View File

@ -10,7 +10,7 @@
<a href="#" class="stretched-link">Continue reading</a>
</div>
<div class="col-auto d-none d-lg-block">
<svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg>
<svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg>
</div>
</div>
</div>
@ -24,7 +24,7 @@
<a href="#" class="stretched-link">Continue reading</a>
</div>
<div class="col-auto d-none d-lg-block">
<svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"/><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg>
<svg class="bd-placeholder-img" width="200" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Thumbnail" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#55595c"><text x="50%" y="50%" fill="#eceeef" dy=".3em">Thumbnail</text></svg>
</div>
</div>
</div>

View File

@ -12,7 +12,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.br" value="BR_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.br" value="BR_[]">
</th>
</tr>
</thead>
@ -40,6 +40,6 @@
</table>
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
<br />
<br>
<a href="{ROOT_URL}admin/bugreport/clear">clear all</a>
</div>

View File

@ -57,8 +57,8 @@
<div class="card-footer text-center">
{ADMIN}
<form action="{ROOT_URL}admin/bugreport/delete" method="post">
<INPUT type="hidden" name="BR_" value="{ID}"/>
<input type="hidden" name="token" value="{TOKEN}" />
<INPUT type="hidden" name="BR_" value="{ID}">
<input type="hidden" name="token" value="{TOKEN}">
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
{/ADMIN}

View File

@ -13,7 +13,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.c" value="C_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.c" value="C_[]">
</th>
</tr>
</thead>

View File

@ -12,7 +12,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.f" value="F_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.f" value="F_[]">
</th>
</tr>
</thead>
@ -40,6 +40,6 @@
</table>
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
<br />
<br>
<a href="{ROOT_URL}admin/contact/clear">clear all</a>
</div>

View File

@ -49,8 +49,8 @@
<div class="card-footer text-center">
{ADMIN}
<form action="{ROOT_URL}admin/contact/delete" method="post">
<INPUT type="hidden" name="F_" value="{ID}"/>
<input type="hidden" name="token" value="{TOKEN}" />
<INPUT type="hidden" name="F_" value="{ID}">
<input type="hidden" name="token" value="{TOKEN}">
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
{/ADMIN}

View File

@ -1 +1 @@
<span class="label label-danger">{notificationCount}</span>
<span class="badge bg-danger rounded-pill">{notificationCount}</span>

View File

@ -2,13 +2,14 @@
<div class="dropdown nav-item mx-2">
<a
href="#"
class="nav-link dropdown-toggle"
class="d-flex align-items-center text-white text-decoration-none dropdown-toggle"
id="notiificationsDropdown"
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<i class="fa fa-fw fa-bell"></i><span class="ml-3">{NBADGE}</span>
<i class="fa fa-fw fa-bell"></i><span class="ms-2">{NBADGE}</span>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="notiificationsDropdown">
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="notiificationsDropdown">
{LOOP}
<!-- Notification Item -->
<li>
@ -23,12 +24,8 @@
</li>
{/LOOP}
{ALT}
<li class="message-preview">
<div class="media">
<div class="media-body text-center" style="padding-bottom: 10px; padding-top: 10px">
<h5 class="media-heading"><strong>No Notifications</strong></h5>
</div>
</div>
<li class="px-3 text-center">
<strong>No Notifications</strong>
</li>
{/ALT}
<!-- Footer -->

View File

@ -10,7 +10,7 @@
<th style="width: 85%">email</th>
<th style="width: 5%"></th>
<th style="width: 5%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.s" value="S_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.s" value="S_[]">
</th>
</tr>
</thead>

View File

@ -1,13 +1,11 @@
<div class="col-md-5 offset-md-1 mb-3">
<form>
<h5>Subscribe to our newsletter</h5>
<div class="d-flex flex-column flex-sm-row w-100 gap-2">
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal"></form>
<label for="newsletter1" class="visually-hidden">Email address</label>
<input name="email" id="email" type="email" class="form-control" placeholder="Email address" autocomplete="email">
<input type="hidden" name="token" value="{TOKEN}">
<button class="btn btn-primary" name="submit" value="submit" type="submit">Subscribe</button>
</form>
</div>
</form>
<h5>Subscribe to our newsletter</h5>
<div class="d-flex flex-column flex-sm-row w-100 gap-2">
<form action="{ROOT_URL}subscribe/home" method="post" class="form-horizontal"></form>
<label for="newsletter1" class="visually-hidden">Email address</label>
<input name="email" id="email" type="email" class="form-control" placeholder="Email address" autocomplete="email">
<input type="hidden" name="token" value="{TOKEN}">
<button class="btn btn-primary" name="submit" value="submit" type="submit">Subscribe</button>
</form>
</div>
</div>

View File

@ -18,7 +18,7 @@
{ROBOT}
<link rel="icon" href="{ROOT_URL}images/favicon.ico">
<!-- Required CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="{BOOTSTRAP_CDN}css/bootstrap.min.css" crossorigin="anonymous">
<!-- Custom styles for this template -->
{TEMPLATE_CSS_INCLUDES}
@ -30,7 +30,7 @@
<!-- Side Navigation -->
<div class="d-flex flex-column flex-shrink-0 p-3 text-bg-dark" style="width: 280px;">
<a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto text-white text-decoration-none">
<img src="{ROOT_URL}{LOGO}" class="bi me-2" width="40" height="32" role="img" aria-label="{SITENAME} Logo" />
<img src="{ROOT_URL}{LOGO}" class="bi me-2" width="40" height="32" role="img" aria-label="{SITENAME} Logo">
<span class="fs-4">{SITENAME}</span>
</a>
<hr>

View File

@ -12,7 +12,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta property="og:url" content="{CURRENT_URL}">
<meta name='twitter:card' content='summary_large_image' />
<meta name='twitter:card' content='summary_large_image'>
<title>{TITLE}</title>
<meta itemprop="name" content="{TITLE}">
<meta name="twitter:title" content="{TITLE}">
@ -27,10 +27,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
{AUTHOR}
{ROBOT}
<link rel="icon" href="{ROOT_URL}images/favicon.ico">
<link rel="icon" href="{ROOT_URL}images/favicon.ico" sizes="32x32">
<link rel="apple-touch-icon" href="{ROOT_URL}images/apple-touch-icon.png"><!-- 180×180 -->
<link rel="manifest" href="{ROOT_URL}manifest.webmanifest">
<!-- Required CSS -->
<!-- <link rel="stylesheet" href="{FONT_AWESOME_URL}fontawesome.min.css" crossorigin="anonymous"> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.1/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="{BOOTSTRAP_CDN}css/bootstrap.min.css" crossorigin="anonymous">
<!-- Custom styles for this template -->
{TEMPLATE_CSS_INCLUDES}
@ -40,7 +42,7 @@
<header class="p-3 text-bg-dark">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<img src="{ROOT_URL}{LOGO}" class="bi me-2" width="40" height="32" role="img" aria-label="{SITENAME} Logo" />
<img src="{ROOT_URL}{LOGO}" class="bi me-2" width="40" height="32" alt="{SITENAME} Logo" aria-label="{SITENAME} Logo">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
{SITENAME}
</a>

View File

@ -11,7 +11,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.g" value="G_[]"/>
<input type="checkbox" onchange="checkAll(this)" name="check.g" value="G_[]">
</th>
</tr>
</thead>

View File

@ -10,7 +10,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<input type="checkbox" onchange="checkAll(this)" name="check.u" value="U_[]"/>
<input type="checkbox" onchange="checkAll(this)" name="check.u" value="U_[]">
</th>
</tr>
</thead>

View File

@ -44,8 +44,8 @@
<div class="card-footer text-center">
{ADMIN}
<form action="{ROOT_URL}admin/admin/delete" method="post">
<INPUT type="hidden" name="L_" value="{ID}"/>
<input type="hidden" name="token" value="{TOKEN}" />
<INPUT type="hidden" name="L_" value="{ID}">
<input type="hidden" name="token" value="{TOKEN}">
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
{/ADMIN}

View File

@ -12,7 +12,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%"">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.l" value="A_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.l" value="A_[]">
</th>
</tr>
</thead>

View File

@ -54,8 +54,8 @@
<div class="card-footer text-center">
{ADMIN}
<form action="{ROOT_URL}admin/errors/delete" method="post">
<INPUT type="hidden" name="E_" value="{ID}"/>
<input type="hidden" name="token" value="{TOKEN}" />
<INPUT type="hidden" name="E_" value="{ID}">
<input type="hidden" name="token" value="{TOKEN}">
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
{/ADMIN}

View File

@ -12,7 +12,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.e" value="E_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.e" value="E_[]">
</th>
</tr></thead><tbody>
{LOOP}
@ -38,6 +38,6 @@
</table>
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
<br />
<br>
<a href="{ROOT_URL}admin/errors/clear">clear all</a>
</div>

View File

@ -44,8 +44,8 @@
<div class="card-footer text-center">
{ADMIN}
<form action="{ROOT_URL}admin/logins/delete" method="post">
<INPUT type="hidden" name="L_" value="{ID}"/>
<input type="hidden" name="token" value="{TOKEN}" />
<INPUT type="hidden" name="L_" value="{ID}">
<input type="hidden" name="token" value="{TOKEN}">
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
{/ADMIN}

View File

@ -12,7 +12,7 @@
<th style="width: 5%"></th>
<th style="width: 5%"></th>
<th style="width: 5%"">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.l" value="L_[]"/>
<INPUT type="checkbox" onchange="checkAll(this)" name="check.l" value="L_[]">
</th>
</tr>
</thead>
@ -40,6 +40,6 @@
</table>
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form>
<br />
<br>
<a href="{ROOT_URL}admin/logins/clear">clear all</a>
</div>

View File

@ -14,7 +14,7 @@
<th style="width: 5%">Edit</th>
<th style="width: 5%">Delete</th>
<th style="width: 5%">
<input type="checkbox" onchange="checkAll(this)" name="check.r" value="R_[]"/>
<input type="checkbox" onchange="checkAll(this)" name="check.r" value="R_[]">
</th>
</tr>
</thead>

View File

@ -12,7 +12,7 @@
<th style="width: 5%">Edit</th>
<th style="width: 5%">Delete</th>
<th style="width: 5%">
<input type="checkbox" onchange="checkAll(this)" name="check.u" value="U_[]"/>
<input type="checkbox" onchange="checkAll(this)" name="check.u" value="U_[]">
</th>
</tr>
</thead>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{SITENAME}</title>
<style type="text/css">
body {

View File

@ -4,7 +4,7 @@
<p class="col-8 offset-2">You can begin the process of recovering your account here. Provide your username, or email address and instructions for ressetting your password will be mailed to you shortly.</p>
<fieldset>
<div data-mdb-input-init class="form-outline mb-4 col-2 offset-5">
<input name="entry" type="text" id="entry" class="form-control" placeholder="Username or Email" />
<input name="entry" type="text" id="entry" class="form-control" placeholder="Username or Email">
</div>
</fieldset>
<input type="hidden" name="token" value="{TOKEN}">

View File

@ -12,7 +12,7 @@
<th class="px-5" style="width: 70%">Plugin Name</th>
<th class="text-center" style="width: 20%">Version</th>
<th class="text-center" style="width: 10%">
<INPUT type="checkbox" onchange="checkAll(this)" name="check.m" value="P_[]" checked="checked"/>
<input type="checkbox" onchange="checkAll(this)" name="check.m" value="P_[]" checked="checked">
</th>
</tr>
</thead>

View File

@ -11,12 +11,19 @@
<h4 class="mt-1 mb-5 pb-1">AllTheBookmarks</h4>
</div>
<form action="{ROOT_URL}home/login" method="post">
<p>Please login to your account</p>
<div data-mdb-input-init class="form-outline mb-4">
<input name="username" type="text" id="username" class="form-control" placeholder="Username" />
<input name="username" type="text" id="username" class="form-control" placeholder="Username">
</div>
<div data-mdb-input-init class="form-outline mb-4">
<input name="password" type="password" id="password" class="form-control" placeholder="password" />
<input name="password" type="password" id="password" class="form-control" placeholder="password">
</div>
<div class="mb-4 row">
<div class="col-lg-6 offset-2">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" name="remember" id="remember" value="true">
<label class="form-check-label" for="remember">Stay Logged In</label>
</div>
</div>
</div>
<div class="text-center pt-1 mb-5 pb-1">
<button name="submit" value="submit" type="submit" data-mdb-button-init data-mdb-ripple-init class="btn btn-primary btn-block fa-lg gradient-custom-2 mb-3">

View File

@ -7,7 +7,7 @@
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<img src="{ROOT_URL}{AVATAR}" alt="" width="32" height="32" class="rounded-circle me-2"> <strong class="mr-3">{USERNAME}</strong>
<img src="{ROOT_URL}{AVATAR}" alt="" width="32" height="32" class="rounded-circle me-2"> <strong class="ms-2">{USERNAME}</strong>
</a>
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="userDropdown">
<li><a href="{ROOT_URL}usercp" class="dropdown-item"><i class="fa fa-fw fa-user"></i> Profile</a></li>

View File

@ -40,7 +40,8 @@
type="checkbox"
class="form-check-input mb-2"
id="remember"
name="remember">
name="remember"
value="true">
<label class="form-check-label" for="remember">Remember me</label>
</div>
@ -54,4 +55,4 @@
</button>
</form>
</div>
</li>
</div>