File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1+ @if ($_SERVER [' QUERY_STRING' ] === ' ' )
12<!DOCTYPE html>
23@include (' layouts.lang' )
34<head >
9293 <h1 style =" font-size : 300% ;" ><i class =" fa-solid fa-screwdriver-wrench" ></i > Maintenance Mode <i class =" fa-solid fa-screwdriver-wrench" ></i ></h1 >
9394 <h2 >We are performing scheduled site maintenance at this time.</h2 >
9495 <h3 >Please check back with us later.</h3 >
96+ @if (auth ()-> user ()-> role == ' admin' )
97+ <br ><center ><i >Admin options:</i ></center >
98+ <a href =" {{ url (' dashboard' )} }" >Dashboard</a > | <a href =" {{ url (' ?maintenance=off' )} }" onclick =" return confirm('You are about to disable Maintenance Mode. Are you sure?');" >Turn off</a >
99+ @endif
95100 </div >
96101
97102 </div >
98103 </div >
99104 </div >
100105</body >
101106</html >
107+ @elseif ($_SERVER [' QUERY_STRING' ] === ' maintenance=off' )
108+ @php
109+ EnvEditor:: editKey (' MAINTENANCE_MODE' , false );
110+ ob_clean ();
111+ header (" Location: " . url (' dashboard' ));
112+ exit ;
113+ @endphp
114+ @endif
Original file line number Diff line number Diff line change 192192
193193 @include (' components.finishing' )
194194
195- <?php if ( file_exists ( base_path ( " storage/MAINTENANCE " ))){ unlink ( base_path ( " storage/MAINTENANCE " ));} ? >
195+ <?php EnvEditor :: editKey ( ' MAINTENANCE_MODE ' , false ); ? >
196196<?php
197197if ($debug === true ){
198198 if (EnvEditor:: keyExists (' APP_DEBUG' )){EnvEditor:: editKey (' APP_DEBUG' , ' false' );}
234234@if ($_SERVER [' QUERY_STRING' ] === ' error' )
235235 <?php // on error ? >
236236
237- <?php if ( file_exists ( base_path ( " storage/MAINTENANCE " ))){ unlink ( base_path ( " storage/MAINTENANCE " ));} ? >
237+ <?php EnvEditor :: editKey ( ' MAINTENANCE_MODE ' , false ); ? >
238238
239239 <div class =" logo-container fadein" >
240240<img class =" logo-img" src =" {{ asset (' assets/linkstack/images/logo.svg' ) } }" alt =" Logo" >
Original file line number Diff line number Diff line change 5151}else {
5252
5353// Disables routes if in Maintenance Mode
54- if (env ('MAINTENANCE_MODE ' ) != 'true ' and ! file_exists ( base_path ( " storage/MAINTENANCE " )) ){
54+ if (env ('MAINTENANCE_MODE ' ) != 'true ' ){
5555
5656//Changes the homepage to a LinkStack profile if set in the config
5757if (config ('advanced-config.custom_home_url ' ) != '' ) {
195195 // Check if new version is available
196196 if ($ updater ->source ()->isNewVersionAvailable () and (file_exists (base_path ("backups/CANUPDATE " )) or env ('SKIP_UPDATE_BACKUP ' ) == true )) {
197197
198- $ tst = base_path ('storage/ ' );
199- file_put_contents ($ tst .'MAINTENANCE ' , '' );
198+ EnvEditor::editKey ('MAINTENANCE_MODE ' , true );
200199
201200 // Get the current installed version
202201 echo $ updater ->source ()->getVersionInstalled ();
You can’t perform that action at this time.
0 commit comments