Пример #1
0
        /// <summary>
        /// Gets the account for session.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <returns>AccountItem.</returns>
        public Account GetAccountForSession(IrisSession session)
        {
            var acc = GetAccountForUser(session.Username);

            if (acc != null)
            {
                return(acc);
            }
            else
            {
                var result = new Account
                {
                    Username   = session.Username,
                    FirstName  = "New",
                    LastName   = "User",
                    SessionId  = session.SessionId,
                    AuthModeId = session.AuthenticationMode,
                    DtStart    = DateTime.Now,
                    DtEnd      = DateTime.Now.AddDays(10),
                    Email      = String.Empty
                };
                Provider <Account> .Save(result);

                return(result);
            }
        }
Пример #2
0
        /// <summary>
        /// Handles the Click event of the btnRegister control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void btnRegister_Click(object sender, RoutedEventArgs e)
        {
            var ss = new IrisSession()
            {
                Username           = EdUserName.Text,
                AuthenticationMode = AuthenticationMode.Native,
                AccountId          = EdUserName.Text
            };

            Request        = RegisterNewUserDialog.Execute(ss);
            EdPwd.Password = CryptoEngine.Decrypt(Request.Password);
        }
 public void Try_GetMyIrisSession()
 {
     try
     {
         IWinAuthenticationAgent agt  = WinAuthenticationAgentFactory.CreateAgent();
         IrisSession             sess = agt.AuthenticateUserCredentials();
         Assert.AreNotEqual(null, sess);
         Assert.AreEqual(sess.Username, WindowsIdentity.GetCurrent().Name);
     }
     catch (Exception e)
     {
         Assert.Fail(e.Message);
     }
 }
Пример #4
0
        /// <summary>
        /// Creates the session view item.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <returns></returns>
        private SessionViewItem CreateSessionViewItem(IrisSession session)
        {
            var acc = FxAgentFactory
                      .CreateAccountAgent()
                      .GetAccountForSession(session);

            return(new SessionViewItem()
            {
                Id = Guid.NewGuid().ToString(),
                AccountId = acc.Id,
                AuthenticationMode = session.AuthenticationMode,
                Email = acc.Email,
                Host = session.Host,
                LoggedInAt = session.ConnectionTime,
                Mobile = acc.Telephone1,
                SessionId = session.SessionId,
                Telephone = acc.Telephone2,
                UserFullName = String.Format("{0} {1}", acc.FirstName, acc.LastName),
                Username = acc.Username,
                LastActivity = session.LastRequest
            });
        }
 /// <summary>
 /// Ends the session.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <returns>IrisSession.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public IrisSession EndSession(IrisSession session)
 {
     return SessionProxyPortal
         .SessionProxy
         .EndSession(session);
 }
 /// <summary>
 /// Starts the session.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <returns>IrisSession.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public IrisSession StartSession(IrisSession session)
 {
     throw new System.NotImplementedException();
 }
Пример #7
0
 /// <summary>
 /// Ends the session.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <returns>IrisSession.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public IrisSession EndSession(IrisSession session)
 {
     return(SessionProxyPortal
            .SessionProxy
            .EndSession(session));
 }
Пример #8
0
 /// <summary>
 /// Starts the session.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <returns>IrisSession.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public IrisSession StartSession(IrisSession session)
 {
     throw new System.NotImplementedException();
 }
Пример #9
0
 public Account GetAccountForSession(IrisSession session)
 {
     throw new System.NotImplementedException();
 }
 /// <summary>
 /// Gets the account for session.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <returns>AccountItem.</returns>
 /// <exception cref="System.NotImplementedException"></exception>
 public Account GetAccountForSession(IrisSession session)
 {
     throw new NotImplementedException();
 }