$token = substr(sha1('$Random'.rand()), 0, 10);
if (!file_put_contents("profile/$found/.token", $token))
throw new Exception("could not store token for $found");
$token = substr(sha1('$Random'.rand()), 0, 10);
if (!file_put_contents("profile/$found/.token", $token))
throw new Exception("could not store token for $found");