예제 #1
0
        void FillTeamList(Auth.UserData data)
        {
            int i        = 0;
            int iChecked = -1;

            teamMenu.Items.Clear();
            if (data.plsTeams == null)
            {
                return;
            }

            foreach (string sTeam in data.plsTeams)
            {
                teamMenu.Items.Add(sTeam);
                if (data.sTeamName == sTeam)
                {
                    iChecked = i;
                }
                i++;
            }

            if (iChecked != -1)
            {
                teamMenu.SelectedIndex = iChecked;
            }
        }
예제 #2
0
        void LoadPrivsAndSetupPage()
        {
            teamNameForAvailableSlots = teamName;

            if (!String.IsNullOrEmpty(SqlBase))
            {
                sqlStrSorted = SqlBase + ",SlotStart";
            }

            if (!IsPostBack)
            {
                divCalendarFeedLink.Visible = ShowingCalLink;

                Auth.UserData data = LoadPrivs();

                if (timeZoneInfo == null && data.sTimezone != null)
                {
                    timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById(data.sTimezone);
                }

                if (!IsLoggedIn)
                {
                    SetLoggedOff();
                }

                ShowHideAdmin(data);
                BindFieldDropdown();
            }

            FillInCalendarLink();
        }
예제 #3
0
        void ShowHideAdmin(Auth.UserData data)
        {
            if (!LoggedInAsAdmin)
            {
                divAdminFunctions.Visible = false;
                return;
            }

            divAdminFunctions.Visible = true;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            m_auth = new Auth(LoginOutButton, Request, Session,
                              Context.GetOwinContext().Environment["System.Web.HttpContextBase"] as HttpContextBase, ViewState,
                              $"{Startup.s_sRoot}/CalendarLink.aspx", null, OnAfterLogin, null, null);
            m_apiInterop = new ApiInterop(Context, Server, Startup.apiRoot);

            ConnectionStringSettings conn = ConfigurationManager.ConnectionStrings["dbSchedule"];
            string sSqlConnectionString   = conn.ConnectionString;

            DBConn = new SqlConnection(sSqlConnectionString);

            m_userData = m_auth.CurrentPrivs; // if they login, then we will load new privs

            m_auth.SetupLoginLogout();
            DataGrid1.ItemCommand += new DataGridCommandEventHandler(DataGrid_Command);
            GoHome.Click          += DoGoHome;

            if (!IsPostBack)
            {
                if (m_auth.IsAuthenticated() && m_userData.privs == Auth.UserPrivs.NotAuthenticated)
                {
                    m_userData = m_auth.LoadPrivs(DBConn);
                }

                FillTeamList(m_userData);

                if (!string.IsNullOrEmpty(m_userData.sTeamName))
                {
                    BuildPageSqlQuery();
                    BindSource();
                }
                else
                {
                    SqlQuery = null;
                    BindSource();
                }
            }
        }
예제 #5
0
        /*----------------------------------------------------------------------------
        *       %%Function: Page_Load
        *       %%Qualified: Rwp.AdminPage.Page_Load
        *       %%Contact: rlittle
        *
        *   Initialize authentication and api interop
        *  ----------------------------------------------------------------------------*/
        protected void Page_Load(object sender, EventArgs e)
        {
            m_auth       = new Auth(LoginOutButton, Request, Session, Context.GetOwinContext().Environment["System.Web.HttpContextBase"] as HttpContextBase, ViewState, $"{s_sRoot}/admin.aspx", null, null, null, null);
            m_apiInterop = new ApiInterop(Context, Server, Startup.apiRoot);

            ConnectionStringSettings conn = ConfigurationManager.ConnectionStrings["dbSchedule"];
            string sSqlConnectionString   = conn.ConnectionString;

            DBConn = new SqlConnection(sSqlConnectionString);

            m_userData         = m_auth.LoadPrivs(DBConn);
            ipClient.InnerText = Request.UserHostAddress;

            CheckServiceServerConsistency(sSqlConnectionString);
            EnableUIForAdmin();

            m_auth.SetupLoginLogout();
            GoHome.Click += DoGoHome;
            if (!IsPostBack)
            {
                rowAddUser.Visible = false;
            }
        }
 void OnAfterLogin(object sender, EventArgs e)
 {
     m_userData = m_auth.LoadPrivs(DBConn);
     FillTeamList(m_userData);
     BindSource();
 }
 protected void OnTeamMenuItemChanged(object sender, EventArgs e)
 {
     m_userData = m_auth.LoadPrivs(DBConn, teamMenu.SelectedValue);
     BuildPageSqlQuery();
     BindSource();
 }