mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-28 12:04:23 +00:00
Issue #26 Admin can change the name of initiator of the poll
This commit is contained in:
parent
924bd1ed1a
commit
6f7c911bae
5 changed files with 54 additions and 15 deletions
|
|
@ -63,7 +63,7 @@ if (!$poll) {
|
|||
|
||||
if (isset($_POST['update_poll_info'])) {
|
||||
$updated = false;
|
||||
$field = $inputService->filterAllowedValues($_POST['update_poll_info'], ['title', 'admin_mail', 'comment', 'rules', 'expiration_date']);
|
||||
$field = $inputService->filterAllowedValues($_POST['update_poll_info'], ['title', 'admin_mail', 'comment', 'rules', 'expiration_date', 'name']);
|
||||
|
||||
// Update the right poll field
|
||||
if ($field == 'title') {
|
||||
|
|
@ -110,6 +110,12 @@ if (isset($_POST['update_poll_info'])) {
|
|||
$poll->end_date = $expiration_date;
|
||||
$updated = true;
|
||||
}
|
||||
} elseif ($field == 'name') {
|
||||
$admin_name = filter_input(INPUT_POST, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => NAME_REGEX]]);
|
||||
if ($admin_name) {
|
||||
$poll->admin_name = $admin_name;
|
||||
$updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Update poll in database
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue