Beispiel #1
0
        protected void UpdateCMSAdminLogin_Click(object sender, EventArgs e)
        {
            var returnObj = new Return();

            if (CMSEmailAddress.Text == "" || CMSPassword.Text == "")
            {
                Messages.Text = "Please make sure to enter a valid 'Email Address' and 'Password'";
            }
            else
            {
                var admin = UsersMapper.GetByUserName("admin");
                if (admin == null)
                {
                    returnObj.Error = new Elmah.Error()
                    {
                        Message = "Cannot find user with username: '******'"
                    };
                }
                else
                {
                    admin.EmailAddress = CMSEmailAddress.Text;
                    admin.FirstName    = FirstName.Text;
                    admin.LastName     = LastName.Text;
                    admin.Password     = StringHelper.Encrypt(CMSPassword.Text.Trim());

                    returnObj = UsersMapper.Update(admin);
                }

                if (returnObj.IsError)
                {
                    Messages.Text = returnObj.Error.Message + "" + returnObj.Error.Exception.InnerException + "<br />";
                }
                else
                {
                    DisableInstallerPanel.Visible = true;
                    Messages.Text = "Successfully updated CMS Admin Login Credentials";

                    MailChimpHelper mailChimpHelper = new MailChimpHelper("f23d1a1ec667a40691014801ed84f096-us15");

                    mailChimpHelper.AddUserToFlexDotNetCMSInstallerList(admin);
                }
            }

            ExecutePanel.Visible = true;
        }