Example #1
0
        /// <summary>
        /// Creates a new user.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="lname">The lname.</param>
        /// <param name="passw">The passw.</param>
        /// <param name="email">The email.</param>
        public static User MakeNew(string name, string lname, string passw, string email)
        {
            var user = new Umbraco.Core.Models.Membership.User(name, email, lname, passw);

            ApplicationContext.Current.Services.UserService.Save(user);

            var u = new User(user);

            u.OnNew(EventArgs.Empty);

            return(u);
        }
Example #2
0
        public static User MakeNew(string name, string lname, string passw, UserType ut)
        {
            SqlHelper.ExecuteNonQuery(@"
				insert into umbracoUser 
				(UserType,startStructureId,startMediaId, UserName, userLogin, userPassword, userEmail,userLanguage) 
				values (@type,-1,-1,@name,@lname,@pw,'',@lang)"                ,
                                      SqlHelper.CreateParameter("@lang", GlobalSettings.DefaultUILanguage),
                                      SqlHelper.CreateParameter("@name", name),
                                      SqlHelper.CreateParameter("@lname", lname),
                                      SqlHelper.CreateParameter("@type", ut.Id),
                                      SqlHelper.CreateParameter("@pw", passw));

            var u = new User(lname);

            u.OnNew(EventArgs.Empty);

            return(u);
        }
Example #3
0
        public static User MakeNew(string name, string lname, string passw, string email, UserType ut)
        {
            SqlHelper.ExecuteNonQuery(@"
				insert into umbracoUser 
				(UserType,startStructureId,startMediaId, UserName, userLogin, userPassword, userEmail,userLanguage) 
				values (@type,-1,-1,@name,@lname,@pw,@email,@lang)",
                SqlHelper.CreateParameter("@lang", GlobalSettings.DefaultUILanguage),
                SqlHelper.CreateParameter("@name", name),
                SqlHelper.CreateParameter("@lname", lname),
                SqlHelper.CreateParameter("@email", email),
                SqlHelper.CreateParameter("@type", ut.Id),
                SqlHelper.CreateParameter("@pw", passw));

            var u = new User(lname);
            u.OnNew(EventArgs.Empty);

            return u;
        }