Reserved Usernames on Signup
This commit is contained in:
parent
36ba8c5c4d
commit
75c9e22b19
|
@ -60,6 +60,15 @@ const (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
UsernameRegexp = regexp.MustCompile(`^[a-z0-9_-]{3,32}$`)
|
UsernameRegexp = regexp.MustCompile(`^[a-z0-9_-]{3,32}$`)
|
||||||
|
ReservedUsernames = []string{
|
||||||
|
"admin",
|
||||||
|
"admins",
|
||||||
|
"administrator",
|
||||||
|
"moderator",
|
||||||
|
"support",
|
||||||
|
"staff",
|
||||||
|
"nonshy",
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Photo Galleries
|
// Photo Galleries
|
||||||
|
|
|
@ -86,6 +86,15 @@ func Signup() http.HandlerFunc {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reserved username check.
|
||||||
|
for _, cmp := range config.ReservedUsernames {
|
||||||
|
if username == cmp {
|
||||||
|
session.FlashError(w, r, "That username is reserved, please choose a different username.")
|
||||||
|
templates.Redirect(w, r.URL.Path+"?token="+tokenStr)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cache username in case of passwd validation errors.
|
// Cache username in case of passwd validation errors.
|
||||||
vars["Email"] = email
|
vars["Email"] = email
|
||||||
vars["Username"] = username
|
vars["Username"] = username
|
||||||
|
|
|
@ -230,7 +230,8 @@
|
||||||
</label>
|
</label>
|
||||||
<p class="help">
|
<p class="help">
|
||||||
Check this box if you are OK seeing explicit content on this site, which may
|
Check this box if you are OK seeing explicit content on this site, which may
|
||||||
include erections or sexually charged content.
|
include erections or sexually charged content. These may appear on the Site
|
||||||
|
Gallery as well as user profile pages.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user