Exemple #1
0
 public static MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
 {
     if (!SecUtility.ValidateParameter(ref username, true, true, true, 0))
     {
         status = MembershipCreateStatus.InvalidUserName;
         return(null);
     }
     if (!SecUtility.ValidatePasswordParameter(ref password, 0))
     {
         status = MembershipCreateStatus.InvalidPassword;
         return(null);
     }
     if (!SecUtility.ValidateParameter(ref email, false, false, false, 0))
     {
         status = MembershipCreateStatus.InvalidEmail;
         return(null);
     }
     if (!SecUtility.ValidateParameter(ref passwordQuestion, false, true, false, 0))
     {
         status = MembershipCreateStatus.InvalidQuestion;
         return(null);
     }
     if (!SecUtility.ValidateParameter(ref passwordAnswer, false, true, false, 0))
     {
         status = MembershipCreateStatus.InvalidAnswer;
         return(null);
     }
     return(Provider.CreateUser(username, password, email, passwordQuestion, passwordAnswer, isApproved, providerUserKey, out status));
 }