mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
config: Add user websites as choices for homepage config.
Closes: #1981 Closes also most of threads in !1952. Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
f527d9af83
commit
337e8c28dd
8 files changed
+323
-32
No files matched your search
@@ -58,6 +58,24 @@ def user_group_view(func, group_name):
|
||||
return func
|
||||
|
||||
|
||||
def is_valid_user_name(user_name):
|
||||
"""Check if the given username is valid.
|
||||
|
||||
Note: Debian is VERY flexible with user names.
|
||||
"""
|
||||
if 32 < len(user_name):
|
||||
return False
|
||||
|
||||
if user_name.startswith('-'):
|
||||
return False
|
||||
|
||||
for forbidden in (' \n\t/\\:'):
|
||||
if forbidden in user_name:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def is_user_admin(request, cached=False):
|
||||
"""Return whether user is an administrator."""
|
||||
if not request.user.is_authenticated:
|
||||
|
||||
Reference in new issue
Block a user