コード例 #1
0
    public void Login(Boolean pSkipLogin) {
      if(!pSkipLogin) {

        if(this.FLoginState != TBioLoginState.ssLoggedOn) {
          var vQLoginPrm = this.CurBioHandler.QParams.ParamByName(Utl.QLOGIN_PARNAME, true);
          if (vQLoginPrm != null) {
            this._chekLogin(vQLoginPrm.ValueAsString());
            this.FLoginState = TBioLoginState.ssLoggedOn;
            this._regConn(this.Cfg.CurUser.Login, TRemoteConnectionStatus.rcsOk);
          } else {
            var vHLoginPrm = this.CurBioHandler.QParams.ParamByName(Utl.HASHLOGIN_PARNAME, true);
            if (vHLoginPrm != null) {
              this._chekLogin(vHLoginPrm.ValueAsString());
              this.FLoginState = TBioLoginState.ssLoggedOn;
              this._regConn(this.Cfg.CurUser.Login, TRemoteConnectionStatus.rcsOk);
            }
          }
        }
        if(this.FLoginState != TBioLoginState.ssLoggedOn) {
          try {
            if(this.CurBioHandler.GetType() == typeof(tm_login_post))
              this.FLoginState = TBioLoginState.ssLogginIn;
            if(this.FLoginState != TBioLoginState.ssLogginIn) {
              this._regConn("mrnemo", TRemoteConnectionStatus.rcsTry);
              throw new EBioStart();
            }
            var rq = this.CurBioHandler.BioRequest<BioLoginRequest>();
            var vCurLogin = (rq != null) ? rq.login : null;
            if (vCurLogin == null) {
              this._regConn("mrnemo", TRemoteConnectionStatus.rcsTry);
              throw new EBioStart();
            }
            this._chekLogin(vCurLogin);

            if(this.FLoginState == TBioLoginState.ssLogginIn) {
              this._regConn(this.Cfg.CurUser.Login, TRemoteConnectionStatus.rcsOk);
              throw new EBioOk(this.Cfg.CurUser);
            }

          } catch(EBioError) {
            this.FLoginState = TBioLoginState.ssLoginError;
            throw;
          } catch(EBioStart) {
            this.FLoginState = TBioLoginState.ssLogginIn;
            this.FRqstURL = this.CurBioHandler.Context.Request.Path + "?" + this.CurBioHandler.Context.Request.QueryString;
            throw;
          } catch(EBioOk) {
            this.FLoginState = TBioLoginState.ssLoggedOn;
            throw;
          }
        } else if (this.FLoginState == TBioLoginState.ssLoggedOn) {
          if (this.CurBioHandler is tm_ping)
            throw new EBioOk(this.Cfg.CurUser);
        }
      }
      this._initHttpContext();

    }
コード例 #2
0
 public void SetLoginState(TBioLoginState pState) {
   this.FLoginState = pState;
 }