public static function login($email, $password, $onetime = '')
    {
        $oldId = false;
        if (isset($_SESSION['user']) && isset($_SESSION['user']['id'])) {
            $oldId = $_SESSION['user']['id'];
        };
        if (is_array($user = grab('authenticate', $email, $password, $onetime))) {
            if ($oldId !== $user['id']) {
                trigger(
                    'log',
                    array(
                        'userId'     => $user['id'],
                        'objectType' => 'user',
                        'objectId'   => $user['id'],
                        'action'     => 'login'
                    )
                );
                self::reset();
            };
            $_SESSION['user'] = $user;
            $_SESSION['identified'] = true;
            self::reloadOutbox();
            trigger('newuser');
            if (pass('can', 'login')) {
                return true;
            } else {
                self::reset();
                return false;
            };
        } else {
            return false;
        };
    }