echo '<strong style="color: red;">Invalid auth response: </strong>' . $reason . ".<br>\n"; } else { // REF $goTo = '/'; if (!empty($_GET['ref'])) { $goTo = strip_tags(addslashes($_GET['ref'])); } elseif (!empty($_SERVER['HTTP_REFERER'])) { $goTo = strip_tags(addslashes($_SERVER['HTTP_REFERER'])); } switch ($response['auth']['provider']) { case 'Twitter': $user = new User(); $_idU = $user->isRegistered($response['auth']['uid']); if ($_idU) { $user->getFromId($_idU); if ($user->isActive()) { $item['name'] = $response['auth']['info']['name']; $item['active'] = 1; $item['last_login'] = time(); // Login data $item['uid'] = $response['auth']['uid']; $item['token'] = $response['auth']['credentials']['token']; $item['secret'] = $response['auth']['credentials']['secret']; $item['signature'] = $response['signature']; //Profile data $item['account'] = $response['auth']['info']['nickname']; if (isset($response['auth']['info']['description'])) { $item['biography'] = $response['auth']['info']['description']; } if (isset($response['auth']['info']['location'])) { $item['location'] = $response['auth']['info']['location'];