<?
include('db.php');
if (!is_numeric($_GET['id'])) {
exit();
}
$id = (int) $_GET['id'];
$result = dbRow("SELECT * FROM users WHERE record_num = '$id'");
if (is_array($result)) {
createUserSession($result);
header("Location: $basehttp/my-profile");
exit();
} else {
setMessage('User not found, or cannot takeover this account', 'error');
header("Location: $basehttp/admin/users.php");
exit();
}
?>