Skip to content

Commit 0a24f5c

Browse files
EnricoFerrotechknowlogick
EnricoFerro
authored andcommitted
Disable 'May Import Local Repository' when is disabled by setting (Issue #4779) (#4780)
1 parent 194a11e commit 0a24f5c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

modules/templates/helper.go

+3
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ func NewFuncMap() []template.FuncMap {
165165
"DisableGitHooks": func() bool {
166166
return setting.DisableGitHooks
167167
},
168+
"DisableImportLocal": func() bool {
169+
return !setting.ImportLocalPaths
170+
},
168171
"TrN": TrN,
169172
"Dict": func(values ...interface{}) (map[string]interface{}, error) {
170173
if len(values)%2 != 0 {

templates/admin/user/edit.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<div class="inline field">
9393
<div class="ui checkbox">
9494
<label><strong>{{.i18n.Tr "admin.users.allow_import_local"}}</strong></label>
95-
<input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}}>
95+
<input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if DisableImportLocal}}disabled{{end}}>
9696
</div>
9797
</div>
9898
{{if not .DisableRegularOrgCreation}}

0 commit comments

Comments
 (0)