diff --git a/Providers/DataProviders/SqlDataProvider/01.03.00.SqlDataProvider b/Providers/DataProviders/SqlDataProvider/01.03.00.SqlDataProvider index e35f1e9..5b115a3 100644 --- a/Providers/DataProviders/SqlDataProvider/01.03.00.SqlDataProvider +++ b/Providers/DataProviders/SqlDataProvider/01.03.00.SqlDataProvider @@ -1,4 +1,440 @@ - +-- no longer needed + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_GetUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_GetUsers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_GetUserList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_GetUserList] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_SearchUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_SearchUsers] +GO + +-- delete fro re-creation + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_GetRegisteredUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_GetRegisteredUsers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_GetRoleMembers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_GetRoleMembers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_SearchRegisteredUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_SearchRegisteredUsers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_SearchRoleMembers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_SearchRoleMembers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_GetDeletedAccounts]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_GetDeletedAccounts] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_GetSuperUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_GetSuperUsers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}Connect_Accounts_SearchDeletedUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) + drop procedure {databaseOwner}[{objectQualifier}Connect_Accounts_SearchDeletedUsers] +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'{databaseOwner}[{objectQualifier}vw_Connect_Users]') and OBJECTPROPERTY(id, N'IsView') = 1) + drop View {databaseOwner}[{objectQualifier}vw_Connect_Users] +GO + +CREATE VIEW {databaseOwner}[{objectQualifier}vw_Connect_Users] +AS + + WITH ProfileProperties (_uid, PropertyName, PropertyValue) + AS + ( + SELECT up.UserID as _uid, PropertyName, up.PropertyValue + FROM {databaseOwner}[{objectQualifier}UserProfile] UP + INNER JOIN {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] PPD ON UP.PropertyDefinitionID = PPD.PropertyDefinitionID + ) + + SELECT DISTINCT + X.UserId, + X.Username, + X.FirstName, + X.LastName, + X.DisplayName, + X.Email, + UP.PortalId, + X.Street, + X.Unit, + X.PostalCode, + X.City, + X.Country, + X.Region, + X.Telephone, + X.Cell, + X.TimeZone, + X.Photo, + X.PreferredLocale, + X.PreferredTimeZone, + X.IsSuperUser, + UP.IsDeleted, + AM.LastLoginDate + FROM + {databaseOwner}[{objectQualifier}Users] U + INNER JOIN ProfileProperties PP ON U.UserID = PP._uid + PIVOT (MAX(PropertyValue) FOR PP.PropertyName IN ( [Unit], [Street], [City], [Region], [Country], [PostalCode], [Telephone], [Cell], [TimeZone], [PreferredLocale], [PreferredTimeZone], [Photo])) X + INNER JOIN {databaseOwner}[aspnet_Users] AU ON AU.UserName = X.Username + INNER JOIN {databaseOwner}[aspnet_Membership] AM ON am.UserId = AU.UserId + LEFT JOIN {databaseOwner}[{objectQualifier}UserPortals] UP + ON CASE WHEN X.IsSuperuser = 1 THEN 0 ELSE X.UserId END = UP.UserId + +GO + + +Create PROCEDURE {databaseOwner}[{objectQualifier}Connect_Accounts_GetRoleMembers] + @RoleId int, + @PortalId int +AS +SELECT DISTINCT + U.UserId, + U.Username, + U.FirstName, + U.LastName, + U.DisplayName, + U.Email, + U.Street, + U.Unit, + U.PostalCode, + U.City, + U.Country, + U.Region, + U.Telephone, + U.Cell, + U.PreferredTimeZone, + U.TimeZone, + U.PreferredLocale, + U.IsDeleted, + U.IsSuperUser, + UR.Status as 'Status', + UR.RoleID as 'RoleId', + U.LastLoginDate, + UR.CreatedOnDate as 'CreatedDate' +FROM + {databaseOwner}{objectQualifier}vw_Connect_Users U + Inner Join {databaseOwner}[{objectQualifier}UserRoles] UR on UR.UserId = U.UserID +WHERE + UR.RoleID = @RoleId +AND + U.IsDeleted = 0 +AND + U.IsSuperUser = 0 +AND + U.PortalId = @PortalId + +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Accounts_GetSuperUsers] + @RoleId int +AS +SELECT DISTINCT + U.UserId, + U.Username, + U.FirstName, + U.LastName, + U.DisplayName, + U.Email, + U.Street, + U.Unit, + U.PostalCode, + U.City, + U.Country, + U.Region, + U.Telephone, + U.Cell, + U.PreferredTimeZone, + U.TimeZone, + U.PreferredLocale, + U.IsDeleted, + U.IsSuperUser, + UP.Authorised as 'Status', + (Select @RoleId) as 'RoleId', + U.LastLoginDate, + UP.CreatedDate as 'CreatedDate' +FROM + {databaseOwner}{objectQualifier}vw_Connect_Users U + Inner Join {databaseOwner}[{objectQualifier}UserPortals] UP on U.UserId = UP.UserId +WHERE + U.IsDeleted = 0 +AND + U.IsSuperUser = 1 +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Accounts_GetDeletedAccounts] + @RoleId int, + @PortalId int +AS +SELECT DISTINCT + U.UserId, + U.Username, + U.FirstName, + U.LastName, + U.DisplayName, + U.Email, + U.Street, + U.Unit, + U.PostalCode, + U.City, + U.Country, + U.Region, + U.Telephone, + U.Cell, + U.PreferredTimeZone, + U.TimeZone, + U.PreferredLocale, + U.IsDeleted, + U.IsSuperUser, + UP.Authorised as 'Status', + (Select @RoleId) as 'RoleId', + U.LastLoginDate, + UP.CreatedDate as 'CreatedDate' +FROM + {databaseOwner}{objectQualifier}vw_Connect_Users U + Inner Join {databaseOwner}[{objectQualifier}UserPortals] UP on U.UserId = UP.UserId +WHERE + UP.PortalId = @PortalId +AND + U.IsDeleted = 1 +AND + U.IsSuperUser = 0 +GO + + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Accounts_GetRegisteredUsers] + @RoleId int, + @PortalId int +AS +SELECT DISTINCT + U.UserId, + U.Username, + U.FirstName, + U.LastName, + U.DisplayName, + U.Email, + U.Street, + U.Unit, + U.PostalCode, + U.City, + U.Country, + U.Region, + U.Telephone, + U.Cell, + U.PreferredTimeZone, + U.TimeZone, + U.PreferredLocale, + U.IsDeleted, + U.IsSuperUser, + UP.Authorised as 'Status', + (Select @RoleId) as 'RoleId', + U.LastLoginDate, + UP.CreatedDate as 'CreatedDate' +FROM + {databaseOwner}{objectQualifier}vw_Connect_Users U + Inner Join {databaseOwner}[{objectQualifier}UserPortals] UP on U.UserId = UP.UserId +WHERE + UP.PortalId = @PortalId +AND + U.IsDeleted = 0 +AND + U.IsSuperUser = 0 +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Accounts_SearchDeletedUsers] + @RoleId int, + @PortalId int, + @SearchText nvarchar(256), + @SearchCols nvarchar(256) +AS +SELECT DISTINCT + U.UserId, + U.Username, + U.FirstName, + U.LastName, + U.DisplayName, + U.Email, + U.Street, + U.Unit, + U.PostalCode, + U.City, + U.Country, + U.Region, + U.Telephone, + U.Cell, + U.PreferredTimeZone, + U.TimeZone, + U.PreferredLocale, + U.IsDeleted, + U.IsSuperUser, + '' as 'Status', + (Select @RoleId) as 'RoleId', + U.LastLoginDate, + USRP.CreatedDate as 'CreatedDate' +FROM + {databaseOwner}[{objectQualifier}UserProfile] UP + INNER JOIN {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] PD on PD.[PropertyDefinitionID] = UP.[PropertyDefinitionID] + INNER JOIN {databaseOwner}[{objectQualifier}vw_Connect_Users] U on U.UserId = UP.UserID + Inner Join {databaseOwner}[{objectQualifier}UserPortals] USRP on U.UserId = USRP.UserId +WHERE + U.PortalId = @PortalId +AND + U.IsDeleted = 1 +AND + U.IsSuperUser = 0 +AND + ( + (UP.[PropertyValue] Like '%' + @SearchText + '%' And (PatIndex('%' + PD.[PropertyName] + '%' , @SearchCols) > 0)) + + OR + ( + (U.[FirstName] Like '%' + @SearchText + '%' and PATINDEX('%FirstName%', @SearchCols) > 0) + OR + (U.[LastName] Like '%' + @SearchText + '%' and PATINDEX('%LastName%', @SearchCols) > 0) + OR + (U.[DisplayName] Like '%' + @SearchText + '%' and PATINDEX('%DisplayName%', @SearchCols) > 0) + OR + (U.[Email] Like '%' + @SearchText + '%' and PATINDEX('%Email%', @SearchCols) > 0) + OR + (U.[Username] Like '%' + @SearchText + '%' and PATINDEX('%Username%', @SearchCols) > 0) + ) + + ) + +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Accounts_SearchRoleMembers] + @RoleId int, + @SearchText nvarchar(256), + @SearchCols nvarchar(256) +AS +SELECT DISTINCT + U.UserId, + U.Username, + U.FirstName, + U.LastName, + U.DisplayName, + U.Email, + U.Street, + U.Unit, + U.PostalCode, + U.City, + U.Country, + U.Region, + U.Telephone, + U.Cell, + U.PreferredTimeZone, + U.TimeZone, + U.PreferredLocale, + U.IsDeleted, + U.IsSuperUser, + UR.Status as 'Status', + UR.RoleID as 'RoleId', + U.LastLoginDate, + UR.CreatedOnDate as 'CreatedDate' +FROM + {databaseOwner}[{objectQualifier}UserProfile] UP + INNER JOIN {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] PD on PD.[PropertyDefinitionID] = UP.[PropertyDefinitionID] + INNER JOIN {databaseOwner}[{objectQualifier}vw_Connect_Users] U on U.UserId = UP.UserID + Inner Join {databaseOwner}[{objectQualifier}UserRoles] UR on UR.UserId = U.UserID +WHERE + UR.RoleID = @RoleId +AND + U.IsDeleted = 0 +AND + U.IsSuperUser = 0 +AND + ( + (UP.[PropertyValue] Like '%' + @SearchText + '%' And (PatIndex('%' + PD.[PropertyName] + '%' , @SearchCols) > 0)) + + OR + ( + (U.[FirstName] Like '%' + @SearchText + '%' and PATINDEX('%FirstName%', @SearchCols) > 0) + OR + (U.[LastName] Like '%' + @SearchText + '%' and PATINDEX('%LastName%', @SearchCols) > 0) + OR + (U.[DisplayName] Like '%' + @SearchText + '%' and PATINDEX('%DisplayName%', @SearchCols) > 0) + OR + (U.[Email] Like '%' + @SearchText + '%' and PATINDEX('%Email%', @SearchCols) > 0) + OR + (U.[Username] Like '%' + @SearchText + '%' and PATINDEX('%Username%', @SearchCols) > 0) + ) + + ) + +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}Connect_Accounts_SearchRegisteredUsers] + @RoleId int, + @PortalId int, + @SearchText nvarchar(256), + @SearchCols nvarchar(256) +AS +SELECT DISTINCT + U.UserId, + U.Username, + U.FirstName, + U.LastName, + U.DisplayName, + U.Email, + U.Street, + U.Unit, + U.PostalCode, + U.City, + U.Country, + U.Region, + U.Telephone, + U.Cell, + U.PreferredTimeZone, + U.TimeZone, + U.PreferredLocale, + U.IsDeleted, + U.IsSuperUser, + USRP.Authorised as 'Status', + (Select @RoleId) as 'RoleId', + U.LastLoginDate, + USRP.CreatedDate as 'CreatedDate' +FROM + {databaseOwner}[{objectQualifier}UserProfile] UP + INNER JOIN {databaseOwner}[{objectQualifier}ProfilePropertyDefinition] PD on PD.[PropertyDefinitionID] = UP.[PropertyDefinitionID] + INNER JOIN {databaseOwner}[{objectQualifier}vw_Connect_Users] U on U.UserId = UP.UserID + INNER JOIN {databaseOwner}[{objectQualifier}UserPortals] USRP on U.UserId = USRP.UserId +WHERE + USRP.PortalId = @PortalId +AND + U.IsDeleted = 0 +AND + U.IsSuperUser = 0 +AND + ( + (UP.[PropertyValue] Like '%' + @SearchText + '%' And (PatIndex('%' + PD.[PropertyName] + '%' , @SearchCols) > 0)) + + OR + ( + (U.[FirstName] Like '%' + @SearchText + '%' and PATINDEX('%FirstName%', @SearchCols) > 0) + OR + (U.[LastName] Like '%' + @SearchText + '%' and PATINDEX('%LastName%', @SearchCols) > 0) + OR + (U.[DisplayName] Like '%' + @SearchText + '%' and PATINDEX('%DisplayName%', @SearchCols) > 0) + OR + (U.[Email] Like '%' + @SearchText + '%' and PATINDEX('%Email%', @SearchCols) > 0) + OR + (U.[Username] Like '%' + @SearchText + '%' and PATINDEX('%Username%', @SearchCols) > 0) + ) + + ) + +GO + + if not exists (select 1 from {databaseOwner}[{objectQualifier}Lists] where ListName='DataType' and Value='CheckboxList') begin INSERT INTO {databaseOwner}[{objectQualifier}Lists] ([ListName],[Value],[Text], @@ -7,4 +443,3 @@ begin 0,0,0,-1,-1,1) end GO - diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 946996e..f8e6e7e 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -18,6 +18,7 @@
  • New: New Checkboxlist control for profile properties
  • New: Interface for handling pre-registration event
  • Enhancement: Customize messages displayed on screen after registration
  • +
  • Enhancement: Cross-browser support for pressing enter on registration and signup form
  • Full change log

    Thanks to Vicenç Masanas for contributing