Skip to content

Commit 06ba584

Browse files
committed
Added option to disable user import/export
1 parent 4eca39e commit 06ba584

File tree

7 files changed

+43
-6
lines changed

7 files changed

+43
-6
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,7 @@ HOME_FOOTER_LINK=""
114114
HIDE_VERIFICATION_CHECKMARK=false
115115

116116
ALLOW_CUSTOM_BACKGROUNDS=true
117+
118+
ALLOW_USER_EXPORT=true
119+
120+
ALLOW_USER_IMPORT=true

config/config-legends.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,16 @@
219219
"description": "Allow users to upload custom background images for their pages."
220220
},
221221

222+
{"value": "ALLOW_USER_IMPORT",
223+
"title": "Allow users to import profiles from other instances",
224+
"description": "Allows users to import their profile and links from an external file."
225+
},
226+
227+
{"value": "ALLOW_USER_EXPORT",
228+
"title": "Allow users to export their profile",
229+
"description": "Allows users to export their own links and profile."
230+
},
231+
222232
{"value": "HIDE_VERIFICATION_CHECKMARK",
223233
"title": "Hide verification checkmark",
224234
"description": "Hides verification badge displayed on admin and VIP pages."

resources/views/components/config/config.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ function text($key){
296296
{{toggle('ALLOW_CUSTOM_BACKGROUNDS')}}
297297

298298

299-
300299
<a name="Security"><h2 class="ch2">Security</h2></a>
301300

302301

@@ -309,6 +308,13 @@ function text($key){
309308
{{toggle('ENABLE_THEME_UPDATER')}}
310309

311310

311+
{{toggle('ALLOW_USER_EXPORT')}}
312+
313+
314+
{{toggle('ALLOW_USER_IMPORT')}}
315+
316+
317+
312318
<a name="Advanced"><h2 class="ch2">Advanced</h2></a>
313319

314320
{{toggle('JOIN_BETA')}}

resources/views/components/finishing.blade.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
if(EnvEditor::keyExists('ALLOW_CUSTOM_BACKGROUNDS')){ /* Do nothing if key already exists */
4040
} else {EnvEditor::addKey('ALLOW_CUSTOM_BACKGROUNDS', 'true');}
4141
42+
if(EnvEditor::keyExists('ALLOW_USER_IMPORT')){ /* Do nothing if key already exists */
43+
} else {EnvEditor::addKey('ALLOW_USER_IMPORT', 'true');}
44+
45+
if(EnvEditor::keyExists('ALLOW_USER_EXPORT')){ /* Do nothing if key already exists */
46+
} else {EnvEditor::addKey('ALLOW_USER_EXPORT', 'true');}
47+
4248
4349
// Footer page customization
4450
if(EnvEditor::keyExists('DISPLAY_FOOTER_HOME')){} else {EnvEditor::addKey('DISPLAY_FOOTER_HOME', 'true');}

resources/views/studio/profile.blade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@
3232
</form>
3333
@endif
3434

35+
@if(env('ALLOW_USER_EXPORT') != false)
3536
<br><br><br>
36-
3737
<div class="form-group col-lg-8">
3838
<h4>Export user data</h4>
3939
<label>Export your user data to transfer to a different instance.</label>
4040
<div class="row">
4141
<button class="mt-3 ml-3 btn btn-outline-secondary"><a href="{{ route('exportAll') }}" style="color:#fff;"><i class="bi bi-layer-backward"></i> Export all data</a></button>
4242
<button class="mt-3 ml-3 btn btn-outline-secondary"><a href="{{ route('exportLinks') }}" style="color:#fff;"><i class="bi bi-layer-backward"></i> Export links only</a></button>
4343
</div></div>
44+
@endif
4445

46+
@if(env('ALLOW_USER_IMPORT') != false)
4547
<form action="{{ route('importData') }}" enctype="multipart/form-data" method="post">
4648
@csrf
4749
<div class="form-group col-lg-8"><br><br><br>
@@ -52,6 +54,7 @@
5254

5355
<button type="submit" class="mt-3 ml-3 btn btn-info" onclick="return confirm('Are you sure you want to import this file? This action will replace all your current data, including links!')">Import</button>
5456
</form>
57+
@endif
5558

5659
<br>
5760

routes/web.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,13 @@
123123
Route::get('/clearIcon/{id}', [UserController::class, 'clearIcon'])->name('clearIcon');
124124
Route::get('/studio/page/delprofilepicture', [UserController::class, 'delProfilePicture'])->name('delProfilePicture');
125125
Route::get('/studio/delete-user/{id}', [UserController::class, 'deleteUser'])->name('deleteUser')->middleware('verified');
126-
Route::get('/export-links', [UserController::class, 'exportLinks'])->name('exportLinks');
127-
Route::get('/export-all', [UserController::class, 'exportAll'])->name('exportAll');
128-
Route::post('/import-data', [UserController::class, 'importData'])->name('importData');
126+
if(env('ALLOW_USER_EXPORT') != false){
127+
Route::get('/export-links', [UserController::class, 'exportLinks'])->name('exportLinks');
128+
Route::get('/export-all', [UserController::class, 'exportAll'])->name('exportAll');
129+
}
130+
if(env('ALLOW_USER_IMPORT') != false){
131+
Route::post('/import-data', [UserController::class, 'importData'])->name('importData');
132+
}
129133
Route::get('/studio/linkparamform_part/{typeid}/{linkid}', [LinkTypeViewController::class, 'getParamForm'])->name('linkparamform.part');
130134
});
131135

storage/backups/default_settings

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,8 @@ HOME_FOOTER_LINK=""
113113

114114
HIDE_VERIFICATION_CHECKMARK=false
115115

116-
ALLOW_CUSTOM_BACKGROUNDS=true
116+
ALLOW_CUSTOM_BACKGROUNDS=true
117+
118+
ALLOW_USER_EXPORT=true
119+
120+
ALLOW_USER_IMPORT=true

0 commit comments

Comments
 (0)