fetch_assoc();
if ($user == null)
header('Location: articles.php');
$view = '
' . $user['username'] . '
';
// TODO: Allow user to update profile picture.
//
//
' . update_profile_picture_form() . '
if ((isset($_COOKIE['user_id']) && $_COOKIE['user_id'] == $user_id) || (isset($_COOKIE['role_id']) && $_COOKIE['role_id'] <= 2)) {
$view .= '
User Actions
' . reset_pw_form() . '
' . update_email_form() . '
' . update_username_form() . '
' . request_role_change_form() . '
' . delete_account_form() . '
';
} else {
$ids = articles_ids_by_author($_GET['user_id']);
$view .= '
';
foreach ($ids as $id)
$view .= article_card($id);
$view .= '
';
}
return $view;
}