Esempio n. 1
0
        private void LoginProcedure()
        {
            login = LoginDriver.Run(LoginFlow.ForEventGen);
            if (login == null)
            {
                System.Windows.Application.Current.Shutdown();
                return;
            }

            if (login.discussion == null)
            {
                MessageDlg.Show(
                    "In this application even moderator should select real, existing discussion");
                System.Windows.Application.Current.Shutdown();
                return;
            }

            Topics = new ObservableCollection <Topic>(login.discussion.Topic);

            Persons = new ObservableCollection <Person>(DaoHelpers.personsOfDiscussion(login.discussion));

            setPostLoginInfo();

            FillTopics(login.discussion);

            sharedClient.start(login, DbCtx.Get().Connection.DataSource, login.devType);
            sharedClient.clienRt.onStatsEvent += OnStatsEvent;
        }
Esempio n. 2
0
 public IActionResult SignInDriver(LoginDriver login)
 {
     if (ModelState.IsValid)
     {
         Driver driverInDb = dbContext.Drivers.FirstOrDefault(u => u.Email == login.LoginDriverEmail);
         if (driverInDb == null)
         {
             ModelState.AddModelError("LoginEmail", "Invalid email/Password");
             return(View("Login"));
         }
         else
         {
             PasswordHasher <LoginDriver> compare = new PasswordHasher <LoginDriver>();
             var result = compare.VerifyHashedPassword(login, driverInDb.Password, login.LoginDriverPassword);
             if (result == 0)
             {
                 ModelState.AddModelError("LoginEmail", "Invalid email/Password");
                 return(View("LoginDriver"));
             }
             else
             {
                 HttpContext.Session.SetInt32("DriverId", driverInDb.DriverId);
                 HttpContext.Session.SetString("DriverFirstName", driverInDb.FirstName);
                 return(RedirectToAction("Index", "TruberDriver"));
             }
         }
     }
     else
     {
         return(View("LoginDriver"));
     }
 }
Esempio n. 3
0
        private void LoginProcedures()
        {
            DaoUtils.EnsureModerExists();

            LoginResult login = SessionInfo.Get().ExperimentMode
                                    ? LoginDriver.Run(LoginFlow.ForExperiment)
                                    : LoginDriver.Run(LoginFlow.Regular);

            if (login == null)
            {
                Application.Current.Shutdown();
                return;
            }

            if (login.session != null && login.discussion != null)
            {
                lblSessionInfo.Content = SessionStr(login.session, login.discussion);
            }
            else
            {
                lblSessionInfo.Content = "";
            }

            SessionInfo.Get().discussion = login.discussion;
            SessionInfo.Get().setPerson(login.person);

            _discWindows.mainWnd = this;

            avatar.DataContext = login.person;

            //start rt client
            sharedClient.start(login, PrivateCenterCtx.Get().Connection.DataSource, DeviceType.Wpf);

            SetListeners(sharedClient, true);
        }
Esempio n. 4
0
        public async Task <IActionResult> Login(LoginDriver model)
        {
            if (ModelState.IsValid)
            {
                string  model_password_hash = Convert.ToBase64String(MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(model.Password)));
                Drivers user = await _context.Drivers.FirstOrDefaultAsync(u => u.phone_number == model.Phone_number && u.pass_hash == model_password_hash);

                if (user != null)
                {
                    await Authenticate(model.Phone_number); // аутентификация

                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    //ViewBag.Message = "Некорректные номер и(или) пароль";
                    ModelState.AddModelError("", "Некорректные номер телефона и(или) пароль");
                }
            }
            return(View("LoginDriver", model));
        }
        public void CreateAccountDialog_CreateUnconfirmedAccount_FailsLogin()
        {
            var ribbon = AddinRibbonController.Initialize(_app);

            //Open Login dialog
            var loginDialog = AddinTestUtility.OpenLoginDialog(ribbon);

            //Open Create Account dialog and create a unique one
            var createAccountDialog = loginDialog.SelectCreateAccount();

            createAccountDialog.Name = "non unique test account name";
            var uniqueAccountName = "testacct" + AddinTestUtility.GetUniqueSuffix() + "@testdomain.com";

            createAccountDialog.Email = uniqueAccountName;
            var accountPassword = "******";

            createAccountDialog.Password = accountPassword;

            //Ensure terms is required
            Assert.IsFalse(createAccountDialog.RegisterEnabled);

            //Accept terms then register
            createAccountDialog.Terms = true;

            var messageBoxDialog = createAccountDialog.SelectRegister();

            messageBoxDialog.SelectOKVerifySuccess();

            //Attempt to login with above unconfirmed account, expect failure
            loginDialog          = LoginDriver.FindFromParent(ribbon.ExcelElement);
            loginDialog.Email    = uniqueAccountName;
            loginDialog.Password = accountPassword;

            loginDialog.SelectOkVerifyFailure(LoginDriver.ErrorMessageType.Credentials);

            //Close login dialog
            loginDialog.SelectCancelVerifySuccess();
        }
Esempio n. 6
0
        /// <summary>
        /// Open login dialog, first closing a remember-me logged-in scenario if necessary
        /// </summary>
        public static LoginDriver OpenLoginDialog(AddinRibbonController ribbon)
        {
            ribbon.InvokeButton(AddinRibbonButton.Login);

            return(LoginDriver.FindFromParent(ribbon.ExcelElement));
        }
Esempio n. 7
0
 public CommonSteps(AssertLogin assertLogin, NavigationDriver navigationDriver, LoginDriver loginDriver)
 {
     this.assertLogin      = assertLogin;
     this.navigationDriver = navigationDriver;
     this.loginDriver      = loginDriver;
 }
Esempio n. 8
0
 public RemovingProductsFromAnOnlineOrderSteps(AssertLogin assertLogin, LoginDriver loginDriver)
 {
     this.assertLogin = assertLogin;
     this.loginDriver = loginDriver;
 }
Esempio n. 9
0
 public BuildingUpOnlineOrderSteps(AssertLogin assertLogin, LoginDriver loginDriver)
 {
     this.assertLogin = assertLogin;
     this.loginDriver = loginDriver;
 }
 public LoginFormNavigationSteps(AssertLogin assertLogin, LoginDriver loginDriver)
 {
     this.assertLogin = assertLogin;
     this.loginDriver = loginDriver;
 }
Esempio n. 11
0
 public LoginSuccessSteps(LoginDriver loginDriver, AssertLogin assertLogin)
 {
     this.loginDriver = loginDriver;
     this.assertLogin = assertLogin;
 }