Switches from session messages to feedback class ones

main
Yasen Pramatarov 2025-02-17 14:46:19 +02:00
parent c32bbd518b
commit 80bf3ee2ed
1 changed files with 4 additions and 4 deletions

View File

@ -43,9 +43,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$result = $userObject->removeAvatar($user_id, $config['avatars_path'].$userDetails[0]['avatar']);
if ($result === true) {
$_SESSION['notice'] .= "Avatar for user \"{$userDetails[0]['username']}\" is removed. ";
Feedback::flash('NOTICE', 'DEFAULT', "Avatar for user \"{$userDetails[0]['username']}\" is removed.");
} else {
$_SESSION['error'] .= "Removing the avatar failed. Error: $result ";
Feedback::flash('ERROR', 'DEFAULT', "Removing the avatar failed. Error: $result");
}
header("Location: $app_root?page=profile");
@ -84,9 +84,9 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
];
$result = $userObject->editUser($user_id, $updatedUser);
if ($result === true) {
$_SESSION['notice'] .= "User details for \"{$updatedUser['name']}\" are edited. ";
Feedback::flash('NOTICE', 'DEFAULT', "User details for \"{$updatedUser['name']}\" are edited.");
} else {
$_SESSION['error'] .= "Editing the user details failed. Error: $result ";
Feedback::flash('ERROR', 'DEFAULT', "Editing the user details failed. Error: $result");
}
// update the rights