Beispiel #1
0
        public UserWorkflow LogonAs(string user)
        {
            Logout();
            LogonForm logonForm = _codeTrack.GotoLogonPage();

            logonForm.Name     = user;
            logonForm.Password = user;
            logonForm.Submit();
            return(this);
        }
Beispiel #2
0
 public ActionResult Logon(LogonForm form)
 {
     if (!_membershipProvider.Validate(form.EmailAddress, form.Password))
     {
         ModelState.AddModelError("Password", "Username or password is invalid.");
     }
     if (ModelState.IsValid)
     {
         _membershipProvider.SignIn(form.EmailAddress, form.RememberMe);
         //TODO redirect
         return(RedirectToAction("Index", "User"));
     }
     return(View(form));
 }
Beispiel #3
0
 public void validateConnection()
 {
     try
     {
         // Access the name property. This will throw an exception is connection is not valid
         string localName = this.Name;
     }
     catch (Exception ex)
     {
         if (ex.Message.Contains("(401)"))
         {
             // this is an acess denied!
             LogonForm logonForm = new LogonForm();
             logonForm.ShowDialog();
         }
     }
 }
Beispiel #4
0
        public void Accept()
        {
            RestSession.smethod_4();
            X509Certificate2 x509Certificate_;

            while (true)
            {
IL_82:
                uint arg_65_0 = 3907938690u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_65_0 ^ 3175972147u)) % 4u)
                    {
                    case 0u:
                        x509Certificate_ = RestSession.smethod_7(Globals.CertData);
                        arg_65_0         = (num * 4011506567u ^ 300618885u);
                        continue;

                    case 1u:
                        this.nStream   = RestSession.smethod_5(this.client);
                        this.sslStream = RestSession.smethod_6(this.nStream, false, new RemoteCertificateValidationCallback(this.App_CertificateValidation));
                        arg_65_0       = (num * 1806681062u ^ 4172582821u);
                        continue;

                    case 3u:
                        goto IL_82;
                    }
                    goto Block_1;
                }
            }
