1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Print 'Create Anonymous User' INSERT INTO [aspnet_Users] ([UserId], [ApplicationId], [UserName], [LoweredUserName], [MobileAlias], [IsAnonymous], [LastActivityDate]) VALUES (@UserID, @ApplicationID, 'Anonymous', Lower('Anonymous'), NULL, 1, getdate()) --Do we need to make Salt configurable? INSERT INTO [aspnet_Membership] ([ApplicationId],[UserId], [Password], [PasswordFormat], [PasswordSalt], [MobilePIN], [Email], [LoweredEmail], [PasswordQuestion], [PasswordAnswer], [IsApproved], [CreateDate], [LastLoginDate], [LastPasswordChangedDate], [Comment], [FailedPasswordAnswerAttemptWindowStart], [FailedPasswordAnswerAttemptCount], [FailedPasswordAttemptWindowStart], [FailedPasswordAttemptCount], [LastLockoutDate], [IsLockedOut]) VALUES (@ApplicationID, @UserID, @UserID, 0, N'DVZTktxeMzDtXR7eik7Cdw==', NULL, '[email protected]', LOWER('[email protected]'), NULL, NULL, 1, getdate(), getdate(), getdate(), NULL, '1753-01-01', 0, '1753-01-01', 0, '1753-01-01', 0) INSERT INTO [cs_Users]([MembershipID], [ForceLogin], [UserAccountStatus], [AppUserToken], [LastActivity], [LastAction], [UserName], [Email], [IsApproved], [IsAnonymous], [CreateDate]) VALUES(@UserID, 0,1, null, getdate(), '', 'Anonymous', '[email protected]', 1, 1, getdate())
Set @cs_UserID = @@Identity INSERT INTO [cs_UserProfile]([UserID], [TimeZone], [TotalPosts], [PostSortOrder], [PostRank], [IsAvatarApproved], [ModerationLevel], [EnableThreadTracking], [EnableDisplayUnreadThreadsOnly], [EnableAvatar], [EnableDisplayInMemberList], [EnablePrivateMessages], [EnableOnlineStatus], [EnableHtmlEmail], [MembershipID], [SettingsID], [PropertyNames], [PropertyValues]) VALUES (@cs_UserID, 0, 0, 0, 0x01, 0, 0, 0, 0, 0, 0, 0, 1, 0, @UserID, @SettingsID, NULL, NULL)
-- add the anonymous user to the everyone role INSERT INTO aspnet_UsersInRoles ([UserId], [RoleId]) VALUES( @UserID, @EveryoneRoleID ) |