Beispiel #1
0
        /// <summary>
        /// Attempt to log the user in
        /// </summary>
        /// <param name="parameter">The <see cref="SecureString"/> passed in from the view for the user password</param>
        /// <returns></returns>
        public async Task Login(object parameter)
        {
            var passwordContainer = parameter as IHavePassword;

            if (passwordContainer == null)
            {
                return;
            }

            string password = ToUnsecureString.ConvertToUnsecureString(passwordContainer.Password);

            foreach (Account usr in UserCollection.Users)
            {
                var loginB    = !string.IsNullOrEmpty(Email) && Email == usr.Email;
                var passwordB = !string.IsNullOrEmpty(password) && Cryptation.GetSha1(password, usr.Email) == usr.Password;

                if (!loginB || !passwordB)
                {
                    continue;
                }

                mLoggedUser = usr;
                Email       = string.Empty;
                password    = string.Empty;
                IoC.Application.SideMenuVisible = true;

                break;
            }
        }
Beispiel #2
0
 /// <summary>
 /// Create session.
 /// </summary>
 /// <param name="name">Name of the session.</param>
 /// <param name="maxParts">Maximum participants.</param>
 public static void Create(string name, int maxParts)
 {
     SessionName = name;
     CourseID    = Cryptation.Md5Hash(name);
     Parts       = 0;
     MaxParts    = maxParts;
     CList       = new List <User>();
 }