Exemple #1
0
        public void UserLoginByEmail(string email, string login, string password, WMStartPage startPage, string toEmail)
        {
            Account acct = Account.LoginAccount(email, login, password);

            if (acct != null)
            {
                string    sessionHash = Utils.GetMD5DigestHexString(HttpContext.Current.Session.SessionID);
                DbStorage storage     = DbStorageCreator.CreateDatabaseStorage(acct);
                try
                {
                    storage.Connect();
                    storage.CreateTempRow(acct.ID, string.Format(@"sessionHash_{0}", sessionHash));
                }
                catch (WebMailException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    throw new WebMailDatabaseException(ex);
                }
                finally
                {
                    storage.Disconnect();
                }

                HttpContext.Current.Response.Redirect(_wmRoot + @"/" + string.Format(@"integration/integr.aspx?hash={0}&scr={1}&to={2}", sessionHash, (int)startPage, toEmail), false);
            }
        }