Implement admin ability to enable/disable users

This commit is contained in:
janost
2020-11-30 23:12:56 +01:00
parent 9824d94a1c
commit 043aa27aa3
13 changed files with 63 additions and 0 deletions

View File

@@ -102,6 +102,14 @@ fn _password_login(data: ConnectData, conn: DbConn, ip: &ClientIp) -> JsonResult
)
}
// Check if the user is disabled
if !user.enabled {
err!(
"This user has been disabled",
format!("IP: {}. Username: {}.", ip.ip, username)
)
}
let now = Local::now();
if user.verified_at.is_none() && CONFIG.mail_enabled() && CONFIG.signups_verify() {