Exemple #1
0
        public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
        {
            if (GetUser(username, false) != null)
            {
                status = MembershipCreateStatus.DuplicateUserName;
                return(null);
            }

            var userManager = PlugInManager.GetUserManager();


            QApplikationUser au = new QApplikationUser();

            au.Id               = Guid.NewGuid().ToString();
            au.Username         = username;
            au.Password         = password;
            au.Email            = email;
            au.PasswordQuestion = passwordQuestion;
            au.PasswordAnswer   = passwordAnswer;
            au.IsApproved       = isApproved;
            au.ProviderUserKey  = providerUserKey == null?Guid.NewGuid().ToString() : providerUserKey.ToString();

            userManager.AddUser(au);
            //TODO : Ovo je samo glavni status treba vidjeti da li treba jos koji status programirati
            status = MembershipCreateStatus.Success;
            return(GetUser(username, false));
        }
Exemple #2
0
        public override bool ValidateUser(string username, string password)
        {
            var userManager   = PlugInManager.GetUserManager();
            var adriabookUser = userManager.GetUser(username);

            if (adriabookUser == null)
            {
                return(false);
            }

            return(adriabookUser.Password == password);
        }
Exemple #3
0
        public override MembershipUser GetUser(string username, bool userIsOnline)
        {
            var userManager = PlugInManager.GetUserManager();
            var abUser      = userManager.GetUser(username);

            if (abUser == null)
            {
                return(null);
            }

            var msu = new MembershipUser(this.Name, username, abUser.ProviderUserKey, abUser.Email, abUser.PasswordQuestion, "", abUser.IsApproved, abUser.IsLockedOut,
                                         abUser.CreationDate, abUser.LastLoginDate, abUser.LastActivityDate, abUser.LastPasswordChangedDate, abUser.LastLockoutDate);

            return(msu);
        }