Exemple #1
0
function verify($name, $password, $remember)
{
    $t = new twitter($name, $password, user_type());
    $user = $t->veverify();
    if (!isset($user->error) && isset($user->name)) {
        $time = $remember ? time() + 3600 * 24 * 365 : 0;
        setEncryptCookie('twitterID', $name, $time, '/');
        setEncryptCookie('twitterPW', $password, $time, '/');
        setcookie('friends_count', $user->friends_count, $time, '/');
        setcookie('statuses_count', $user->statuses_count, $time, '/');
        setcookie('followers_count', $user->followers_count, $time, '/');
        setcookie('imgurl', $user->profile_image_url, $time, '/');
        setcookie('name', $user->name, $time, '/');
        $twDM = $t->directMessages(false, false, 1);
        if ($twDM === false) {
        } else {
            if (count($twDM) == 0) {
            } else {
                setCookie("meSinceId", $twDM[0]->id);
            }
        }
        return true;
    } else {
        return false;
    }
}