Passwortänderungsfunktionen fürs User hinzugefügt
This commit is contained in:
parent
c6ab33857e
commit
66b71208c6
@ -291,8 +291,22 @@ def homepage():
|
|||||||
new_pw_input = ui.input(password=True)
|
new_pw_input = ui.input(password=True)
|
||||||
ui.label("Neues Passwort bestätigen:")
|
ui.label("Neues Passwort bestätigen:")
|
||||||
new_pw_confirm_input = ui.input(password=True)
|
new_pw_confirm_input = ui.input(password=True)
|
||||||
ui.button("Speichern")
|
def revert_pw_inputs():
|
||||||
ui.button("Zurücksetzen")
|
old_pw_input.value = ""
|
||||||
|
new_pw_input.value = ""
|
||||||
|
new_pw_confirm_input.value = ""
|
||||||
|
def save_new_password():
|
||||||
|
if hash_password(old_pw_input.value) == current_user.password:
|
||||||
|
if new_pw_input.value == new_pw_confirm_input.value:
|
||||||
|
current_user.password = hash_password(new_pw_input.value)
|
||||||
|
current_user.write_settings()
|
||||||
|
ui.notify("Neues Passwort gespeichert")
|
||||||
|
else:
|
||||||
|
ui.notify("Passwortbestätigung stimmt nicht überein")
|
||||||
|
else:
|
||||||
|
ui.notify("Altes Passwort nicht korrekt")
|
||||||
|
ui.button("Speichern", on_click=save_new_password)
|
||||||
|
ui.button("Zurücksetzen", on_click=revert_pw_inputs)
|
||||||
ui.space()
|
ui.space()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user