forked from Ruderverein-Donau-Linz/rowt
always use your own name for registrations; except if the user has the add_different_user permission
This commit is contained in:
parent
cde862f97f
commit
22dfd76467
@ -38,6 +38,14 @@ async fn register(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !user.add_different_user && user.name != register.name {
|
||||||
|
log::error!("{} tried to register a different person, even though the user has no add_different_user flag and thus it should not be possible to do so via UI -> manually crafted request?", user.name);
|
||||||
|
return Flash::error(
|
||||||
|
Redirect::to("/"),
|
||||||
|
"Don't (try to ;)) abuse this system! Incident has been reported...",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let user = user::Model::find_or_create_user(®ister.name, db.inner()).await;
|
let user = user::Model::find_or_create_user(®ister.name, db.inner()).await;
|
||||||
|
|
||||||
if let Some(cox_id) = register.cox_id {
|
if let Some(cox_id) = register.cox_id {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user