mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bug/usernames-can-be-capital' into 'dev'
Fix username case See merge request crafty-controller/crafty-4!351
This commit is contained in:
commit
93e8d8a51d
@ -338,7 +338,7 @@ class CreateUser(ApiHandler):
|
||||
self.access_denied(user)
|
||||
return
|
||||
|
||||
new_username = self.get_argument("username")
|
||||
new_username = self.get_argument("username").lower()
|
||||
new_pass = self.get_argument("password")
|
||||
|
||||
if new_username:
|
||||
|
@ -1774,7 +1774,7 @@ class PanelHandler(BaseHandler):
|
||||
"system user is not editable"
|
||||
)
|
||||
user_id = bleach.clean(self.get_argument("id", None))
|
||||
username = bleach.clean(self.get_argument("username", None))
|
||||
username = bleach.clean(self.get_argument("username", None).lower())
|
||||
password0 = bleach.clean(self.get_argument("password0", None))
|
||||
password1 = bleach.clean(self.get_argument("password1", None))
|
||||
email = bleach.clean(self.get_argument("email", "default@example.com"))
|
||||
@ -1943,7 +1943,7 @@ class PanelHandler(BaseHandler):
|
||||
self.finish()
|
||||
|
||||
elif page == "add_user":
|
||||
username = bleach.clean(self.get_argument("username", None))
|
||||
username = bleach.clean(self.get_argument("username", None).lower())
|
||||
if username.lower() == "system":
|
||||
self.redirect(
|
||||
"/panel/error?error=Unauthorized access: "
|
||||
|
@ -95,6 +95,7 @@ class ApiUsersIndexHandler(BaseApiHandler):
|
||||
)
|
||||
|
||||
username = data["username"]
|
||||
username = str(username).lower()
|
||||
password = data["password"]
|
||||
email = data.get("email", "default@example.com")
|
||||
enabled = data.get("enabled", True)
|
||||
|
Loading…
Reference in New Issue
Block a user