Block_1:
            RestSession.smethod_8();
            try
            {
                RestSession.smethod_9(this.sslStream, x509Certificate_, false, SslProtocols.Tls12, false);
                int num2 = 0;
                while (true)
                {
IL_5F9:
                    uint arg_573_0 = 2170226920u;
                    while (true)
                    {
                        uint num;
                        switch ((num = (arg_573_0 ^ 3175972147u)) % 30u)
                        {
                        case 1u:
                            RestSession.smethod_12(this.client);
                            arg_573_0 = 2556496177u;
                            continue;

                        case 2u:
                            arg_573_0 = (num * 1744763105u ^ 3406682519u);
                            continue;

                        case 3u:
                            goto IL_5F9;

                        case 4u:
                            arg_573_0 = (num * 585180848u ^ 3852376867u);
                            continue;

                        case 5u:
                        {
                            string     text;
                            HttpHeader header = new HttpHeader
                            {
                                ContentLength = RestSession.smethod_14(text),
                                Content       = text
                            };
                            byte[] byte_ = HttpResponse.Create(HttpCode.OK, header);
                            arg_573_0 = (num * 2775480801u ^ 3304877568u);
                            continue;
                        }

                        case 6u:
                        {
                            byte[] byte_2;
                            RestSession.smethod_15(this.sslStream, byte_2);
                            arg_573_0 = (num * 1250492958u ^ 673772331u);
                            continue;
                        }

                        case 7u:
                        {
                            byte[] array = new byte[num2];
                            arg_573_0 = (num * 2719918147u ^ 2287814592u);
                            continue;
                        }

                        case 8u:
                        {
                            int num3;
                            arg_573_0 = (((num3 == 0) ? 4097782074u : 3496280056u) ^ num * 161494277u);
                            continue;
                        }

                        case 9u:
                        {
                            HttpHeader header2;
                            byte[]     byte_2 = HttpResponse.Create(HttpCode.OK, header2);
                            arg_573_0 = (num * 3879896502u ^ 3651918943u);
                            continue;
                        }

                        case 10u:
                        {
                            byte[]     array;
                            HttpHeader httpHeader = HttpRequest.Parse(array);
                            arg_573_0 = ((!RestSession.smethod_13(httpHeader.Method, Module.smethod_33 <string>(3773212618u))) ? 2403055654u : 2357400434u);
                            continue;
                        }

                        case 11u:
                        {
                            HttpHeader httpHeader;
                            arg_573_0 = ((!RestSession.smethod_13(httpHeader.Method, Module.smethod_37 <string>(3361680046u))) ? 2215941699u : 4202937684u);
                            continue;
                        }

                        case 12u:
                        {
                            byte[] array;
                            arg_573_0 = (((array.Length != 0) ? 2819837061u : 3242441858u) ^ num * 1932756245u);
                            continue;
                        }

                        case 13u:
                        {
                            int num4 = 0;
                            arg_573_0 = (num * 1257474539u ^ 2631169849u);
                            continue;
                        }

                        case 14u:
                        {
                            LogonForm logonForm;
                            arg_573_0 = (((!RestSession.smethod_13(logonForm[Module.smethod_36 <string>(2861509726u)], Module.smethod_37 <string>(235398904u))) ? 1053858572u : 1055173549u) ^ num * 2475641201u);
                            continue;
                        }

                        case 15u:
                        {
                            byte[] array;
                            arg_573_0 = (((array == null) ? 3243205583u : 2710869470u) ^ num * 891484237u);
                            continue;
                        }

                        case 16u:
                        {
                            LogonForm logonForm;
                            arg_573_0 = ((RestSession.smethod_13(logonForm[Module.smethod_36 <string>(2250828827u)], Module.smethod_36 <string>(837291206u)) ? 498799901u : 678006082u) ^ num * 2492023149u);
                            continue;
                        }

                        case 17u:
                        {
                            int num4;
                            int num3 = num4++;
                            arg_573_0 = (num * 1111030318u ^ 3356779107u);
                            continue;
                        }

                        case 18u:
                        {
                            string     text2;
                            HttpHeader header2 = new HttpHeader
                            {
                                ContentLength = RestSession.smethod_14(text2),
                                Content       = text2
                            };
                            arg_573_0 = (num * 3964775577u ^ 694209648u);
                            continue;
                        }

                        case 19u:
                            RestSession.smethod_12(this.client);
                            arg_573_0 = 2972599719u;
                            continue;

                        case 20u:
                        {
                            string text2 = Json.CreateString <PostLogonForm>(new PostLogonForm
                                {
                                    AuthenticationState = AuthenticationState.Done,
                                    LoginTicket         = Module.smethod_36 <string>(304136250u)
                                });
                            arg_573_0 = (num * 360167075u ^ 3963249545u);
                            continue;
                        }

                        case 21u:
                            RestSession.smethod_16(Module.smethod_33 <string>(3715608777u));
                            arg_573_0 = 2215941699u;
                            continue;

                        case 22u:
                        {
                            byte[] byte_;
                            RestSession.smethod_15(this.sslStream, byte_);
                            arg_573_0 = (num * 777717677u ^ 724990205u);
                            continue;
                        }

                        case 24u:
                        {
                            byte[] array;
                            RestSession.smethod_11(this.dataBuffer, array, num2);
                            arg_573_0 = (num * 2219576960u ^ 2407803994u);
                            continue;
                        }

                        case 25u:
                        {
                            string text = Json.CreateString <FormInputs>(new FormInputs
                                {
                                    Type   = Module.smethod_37 <string>(3946023123u),
                                    Inputs = new List <FormInput>(),
                                    Inputs =
                                    {
                                        new FormInput
                                        {
                                            Id        = Module.smethod_34 <string>(1157598820u),
                                            Type      = Module.smethod_35 <string>(660958023u),
                                            Label     = Module.smethod_36 <string>(4155214069u),
                                            MaxLength = 320
                                        },
                                        new FormInput
                                        {
                                            Id        = Module.smethod_35 <string>(269237390u),
                                            Type      = Module.smethod_35 <string>(269237390u),
                                            Label     = Module.smethod_33 <string>(4156767494u),
                                            MaxLength = 16
                                        },
                                        new FormInput
                                        {
                                            Id    = Module.smethod_33 <string>(3613515769u),
                                            Type  = Module.smethod_37 <string>(3303236897u),
                                            Label = Module.smethod_33 <string>(187751233u)
                                        }
                                    }
                                });
                            arg_573_0 = (num * 1698536323u ^ 3749898327u);
                            continue;
                        }

                        case 26u:
                            arg_573_0 = (num * 3176669753u ^ 3512643481u);
                            continue;

                        case 27u:
                        {
                            HttpHeader httpHeader;
                            LogonForm  logonForm = Json.CreateObject <LogonForm>(httpHeader.Content);
                            arg_573_0 = (num * 207156555u ^ 3087242650u);
                            continue;
                        }

                        case 28u:
                            arg_573_0 = ((num2 == 0) ? 3622369844u : 3326415920u);
                            continue;

                        case 29u:
                            num2      = RestSession.smethod_10(this.sslStream, this.dataBuffer, 0, this.dataBuffer.Length);
                            arg_573_0 = 3087035324u;
                            continue;
                        }
                        goto Block_12;
                    }
                }
                Block_12 :;
            }
            catch (Exception)
            {
                while (true)
                {
                    IL_643 :
                    uint arg_60F_0 = 2706351906u;
                    while (true)
                    {
                        uint num;
                        switch ((num = (arg_60F_0 ^ 3175972147u)) % 3u)
                        {
                        case 1u:
                            RestSession.smethod_12(this.client);
                            arg_60F_0 = (num * 734591689u ^ 879456549u);
                            continue;

                        case 2u:
                            goto IL_643;
                        }
                        goto Block_14;
                    }
                }
Block_14:
                this.Dispose();
            }
        }
