Merge branch 'main' into thetempusproject-com

This commit is contained in:
Joey Kimsey
2025-02-03 11:03:28 -05:00
27 changed files with 555 additions and 50 deletions

View File

@ -584,7 +584,7 @@ class TheTempusProject extends Bedrock {
$url = trim( Input::get( 'url' ), '/' );
$url = str_ireplace( '.php', '', $url );
}
$route = $routes->findByOriginalUrl($url);
$route = $routes->findByOriginalUrl( $url );
if (false !== $route) {
$route = $route;
if ('internal' === $route->redirect_type) {
@ -593,6 +593,26 @@ class TheTempusProject extends Bedrock {
Redirect::external($route->forwarded_url);
}
}
if ( 'home/login' !== $url ) {
if ( Config::getValue( 'maintenance/enabled' ) ) {
if ( ! self::$isLoggedIn ) {
Session::flash( 'notice', Config::getValue( 'maintenance/maintenanceMessage' ) );
Redirect::to( 'home/login' );
}
if ( self::$activeGroup->ID != 1 ) {
if ( empty( self::$activeGroup->perms['maintenanceAccess'] ) ) {
Session::flash( 'notice', Config::getValue( 'maintenance/maintenanceMessage' ) );
Redirect::to( 'home/login' );
}
}
}
} elseif ( Config::getValue( 'maintenance/enabled' ) ) {
if ( ! self::$isLoggedIn ) {
Issues::add( 'notice', Config::getValue( 'maintenance/maintenanceMessage' ) );
}
}
parent::load();
}