Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string session = "undefined";

            if (this.Session["UserAuth"] != null)
            {
                authRequired.Visible = false;
                auth.Visible         = true;
                MainContent.Visible  = true;
                shortcuts.Visible    = true;
                pleaseNote.Visible   = false;

                AuthenticatedUser user = (AuthenticatedUser)this.Session["UserAuth"];
                session = $"{user.getUsername()} ({user.getSessionId()})";
                displayName.InnerText = $"{user.getUsername()} ({user.getAuthenticatedRole().ToString()})";
                if (user.isUser())
                {
                    pleaseNote.Visible = true;
                }
            }
            else
            {
                authRequired.Visible = true;
                auth.Visible         = false;
                MainContent.Visible  = false;
                shortcuts.Visible    = false;
            }

            if (Global.isFirstRun)
            {
                firstRun.Visible = true;
            }

            SessionText.InnerText = session;
            this.checkLifecycle();
        }
 public AuthenticatedUser(AuthenticatedUser user)
 {
     this.setUserId(user.getId());
     this.setUsername(user.getUsername());
     this.setAuthenticatedRole(user.getAuthenticatedRole());
 }