You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
514 B

<?php
$user = null;
if ($valid_cookie) {
$sm = $db->prepare('SELECT id_user FROM oauth_tokens WHERE cookie = ?');
$sm->execute([$cookie]);
if (($row = $sm->fetch()) !== false) {
if (isset($row['id_user'])) {
$sm = $db->prepare('SELECT * FROM users WHERE id = ?');
$sm->execute([$row['id_user']]);
if (($user = $sm->fetchObject()) !== false) {
switch ($user->account_type)
{
case 'mastodon':
$user->account_data = json_decode($user->account_data);
break;
}
}
}
}
}