Check if current user is signed in.
541126
protected function store_is_logged_in() {
		$this->init();
		if ($this->user_data === null)
			$this->adm_status();
		return $this->user_data;
	}
66660
protected function isUserSuspended()
    {
        //  Check if this user is suspended
        if (isLoggedIn() && activeUser('is_suspended')) {

            //  Load models and langs
            $oAuthModel = Factory::model('Auth', 'nails/module-auth');
            $this->lang->load('auth/auth');

            //  Log the user out
            $oAuthModel->logout();

            //  Create a new session
            $oSession = Factory::service('Session', 'nails/module-auth');
            $oSession->sess_create();

            //  Give them feedback
            $oSession->setFlashData('error', lang('auth_login_fail_suspended'));
            redirect('/');
        }
    }
856405
def get_current_user(self, **params):
        """"""
        response = self._get('v2', 'user', params=params)
        return self._make_api_object(response, CurrentUser)
1154438
private String isLoggedIn() throws RuntimeException {
        if(this.getUser() != null && this.getUser().getAuthToken() != null){
            return "CUSTOM " + this.getUser().getAuthToken();
        } else {
            throw new RuntimeException("User state error.");
        }
    }
812773
public boolean isCurrent() {
        BaasUser current = current();
        if (current == null) return false;
        Logger.debug("Current username is %s and mine is %s", current.username, username);
        return current.username.equals(username);
    }
161839
public static function is_loggedin() {
	if (self::is_active() == false) {
		return false;
	}
	if (self::get_user_id() == false) {
		return false;
	}
	
	return true;
}
293642
def is_user_already_locked(username):
    """"""
    if username is None:
        return False
    if config.DISABLE_USERNAME_LOCKOUT:
        return False
    return REDIS_SERVER.get(get_username_blocked_cache_key(username))
83274
function updateSigninStatus(isSignedIn) {

        if (isSignedIn) {
            //$("#signInButton").hide();

            var user = gapi.auth2.getAuthInstance().currentUser.get();
            var profile = user.getBasicProfile();
            var username = profile.getName();
            $("#switchUserLink").html("Logged in as: " + username);

        }

    }
524168
def user_exists(username):
    """"""
    try:
        pwd.getpwnam(username)
        user_exists = True
    except KeyError:
        user_exists = False
    return user_exists
1115340
def get_signed_in_scope
      if signed_in?
        Devise.mappings.keys.each do |res|
          l = send "#{res.to_s}_signed_in?"
          if send "#{res.to_s}_signed_in?"
            return res.to_s
          end
        end
      end
      return 'user'
    end
267854
def _current_user_manager(self, session=None):
        """"""
        if session is None:
            session = db.session()

        try:
            user = g.user
        except Exception:
            return session.query(User).get(0)

        if sa.orm.object_session(user) is not session:
            # this can happen when called from a celery task during development
            # (with CELERY_ALWAYS_EAGER=True): the task SA session is not
            # app.db.session, and we should not attach this object to
            # the other session, because it can make weird, hard-to-debug
            # errors related to session.identity_map.
            return session.query(User).get(user.id)
        else:
            return user
1224869
def check_user(user, password):
    """"""
    return ((user == attowiki.user or attowiki.user is None) and
            (password == attowiki.password or attowiki.password is None))
100285
def authenticated?(password)
      if password_object == password
        update_hash!(password) if password_object.stale?
        return true
      end

      return false
    end
1039429
def user_has_access(self, user):
        
        if ROLE_ADMIN in user.roles:
            return True

        # Non-admin users should only see active accounts
        if self.enabled:
            if not self.required_roles:
                return True

            for role in self.required_roles:
                if role in user.roles:
                    return True

        return False
287072
def verify(user, password):
    """"""
    def verify_user(user_name, user_password):
        if user_name == user and user_password == password:
            return user_name
        return False
    return verify_user
220084
function checknick(next) {
        if (args.nick) {
          userent.list$({ nick: args.nick }, function(err, users) {
            if (err) return done(err, { ok: false, user: user })
            for (var i = 0; i < users.length; i++) {
              var each = users[i]
              if (each.id !== user.id) {
                return done(null, {
                  ok: false,
                  why: 'nick-exists',
                  nick: args.nick
                })
              }
            }

            next()
          })
          return
        }
        next()
      }
685945
protected function check_tracked_user() {
        if (isset($_SESSION['USER']->id) && $_SESSION['USER']->id !== null) {
            // Get the id of the current user.
            $new = $_SESSION['USER']->id;
        } else {
            // No user set up yet.
            $new = 0;
        }
        if ($new !== self::$loadeduserid) {
            // The current user doesn't match the tracked userid for this request.
            if (!is_null(self::$loadeduserid)) {
                // Purge the data we have for the old user.
                // This way we don't bloat the session.
                $this->purge();
            }
            self::$loadeduserid = $new;
            $this->currentuserid = $new;
        } else if ($new !== $this->currentuserid) {
            // The current user matches the loaded user but not the user last used by this cache.
            $this->purge_current_user();
            $this->currentuserid = $new;
        }
    }