Minor improvements (#1398)

* Minor improvements

* Update viewtopic.php

* Update functions.php

* Update functions.php

* Update usercp_register.tpl

* Update register.php

* Update register.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-02-10 22:22:26 +07:00 committed by GitHub
commit 7c703164d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 26 deletions

View file

@ -159,10 +159,12 @@ if ($submit) {
// Валидация данных
$cur_pass_valid = $adm_edit;
$can_edit_tpl = [];
foreach ($profile_fields as $field => $can_edit) {
// Проверка на возможность редактирования
if ((bool)$can_edit === false) {
$can_edit = (bool)$can_edit;
$can_edit_tpl['CAN_EDIT_' . strtoupper($field)] = $can_edit;
if ($can_edit === false) {
// TODO: При continue; не устанавливаются переменные ($tp_data) шаблона прописанные в case
// continue;
}
@ -195,7 +197,6 @@ foreach ($profile_fields as $field => $can_edit) {
$db_data['username'] = $username;
}
}
$tp_data['CAN_EDIT_USERNAME'] = $can_edit;
$tp_data['USERNAME'] = $pr_data['username'];
break;
@ -669,6 +670,7 @@ if ($submit && !$errors) {
}
}
$template->assign_vars($can_edit_tpl);
$template->assign_vars($tp_data);
$template->assign_vars([