Added option to disable theme updater in config

This commit is contained in:
Julian Prieber 2022-09-13 19:44:47 +02:00
parent c589a3adad
commit 874e8c94eb
4 changed files with 16 additions and 3 deletions

4
.env
View File

@ -85,3 +85,7 @@ FORCE_HTTPS=false
#=Defines wether or not themes are allowed to inject custom code.
#=Themes V2 can now implement fully custom code which you might want to disable for security reasons.
ALLOW_CUSTOM_CODE_IN_THEMES=true
#ENABLE_THEME_UPDATER=Determines if the theme updater should be enabled or not, default is true.
#=ENABLE_THEME_UPDATER either true or false.
ENABLE_THEME_UPDATER=true

View File

@ -16,6 +16,9 @@
if(EnvEditor::keyExists('ALLOW_CUSTOM_CODE_IN_THEMES')){ /* Do nothing if key already exists */
} else {EnvEditor::addKey('ALLOW_CUSTOM_CODE_IN_THEMES', 'true');}
if(EnvEditor::keyExists('ENABLE_THEME_UPDATER')){ /* Do nothing if key already exists */
} else {EnvEditor::addKey('ENABLE_THEME_UPDATER', 'true');}
if (!config()->has('advanced-config.expand_panel_admin_menu_permanently') and !config()->has('disable_default_password_notice')) {
function getStringBetween($string, $start, $end) {

View File

@ -38,7 +38,7 @@
</details>
@if(auth()->user()->role == 'admin')
@if(env('ENABLE_THEME_UPDATER') == 'true')
<style>
details {
width: 65%;
@ -204,6 +204,8 @@ table, th, td {
@if($GLOBALS['updateAv'] == true)<img style="padding-left:40px; padding-top:15px; scale: 1.5;" src="https://img.shields.io/static/v1?label=&message=A theme needs updating&color=brightgreen">@endif
@endif
<br><br><br>
<form action="{{ route('editTheme') }}" enctype="multipart/form-data" method="post">
@csrf

View File

@ -85,3 +85,7 @@ FORCE_HTTPS=false
#=Defines wether or not themes are allowed to inject custom code.
#=Themes V2 can now implement fully custom code which you might want to disable for security reasons.
ALLOW_CUSTOM_CODE_IN_THEMES=true
#ENABLE_THEME_UPDATER=Determines if the theme updater should be enabled or not, default is true.
#=ENABLE_THEME_UPDATER either true or false.
ENABLE_THEME_UPDATER=true