コード例 #1
0
    private void SubmitRequest(MembershipUser mu, out bool submitted, out bool emailed)
    {
        submitted = false;
        emailed   = false;

        WTS_User u = new WTS_User(mu.ProviderUserKey.ToString());

        u.Load_GUID();
        Guid   resetCode = Guid.Empty;
        string errorMsg  = string.Empty;

        submitted = u.RequestPasswordReset(DateTime.Now.ToUniversalTime().Ticks, out resetCode, out errorMsg);

        string msg = string.Empty;

        if (submitted)
        {
            //show confirmation message
            emailed = UserManagement.SendResetEmail(mu.Email, mu.UserName, resetCode, (Guid)mu.ProviderUserKey);
            msg     = "An email with steps to follow will be sent to your registered email address.";
        }
        else
        {
            msg = "We were unable to submit your password reset request.";
        }
        labelResultMessage.Text           = msg;
        this.divMessages.Style["display"] = "block";
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.reportID = WTS_Reports.getReportIDbyName("Workload Summary Report");
        DataTable      dt   = new DataTable();
        MembershipUser u    = Membership.GetUser();
        WTS_User       user = new WTS_User(u.ProviderUserKey.ToString());

        user.Load_GUID();
        this.userID = user.ID;
        string userName = HttpContext.Current.User.Identity.Name;

        WTS_Reports.get_Report_Parameter_List(ref dt, userID, this.reportID);
        if (dt != null && dt.Rows.Count > 0)
        {
            foreach (DataRow row in dt.Rows)
            {
                string   name  = row.Field <string>("Name");
                string   value = row.Field <Int32>("ParamsID").ToString();
                ListItem li    = new ListItem(name, value);
                if (row.Field <bool>("Process"))
                {
                    li.Attributes.Add("OptionGroup", "Process Views");
                }
                else
                {
                    li.Attributes.Add("OptionGroup", "Custom Views");
                }
                ddlParameters.Items.Insert(ddlParameters.Items.Count, li);
            }
        }
        ListItem def = new ListItem("Default", "Default");

        def.Attributes.Add("OptionGroup", "Process Views");
        ddlParameters.Items.Insert(0, def);

        // 13419 - 7:
        ListItem defBacklog = new ListItem("Default (Backlog)", "Default (Backlog)");

        def.Attributes.Add("OptionGroup", "Process Views");
        ddlParameters.Items.Insert(1, defBacklog);


        if (IsPostBack)
        {
            DataSet ds = (DataSet)Session["WorkloadSummaryData"];
            String  selectedColumns          = (String)Session["SelectedColumns"];
            String  SummaryOverviewsSection1 = (String)Session["SummaryOverviewsSecion1"];
            String  SummaryOverviewsSection2 = (String)Session["SummaryOverviewsSecion2"];


            String ddlValue = (String)Session["ddlValue"];

            Excel = (String)Session["Excel"];

            exportReport(ds, selectedColumns, SummaryOverviewsSection1, SummaryOverviewsSection2, ddlValue);
        }
    }
コード例 #3
0
ファイル: Default.aspx.cs プロジェクト: seangilbert250/WTS
    protected void Login()
    {
        this.IsAuthorized = true;
        LogUtility.LogInfo("checking if membership user is logged in and authenticated");
        MembershipUser u = Membership.GetUser();

        if (u != null)
        {
            this.IsAuthorized = u.IsApproved;
            _loggedInProfile  = new WTS_User(u.ProviderUserKey.ToString());
            _loggedInProfile.Load_GUID();

            //Always include the default theme
            UserManagement.AddDefaultTheme(Page, _loggedInProfile);

            //11626 - 2:
            LoadUserPrefs();

            //SetAnimations
            _useAnimations = _loggedInProfile.EnableAnimations.ToString();

            #region Debug Logging
            if (WTSConfiguration.DebugMode)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine();
                sb.AppendLine("ALL available roles: ");
                string[] availRoles = Roles.GetAllRoles();
                if (availRoles.Length > 0)
                {
                    foreach (string r in availRoles)
                    {
                        sb.AppendLine("    " + r);
                    }
                }

                sb.AppendLine();
                sb.AppendLine();

                sb.AppendFormat("User {0} is logged in and is {1}approved.", u.UserName, u.IsApproved ? "" : "NOT ");
                sb.AppendLine();
                sb.AppendLine(string.Format("Organization = {0}", _loggedInProfile.Organization));
                sb.AppendLine();
                string[] roles = Roles.GetRolesForUser();
                if (roles.Length > 0)
                {
                    sb.AppendLine("User is in roles:  ");
                    foreach (string r in roles)
                    {
                        sb.AppendLine("    " + r);
                    }
                }
                else
                {
                    sb.AppendLine("User has no roles assigned.");
                }
                LogUtility.LogInfo(sb.ToString());
            }
            #endregion
        }
        else
        {
            if (WTSConfiguration.DebugMode)
            {
                LogUtility.LogInfo("User was not found or is not logged in.");
            }
        }

        this.UserName    = HttpContext.Current.User.Identity.Name;
        this.UserId      = _loggedInProfile.ID;
        this.IsUserAdmin = UserManagement.UserIsUserAdmin(username: UserName);
        this.SessionID   = HttpContext.Current.Session.SessionID;

        lblUser.Text = "Welcome to WTS -";

        //Load Filters
        LoadFilters();

        //11626 - 2:
        LoadUserPrefs();

        //Load menu and module options for the logged in user
        LoadAvailableOptions(u);
        LoadCustomUserFilters();
    }