summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Staff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-02-16 10:50:07 +0100
committerYorhel <git@yorhel.nl>2020-02-16 10:50:07 +0100
commite78fbb59474eed16b3fdb643cf5cdef1a29a86b7 (patch)
treecc1e2d85c6d74abe4906a2fbfbd14dda3b49c194 /lib/VNWeb/Staff
parente28febd462b67bff2baaf9bb05edf999a5912cd9 (diff)
Staff::Edit: Disallow name=original in aliases
Diffstat (limited to 'lib/VNWeb/Staff')
-rw-r--r--lib/VNWeb/Staff/Edit.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/VNWeb/Staff/Edit.pm b/lib/VNWeb/Staff/Edit.pm
index deb5e7fc..227da7f2 100644
--- a/lib/VNWeb/Staff/Edit.pm
+++ b/lib/VNWeb/Staff/Edit.pm
@@ -79,6 +79,7 @@ elm_api StaffEdit => $FORM_OUT, $FORM_IN, sub {
# The form validation only checks for duplicate aid's, but the name+original should also be unique.
my %names;
die "Duplicate aliases" if grep $names{"$_->{name}\x00$_->{original}"}++, $data->{alias}->@*;
+ die "Original = name" if grep $_->{name} eq $_->{original}, $data->{alias}->@*;
# For positive alias IDs: Make sure they exist and are owned by this entry.
validate_dbid