Add table to doc util script

- Remove db parameter from several places
- Add constructors for document types
This commit is contained in:
2024-06-01 23:17:29 -04:00
parent 610ab67475
commit b88ad1f268
26 changed files with 306 additions and 262 deletions

View File

@@ -1,18 +1,16 @@
<?php
include '../../start.php';
use FeedReaderCentral\Data;
use FeedReaderCentral\Key;
use FeedReaderCentral\Security;
$db = Data::getConnection();
Security::verifyUser($db, redirectIfAnonymous: false);
Security::verifyUser(redirectIfAnonymous: false);
// Users already logged on have no need of this page
if (key_exists(Key::USER_ID, $_SESSION)) frc_redirect('/');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
Security::logOnUser($_POST['email'] ?? '', $_POST['password'], $_POST['returnTo'] ?? null, $db);
Security::logOnUser($_POST['email'] ?? '', $_POST['password'], $_POST['returnTo'] ?? null);
// If we're still here, something didn't work; preserve the returnTo parameter
$_GET['returnTo'] = $_POST['returnTo'];
}
@@ -41,4 +39,3 @@ page_head('Log On'); ?>
</form>
</article><?php
page_foot();
$db->close();