Beispiel #5
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            LoadConfig();

            // Instantiate logon form
            LogonForm logonForm = new LogonForm();

            this.WindowState = FormWindowState.Minimized;
            #if DEBUG
            isLoggedIn = true;
            #else
            isLoggedIn = false;
            #endif


            // Logon routine
            while (isLoggedIn == false)
            {
                // If the form was disposed (due to mistakes in code)
                // the app will be killed in last instance
                if (logonForm.IsDisposed)
                {
                    break;
                }
                switch (logonForm.ShowDialog())
                {
                // This is not supposed to happen and will kill the app
                case DialogResult.Cancel:
                    isLoggedIn = false;
                    Application.Exit();
                    return;

                // This is not supposed to happen and will kill the app
                case DialogResult.None:
                    isLoggedIn = false;
                    Application.Exit();
                    return;

                // The Dialog Result returns DialogResult.OK
                // if the authentification succeeded.
                case DialogResult.OK:
                    isLoggedIn = true;
                    // gather all the data to provide them to other forms
                    _accountName = logonForm.AccountName;
                    _displayName = logonForm.DisplayName;
                    _domain      = logonForm.Domain;
                    break;

                // This is not supposed to happen and will kill the app
                default:
                    NotifyUserLog(LogMessage.UserLogonError);
                    isLoggedIn = false;
                    return;
                }
            }
            // Kill the app in last instance, if an error occured and the while block was exited
            if (isLoggedIn == false)
            {
                Application.Exit();
            }

            // Reset the form to apply the culture
            this.Controls.Clear();
            InitializeComponent();

            // Display the Main Form in full size
            this.WindowState   = FormWindowState.Maximized;
            this.ShowInTaskbar = true;

            PopulateList();
        }