What to do at reboot when there is a User Logged In

 @param logged_in_option[String] Any one of the Strings from USER_LOGGED_IN

 @return [void]
175250
def user_logged_in=(logged_in_option)
      raise JSS::InvalidDataError, "user_logged_in options: #{USER_LOGGED_IN.join(', ')}" unless USER_LOGGED_IN.include? logged_in_option
      @reboot_options[:user_logged_in] = logged_in_option
      @need_to_update = true
    end
1096816
def user_disable_login(attribs, dir_info)
      attribs = user_record_name_alternatives(attribs)

      check_critical_attribute( attribs, :record_name )
      attribs    = tidy_attribs(attribs)

      command = {attribute: 'disableuser', value: nil}
      params  = command.merge(attribs)
      # pwpolicy(params, dir_info)
      answer = pwpolicy(params, dir_info)
      attribs[:value] = nil
      return answer
    end
1044406
def login_required
      setup_client
      
      @user = ::TwitterOAuth::User.new(@client, session[:user]) if session[:user]
      
      @rate_limit_status = @client.rate_limit_status
      
      redirect '/login' unless user
    end
1299524
protected void handleLoginSuccess(USER_ENTITY userEntity, LoginSpecifiedOption option) {
        assertUserEntityRequired(userEntity);
        final USER_BEAN userBean = saveLoginInfoToSession(userEntity);
        if (userBean instanceof SyncCheckable) {
            ((SyncCheckable) userBean).manageLastestSyncCheckTime(timeManager.currentDateTime());
        }
        if (option.isRememberMe()) {
            saveRememberMeKeyToCookie(userEntity, userBean);
        }
        if (!option.isSilentLogin()) { // mainly here
            saveLoginHistory(userEntity, userBean, option);
            processOnBrightLogin(userEntity, userBean, option);
        } else {
            processOnSilentLogin(userEntity, userBean, option);
        }
    }
335586
protected void doLoginByGivenEntity(USER_ENTITY givenEntity, LoginSpecifiedOption option) {
        assertGivenEntityRequired(givenEntity);
        handleLoginSuccess(givenEntity, option);
    }
896920
function reboot(options = {}) {
    if (process.platform !== 'linux' &&
        process.platform !== 'darwin' &&
        process.platform !== 'win32') {
        throw new Error('Unknown or unsupported OS!');
    }

    let cmdarguments = ['shutdown'];

    cmdarguments.push('-r'); // reboot

    if (process.platform === 'linux' || process.platform === 'darwin') {
        if (options.sudo) {
            cmdarguments.unshift('sudo');
        }
    }

    if (process.platform === 'win32') {
        if (options.force) {
            cmdarguments.push('-f');
        }      
    }

    cmdarguments.push(setTimer(options.timerseconds));

    executeCmd(cmdarguments, options.debug, options.quitapp);
}
305117
function loginCallback(options) {
  return async function loginCallbackHandler(ctx) {
    let referer;
    // customize how to get redirect target
    if (options.getRedirectTarget) {
      referer = options.getRedirectTarget(ctx);
    }
    if (!referer) referer = ctx.session.userauthLoginReferer || options.rootPath;

    debug('loginReferer in session: %j', ctx.session.userauthLoginReferer);
    // cleanup the userauthLoginReferer on session
    ctx.session.userauthLoginReferer = undefined;
    let user = ctx.session[options.userField];
    if (user) {
      // already login
      return redirect(ctx, referer);
    }
    user = await options.getUser(ctx);
    if (!user) {
      return redirect(ctx, referer);
    }

    const res = await options.loginCallback(ctx, user);
    const loginUser = res[0];
    const redirectURL = res[1];
    ctx.session[options.userField] = loginUser;
    if (redirectURL) {
      referer = redirectURL;
    }
    redirect(ctx, referer);
  };
}
149341
function(options) {
      var storedUser = ((!this.isOAuth2Mode() && this.Storage.retrieve(this.loggedInUserKey)) || this.Storage.retrieve('oauth2.user'));
      //The logged in user's ID is saved in local storage until removed, so we need to check to make sure that the user has valid login credentials before returning the login ID.
      if ( options && options['success'] ){
        this.hasValidOAuth(options);
      } else {
        return (this.isLoggedIn(options) && storedUser) ? storedUser : null;
      }
    }
996233
def re_login?(e)
      auth_error =
        (e.response_code == 403 && e.message =~ %r(.*cookie is expired or invalid)) ||
        e.response_code == 401

      renewable_creds =
        (@instance_token || (@email && (@password || @password_base64)) || @refresh_token)

      auth_error && renewable_creds
    end
249414
def reboot_message=(message)
      raise JSS::InvalidDataError, 'Reboot message must be a String' unless message.is_a? String
      @reboot_options[:message] = message
      @need_to_update = true
    end
454053
def reload!(print = true)
      puts "Reloading..." if print
      Rails.application.reloader.reload!
      true
    end
424433
def login(email, password, opts = {})
      ensure_ready!
      opts = opts.merge(:email => email, :password => password)
      checked_response_body(connection.post('login', opts))
    end
78851
def turn_on(options = {})
      _check_server!
      return unless enabled?

      fail "Already active!" if active?

      _turn_on_notifiers(options)
      _env.notify_active = true
    end
687450
def confirm_login():
    '''
    
    '''
    session['_fresh'] = True
    session['_id'] = current_app.login_manager._session_identifier_generator()
    user_login_confirmed.send(current_app._get_current_object())
1121518
def toggle_save
      return if !verify_logged_in

      resp = Caboose::StdClass.new
      if SavedProperty.where(:user_id => logged_in_user.id, :mls => params[:mls]).exists?
        SavedProperty.where(:user_id => logged_in_user.id, :mls => params[:mls]).destroy_all
        resp.saved = false
      else
        p = SavedProperty.new
        p.user_id = logged_in_user.id
        p.mls = params[:mls]
        p.save
        resp.saved = true
      end

      render :json => resp
    end
315264
def set_session_current_user(user)
    self.current_user = user
    # Try to reuse existing sessions.
    if session[:authpwn_suid]
      token = Tokens::SessionUid.with_code(session[:authpwn_suid]).first
      if token
        if token.user == user
          token.touch
          return user
        else
          token.destroy
        end
      end
    end
    if user
      session[:authpwn_suid] = Tokens::SessionUid.random_for(user,
          request.remote_ip, request.user_agent || 'N/A').suid
    else
      session.delete :authpwn_suid
    end
  end
1273219
def load_session
      unless logged_in?
        session[Shibbolite.pid] = request.env[Shibbolite.pid.to_s]
        current_user.update(get_attributes) if registered_user?
      end
    end