This commit is contained in:
Joey Kimsey
2025-01-30 13:11:02 -05:00
parent 02892dfe6d
commit b8d2550901
10 changed files with 61 additions and 1 deletions

View File

@ -22,6 +22,7 @@ use TheTempusProject\Plugins\Comments as CommentPlugin;
use TheTempusProject\Plugins\Blog as BlogPlugin; use TheTempusProject\Plugins\Blog as BlogPlugin;
use TheTempusProject\Plugins\Contact as ContactPlugin; use TheTempusProject\Plugins\Contact as ContactPlugin;
use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Input;
class Home extends AdminController { class Home extends AdminController {
public static $user; public static $user;
@ -77,6 +78,11 @@ class Home extends AdminController {
$users = Views::simpleView( 'admin.dashboard.users', self::$user->recent( 5 ) ); $users = Views::simpleView( 'admin.dashboard.users', self::$user->recent( 5 ) );
Components::set( 'userDash', $users ); Components::set( 'userDash', $users );
if ( Input::exists( 'submit' ) ) {
$results = Views::simpleView( 'admin.dashboard.users', self::$user->search( Input::post('searchTerm') ) );
Components::set( 'searchResults', $results );
}
Views::view( 'admin.dashboard.dash' ); Views::view( 'admin.dashboard.dash' );
} }
} }

View File

@ -104,6 +104,10 @@ class Usercp extends Controller {
$userPrefs = App::$activePrefs; $userPrefs = App::$activePrefs;
if ( Input::exists( 'submit' ) ) { if ( Input::exists( 'submit' ) ) {
$fields = $prefs->convertFormToArray( true, false ); $fields = $prefs->convertFormToArray( true, false );
// @TODO now i may need to rework the form checker to work with this....
// if (!Forms::check('userPrefs')) {
// Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] );
// }
self::$user->updatePrefs( $fields, App::$activeUser->ID ); self::$user->updatePrefs( $fields, App::$activeUser->ID );
Issues::add( 'success', 'Your preferences have been updated.' ); Issues::add( 'success', 'Your preferences have been updated.' );
// if the image upload fails, need to fall back on original // if the image upload fails, need to fall back on original

View File

@ -38,6 +38,9 @@ class Group extends DatabaseModel {
[ 'name', 'varchar', '32' ], [ 'name', 'varchar', '32' ],
[ 'permissions', 'text', '' ], [ 'permissions', 'text', '' ],
]; ];
public $searchFields = [
'name',
];
public $permissionMatrix = [ public $permissionMatrix = [
'adminAccess' => [ 'adminAccess' => [
'pretty' => 'Access Administrator Areas', 'pretty' => 'Access Administrator Areas',

View File

@ -46,6 +46,9 @@ class Log extends DatabaseModel {
[ 'source', 'varchar', '64' ], [ 'source', 'varchar', '64' ],
[ 'action', 'text', '' ], [ 'action', 'text', '' ],
]; ];
public $searchFields = [
'source',
];
/** /**
* The model constructor. * The model constructor.

View File

@ -24,6 +24,9 @@ class Routes extends DatabaseModel {
[ 'original_url', 'varchar', '32' ], [ 'original_url', 'varchar', '32' ],
[ 'forwarded_url', 'text', '' ], [ 'forwarded_url', 'text', '' ],
]; ];
public $searchFields = [
'nickname',
];
public $resourceMatrix = [ public $resourceMatrix = [
[ [
'original_url' => 'fb', 'original_url' => 'fb',

View File

@ -36,6 +36,9 @@ class Sessions extends DatabaseModel {
[ 'username', 'varchar', '20' ], [ 'username', 'varchar', '20' ],
[ 'token', 'varchar', '120' ], [ 'token', 'varchar', '120' ],
]; ];
public $searchFields = [
'username',
];
public static $activeSession = false; public static $activeSession = false;
/** /**

View File

@ -31,6 +31,10 @@ class Token extends DatabaseModel {
[ 'createdBy', 'int', '10' ], [ 'createdBy', 'int', '10' ],
[ 'expiresAt', 'int', '10' ], [ 'expiresAt', 'int', '10' ],
]; ];
public $searchFields = [
'name',
'token',
];
public $permissionMatrix = [ public $permissionMatrix = [
'addAppToken' => [ 'addAppToken' => [
'pretty' => 'Add Application Tokens', 'pretty' => 'Add Application Tokens',

View File

@ -44,6 +44,9 @@ class User extends DatabaseModel {
[ 'confirmationCode', 'varchar', '80' ], [ 'confirmationCode', 'varchar', '80' ],
[ 'prefs', 'text', '' ], [ 'prefs', 'text', '' ],
]; ];
public $searchFields = [
'username',
];
public $permissionMatrix = [ public $permissionMatrix = [
'uploadImages' => [ 'uploadImages' => [
'pretty' => 'Upload images (such as avatars)', 'pretty' => 'Upload images (such as avatars)',

View File

@ -1,7 +1,14 @@
<div class="col-8 mx-auto p-4 rounded shadow-sm context-main-bg my-4"> <div class="col-8 mx-auto p-4 rounded shadow-sm context-main-bg my-4">
<h2 class="text-center mb-4">About {SITENAME}</h2> <h2 class="text-center mb-4">About {SITENAME}</h2>
<p class="lead"> <p class="lead">
{SITENAME} was built out of a need to create and manage my own web applications. {SITENAME} was built out of a need to create and manage web applications.
At the time, I had used wordpress but I didn't want or even need any of the blog functionality.
No matter what plugins you add, no matter how you customize layout, wordpress is still a blog at its core.
There is nothing inherently wrong with a blog, but when you start from a blog, everything is a post, or a plugin.
Under the hood, wordpress is going to run how wordpress wants, as a web interface for accessing text records.
</p>
<p>
The Tempus Project was always intended to be a web application, not a blog.
</p> </p>
<p class="text-muted"> <p class="text-muted">
Right now, this entire system was built and managed by myself. As stated, I have used my own version of this for years, but translating it to a publicly available product is not a 1-to-1 job. There may be bugs or issues encountered while you use the product. I can't guarantee a fix for every need in every case immediately, but I do actively keep track of bugs and work hard to ensure everyone has a great experience using the app. Right now, this entire system was built and managed by myself. As stated, I have used my own version of this for years, but translating it to a publicly available product is not a 1-to-1 job. There may be bugs or issues encountered while you use the product. I can't guarantee a fix for every need in every case immediately, but I do actively keep track of bugs and work hard to ensure everyone has a great experience using the app.

View File

@ -19,3 +19,27 @@
</div> </div>
</div> </div>
</div> </div>
<legend class="text-center my-2">Results</legend>
<form method="post">
<fieldset>
<!-- Search -->
<div class="mb-3 row">
<label for="searchTerm" class="col-lg-6 col-form-label text-end">Search:</label>
<div class="col-lg-2">
<input type="text" class="form-control" name="searchTerm" id="searchTerm">
</div>
</div>
<!-- Hidden Token -->
<input type="hidden" name="token" value="{TOKEN}">
<!-- Submit Button -->
<div class="text-center">
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg">Search</button>
</div>
</fieldset>
</form>
<div class="col-5 offset-1">
{searchResults}
</div>