Merge pull request #8353 from MrPetovan/bug/8219-frio-fix-contact-csv-import

[frio] Enable file upload in settings form
pull/8367/head
Michael Vogel 2020-03-01 21:08:19 +01:00 committed by GitHub
commit 057df09ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -251,6 +251,8 @@ function settings_post(App $a)
unlink($_FILES['importcontact-filename']['tmp_name']); unlink($_FILES['importcontact-filename']['tmp_name']);
} }
} }
return;
} }
if (!empty($_POST['resend_relocate'])) { if (!empty($_POST['resend_relocate'])) {
@ -362,17 +364,17 @@ function settings_post(App $a)
if ($username != $a->user['username']) { if ($username != $a->user['username']) {
if (strlen($username) > 40) { if (strlen($username) > 40) {
$err .= DI::l10n()->t(' Please use a shorter name.'); $err .= DI::l10n()->t('Please use a shorter name.');
} }
if (strlen($username) < 3) { if (strlen($username) < 3) {
$err .= DI::l10n()->t(' Name too short.'); $err .= DI::l10n()->t('Name too short.');
} }
} }
if ($email != $a->user['email']) { if ($email != $a->user['email']) {
// check for the correct password // check for the correct password
if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) { if (!User::authenticate(intval(local_user()), $_POST['mpassword'])) {
$err .= DI::l10n()->t('Wrong Password') . EOL; $err .= DI::l10n()->t('Wrong Password.');
$email = $a->user['email']; $email = $a->user['email'];
} }
// check the email is valid // check the email is valid
@ -390,7 +392,7 @@ function settings_post(App $a)
} }
if (strlen($err)) { if (strlen($err)) {
notice($err . EOL); notice($err);
return; return;
} }

View File

@ -4,7 +4,7 @@
{{$nickname_block nofilter}} {{$nickname_block nofilter}}
<form action="settings" id="settings-form" method="post" autocomplete="off" > <form action="settings" id="settings-form" method="post" autocomplete="off" enctype="multipart/form-data">
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'> <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
{{* We organize the settings in collapsable panel-groups *}} {{* We organize the settings in collapsable panel-groups *}}