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\Contact as ContactPlugin;
use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Input;
class Home extends AdminController {
public static $user;
@ -77,6 +78,11 @@ class Home extends AdminController {
$users = Views::simpleView( 'admin.dashboard.users', self::$user->recent( 5 ) );
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' );
}
}

View File

@ -104,6 +104,10 @@ class Usercp extends Controller {
$userPrefs = App::$activePrefs;
if ( Input::exists( 'submit' ) ) {
$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 );
Issues::add( 'success', 'Your preferences have been updated.' );
// if the image upload fails, need to fall back on original