Example #1
0
        protected virtual void OnWizardMessage(WizardMessageEventArgs e)
        {
            var Handler = WizardMessage;

            if (Handler != null)
            {
                Handler(this, e);
            }
        }
Example #2
0
        void CmdBtnFinish_FinishWizard(object sender, RoutedEventArgs e)
        {
            //Check, if Superadmin-password is OK
            if (pbSuperadmin.SecurePassword.Length < 3)
            {
                var evArgsPw = new WizardMessageEventArgs();
                //Todo: translate
                evArgsPw.Message      = _LangDictionary["MsgSuperadminPasswordShortText"].ToString();
                evArgsPw.MessageImage = MessageBoxImage.Error;
                evArgsPw.Title        = _LangDictionary["MsgSuperadminPasswordShortTitle"].ToString();

                OnWizardMessageEvent(evArgsPw);
                return;
            }

            //Create SUperadmin
            var salt1 = Helper.GenerateSalt(512);
            var salt2 = Helper.GenerateSalt(512);
            var saId  = StorageCore.Core.AddUser("superadmin", "Superadmin", Helper.GetPasswordHash(pbSuperadmin.SecurePassword, salt1, salt2));

            StorageCore.Core.ModifyUserSuperadmin(saId, true);
            StorageCore.Core.SetUserSalt1(saId, salt1);
            StorageCore.Core.SetUserSalt2(saId, salt2);
            StorageCore.Core.SetUserSalt3(saId, Helper.GenerateSalt(512));

            //Set the Autologin, if SU-Mode is selected
            if (SingleUserModeSelected)
            {
                //Create new user
                var Salt1StaticUser = Helper.GenerateSalt(512);
                var Salt2StaticUser = Helper.GenerateSalt(512);
                var SaIdStaticUser  = StorageCore.Core.AddUser("User", "User", Helper.GetPasswordHash(Helper.ConvertToSecureString("0,34,23:alt,sec,yy:MM:dd hh:mm:ss,first"), Salt1StaticUser, Salt2StaticUser));
                StorageCore.Core.SetUserSalt1(SaIdStaticUser, Salt1StaticUser);
                StorageCore.Core.SetUserSalt2(SaIdStaticUser, Salt2StaticUser);
                StorageCore.Core.SetUserSalt3(SaIdStaticUser, Helper.GenerateSalt(512));

                StorageCore.Core.SetSingleUserMode(true, "0,34,23:alt,sec,yy:MM:dd hh:mm:ss,first");
            }
            else
            {
                StorageCore.Core.SetSingleUserMode(false, "");
            }

            var evArgs = new WizardResultEventArgs();

            evArgs.WizardName = "FirstRun";
            evArgs.Result     = true;
            OnWizardFinishedEvent(evArgs);
        }