mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Small refactoring for avatar.php [AJAX] (#611)
This commit is contained in:
parent
823b947ce6
commit
d68c37eacd
1 changed files with 4 additions and 1 deletions
|
@ -24,11 +24,14 @@ if (!IS_ADMIN && $user_id != $user->id) {
|
|||
$this->ajax_die($lang['NOT_ADMIN']);
|
||||
}
|
||||
|
||||
$new_ext_id = null;
|
||||
$response = '';
|
||||
|
||||
switch ($mode) {
|
||||
case 'delete':
|
||||
delete_avatar($user_id, $u_data['avatar_ext_id']);
|
||||
$new_ext_id = 0;
|
||||
$response = '<img src="' . $bb_cfg['avatars']['upload_path'] . $bb_cfg['avatars']['no_avatar'] . '" alt="' . $user_id . '" />';
|
||||
$response = get_avatar($user_id, $new_ext_id);
|
||||
break;
|
||||
default:
|
||||
$this->ajax_die('Invalid mode');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue