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' ] === ' ' )
1
2
<!DOCTYPE html>
2
3
@include (' layouts.lang' )
3
4
<head >
92
93
<h1 style =" font-size : 300% ;" ><i class =" fa-solid fa-screwdriver-wrench" ></i > Maintenance Mode <i class =" fa-solid fa-screwdriver-wrench" ></i ></h1 >
93
94
<h2 >We are performing scheduled site maintenance at this time.</h2 >
94
95
<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
95
100
</div >
96
101
97
102
</div >
98
103
</div >
99
104
</div >
100
105
</body >
101
106
</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 192
192
193
193
@include (' components.finishing' )
194
194
195
- <?php if ( file_exists ( base_path ( " storage/MAINTENANCE " ))){ unlink ( base_path ( " storage/MAINTENANCE " ));} ? >
195
+ <?php EnvEditor :: editKey ( ' MAINTENANCE_MODE ' , false ); ? >
196
196
<?php
197
197
if ($debug === true ){
198
198
if (EnvEditor:: keyExists (' APP_DEBUG' )){EnvEditor:: editKey (' APP_DEBUG' , ' false' );}
234
234
@if ($_SERVER [' QUERY_STRING' ] === ' error' )
235
235
<?php // on error ? >
236
236
237
- <?php if ( file_exists ( base_path ( " storage/MAINTENANCE " ))){ unlink ( base_path ( " storage/MAINTENANCE " ));} ? >
237
+ <?php EnvEditor :: editKey ( ' MAINTENANCE_MODE ' , false ); ? >
238
238
239
239
<div class =" logo-container fadein" >
240
240
<img class =" logo-img" src =" {{ asset (' assets/linkstack/images/logo.svg' ) } }" alt =" Logo" >
Original file line number Diff line number Diff line change 51
51
}else {
52
52
53
53
// 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 ' ){
55
55
56
56
//Changes the homepage to a LinkStack profile if set in the config
57
57
if (config ('advanced-config.custom_home_url ' ) != '' ) {
195
195
// Check if new version is available
196
196
if ($ updater ->source ()->isNewVersionAvailable () and (file_exists (base_path ("backups/CANUPDATE " )) or env ('SKIP_UPDATE_BACKUP ' ) == true )) {
197
197
198
- $ tst = base_path ('storage/ ' );
199
- file_put_contents ($ tst .'MAINTENANCE ' , '' );
198
+ EnvEditor::editKey ('MAINTENANCE_MODE ' , true );
200
199
201
200
// Get the current installed version
202
201
echo $ updater ->source ()->getVersionInstalled ();
You can’t perform that action at this time.
0 commit comments