From 40cca8f5f804db53a3dbf28c27322e050b3c011f Mon Sep 17 00:00:00 2001 From: Brian Dukes Date: Fri, 10 Mar 2023 08:18:11 -0600 Subject: [PATCH] Remove SQL syntax that's incompatible with 2012 DROP PROCEDURE IF EXISTS requires SQL 2016, DNN's current minimum requirements include SQL 2012 Also adjust the column existence check to be consistent with other checks Fixes #5554 --- .../Dnn.PersonaBar.Extensions.csproj | 1 + .../Dnn.PersonaBar.Extensions.dnn | 910 +++++++++--------- .../SqlDataProvider/09.11.01.SqlDataProvider | 93 +- .../SqlDataProvider/09.11.02.SqlDataProvider | 90 ++ 4 files changed, 550 insertions(+), 544 deletions(-) create mode 100644 Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.02.SqlDataProvider diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj index 5175d32d3bc..d3d31c71000 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj @@ -751,6 +751,7 @@ + web.config diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.dnn b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.dnn index a91bea0ed91..68326ae6e42 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.dnn +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.dnn @@ -1,458 +1,458 @@ - - - - Dnn.PersonaBar.Extensions - - ~/Images/icon-personabarapp-32px.png - - .NET Foundation and Contributors - DNN Community - https://dnncommunity.org - info@dnncommunity.org - - - - - 09.03.00 - Dnn.PersonaBar.UI - - true - - DotNetNuke.Entities.Modules.EventMessageProcessor, DotNetNuke - UpgradeModule - - Dnn.PersonaBar.Extensions.Components.BusinessController, Dnn.PersonaBar.Extensions - [DESKTOPMODULEID] - 01.04.00,01.05.00 - - - - - - DesktopModules/admin/Dnn.PersonaBar/Modules - - Resources.zip - - - - - - - Dnn.PersonaBar.Extensions.dll - bin - - - - - - DesktopModules\admin\Dnn.PersonaBar\Modules\Sql - - - - - - - - + + + + + + - - - - - - Dnn.AdminLogs - AdminLogs - Dnn.PersonaBar.AdminLogs.MenuControllers.AdminLogsMenuController, Dnn.PersonaBar.Extensions - nav_AdminLogs - AdminLogs - Manage - 50 - Administrators|ADMIN_LOGS_VIEW - - - ADMIN_LOGS_VIEW - Admin Logs View - - - ADMIN_LOGS_EDIT - Admin Logs Edit - - - LOG_SETTINGS_VIEW - Log Settings View - - - LOG_SETTINGS_EDIT - Log Settings Edit - - - - - Dnn.ConfigConsole - ConfigConsole - Dnn.PersonaBar.ConfigConsole.MenuControllers.ConfigConsoleMenuController, Dnn.PersonaBar.Extensions - nav_ConfigConsole - ConfigConsole - Settings - 90 - - - - - Dnn.Connectors - Connectors - nav_Connectors - Connectors - Settings - 43 - Administrators - - - - - Dnn.CssEditor - CssEditor - Dnn.PersonaBar.CssEditor.MenuControllers.CssEditorMenuController, Dnn.PersonaBar.Extensions - nav_CssEditor - CssEditor - Settings - 70 - Administrators - - - - - Dnn.Licensing - Licensing - Dnn.PersonaBar.Licensing.MenuControllers.LicensingMenuController, Dnn.PersonaBar.Extensions - nav_Licensing - Licensing - Settings - 100 - - - - - Dnn.Extensions - Extensions - Dnn.PersonaBar.Extensions.MenuControllers.ExtensionMenuController, Dnn.PersonaBar.Extensions - nav_Extensions - extensions - Settings - 47 - Administrators - - - - - Dnn.Pages - Pages - Dnn.PersonaBar.Pages.MenuControllers.PagesMenuController, Dnn.PersonaBar.Extensions - nav_Pages - Pages - Content - 20 - Registered Users, Administrators - - - VIEW_PAGE_LIST - View Page List - - - - - Dnn.Prompt - Prompt - Dnn.PersonaBar.Prompt.MenuControllers.PromptMenuController, Dnn.PersonaBar.Extensions - nav_Prompt - Prompt - Settings - 95 - - - - - Dnn.Recyclebin - Recyclebin - nav_Recyclebin - Recyclebin - Content - 30 - Administrators - - - RECYCLEBIN_PAGES_VIEW - Pages View - - - RECYCLEBIN_PAGES_EDIT - Pages Edit - - - RECYCLEBIN_MODULES_VIEW - Modules View - - - RECYCLEBIN_MODULES_EDIT - Modules Edit - - - RECYCLEBIN_USERS_VIEW - Users View - - - RECYCLEBIN_USERS_EDIT - Users Edit - - - - - Dnn.Roles - Roles - nav_Roles - Roles - Manage - 20 - Administrators - - - - - Dnn.Security - Security - Dnn.PersonaBar.Security.MenuControllers.SecurityMenuController, Dnn.PersonaBar.Extensions - nav_Security - Security - Settings - 20 - Administrators - - - BASIC_LOGIN_SETTINGS_VIEW - Basic Login Settings View - - - BASIC_LOGIN_SETTINGS_EDIT - Basic Login Settings Edit - - - REGISTRATION_SETTINGS_VIEW - Registration Settings View - - - REGISTRATION_SETTINGS_EDIT - Registration Settings Edit - - - - - Dnn.Sites - Sites - Dnn.PersonaBar.Sites.MenuControllers.SitesMenuController, Dnn.PersonaBar.Extensions - nav_Sites - Sites - Manage - 40 - - - - - Dnn.SiteGroups - SiteGroups - Dnn.PersonaBar.Sites.MenuControllers.SitesMenuController, Dnn.PersonaBar.Extensions - nav_SiteGroups - SiteGroups - Manage - 45 - - - - - Dnn.Seo - Seo - Dnn.PersonaBar.Seo.Components.ExtensionMenuController, Dnn.PersonaBar.Extensions - nav_Seo - Seo - Settings - 30 - Administrators - - - - - Dnn.Servers - Servers - Dnn.PersonaBar.Servers.MenuControllers.ServersMenuController, Dnn.PersonaBar.Extensions - nav_Servers - Servers - Settings - 50 - Administrators - - - - - Dnn.SiteImportExport - SiteImportExport - Dnn.PersonaBar.SiteImportExport.MenuControllers.SiteImportExportMenuController, Dnn.PersonaBar.Extensions - nav_SiteImportExport - SiteImportExport - Settings - 50 - Administrators - - - - - Dnn.SiteSettings - SiteSettings - Dnn.PersonaBar.SiteSettings.MenuControllers.SiteSettingsMenuController, Dnn.PersonaBar.Extensions - nav_SiteSettings - SiteSettings - Settings - 10 - Administrators - - - SITE_INFO_VIEW - Site Info View - - - SITE_INFO_EDIT - Site Info Edit - - - - - Dnn.SqlConsole - SqlConsole - Dnn.PersonaBar.SqlConsole.MenuControllers.SqlConsoleMenuController, Dnn.PersonaBar.Extensions - nav_SqlConsole - SqlConsole - Settings - 80 - - - - - Dnn.TaskScheduler - TaskScheduler - Dnn.PersonaBar.TaskScheduler.MenuControllers.TaskSchedulerMenuController, Dnn.PersonaBar.Extensions - nav_TaskScheduler - TaskScheduler - Settings - 60 - - - - - Dnn.Themes - Themes - Dnn.PersonaBar.Themes.MenuControllers.ThemeMenuController, Dnn.PersonaBar.Extensions - nav_Themes - Themes - Manage - 30 - Administrators - - - - - Dnn.Users - Users - Dnn.PersonaBar.Users.Components.UsersMenuController, Dnn.PersonaBar.Extensions - nav_Users - Users - Manage - 10 - Administrators - - - ADD_USER - Add User - - - MANAGE_ROLES - Manage Roles - - - MANAGE_PROFILE - Manage Profile - - - VIEW_SETTINGS - View Settings - - - EDIT_SETTINGS - Edit Settings - - - DELETE_USER - Delete User - - - AUTHORIZE_UNAUTHORIZE_USER - Authorize/Unauthorize User - - - MANAGE_PASSWORD - Manage Password - - - - - Dnn.Vocabularies - Vocabularies - - nav_Vocabularies - vocabularies - Settings - 40 - Administrators - - - - - - + 09.11.00.SqlDataProvider + 09.11.00 + + + + + + + + Dnn.AdminLogs + AdminLogs + Dnn.PersonaBar.AdminLogs.MenuControllers.AdminLogsMenuController, Dnn.PersonaBar.Extensions + nav_AdminLogs + AdminLogs + Manage + 50 + Administrators|ADMIN_LOGS_VIEW + + + ADMIN_LOGS_VIEW + Admin Logs View + + + ADMIN_LOGS_EDIT + Admin Logs Edit + + + LOG_SETTINGS_VIEW + Log Settings View + + + LOG_SETTINGS_EDIT + Log Settings Edit + + + + + Dnn.ConfigConsole + ConfigConsole + Dnn.PersonaBar.ConfigConsole.MenuControllers.ConfigConsoleMenuController, Dnn.PersonaBar.Extensions + nav_ConfigConsole + ConfigConsole + Settings + 90 + + + + + Dnn.Connectors + Connectors + nav_Connectors + Connectors + Settings + 43 + Administrators + + + + + Dnn.CssEditor + CssEditor + Dnn.PersonaBar.CssEditor.MenuControllers.CssEditorMenuController, Dnn.PersonaBar.Extensions + nav_CssEditor + CssEditor + Settings + 70 + Administrators + + + + + Dnn.Licensing + Licensing + Dnn.PersonaBar.Licensing.MenuControllers.LicensingMenuController, Dnn.PersonaBar.Extensions + nav_Licensing + Licensing + Settings + 100 + + + + + Dnn.Extensions + Extensions + Dnn.PersonaBar.Extensions.MenuControllers.ExtensionMenuController, Dnn.PersonaBar.Extensions + nav_Extensions + extensions + Settings + 47 + Administrators + + + + + Dnn.Pages + Pages + Dnn.PersonaBar.Pages.MenuControllers.PagesMenuController, Dnn.PersonaBar.Extensions + nav_Pages + Pages + Content + 20 + Registered Users, Administrators + + + VIEW_PAGE_LIST + View Page List + + + + + Dnn.Prompt + Prompt + Dnn.PersonaBar.Prompt.MenuControllers.PromptMenuController, Dnn.PersonaBar.Extensions + nav_Prompt + Prompt + Settings + 95 + + + + + Dnn.Recyclebin + Recyclebin + nav_Recyclebin + Recyclebin + Content + 30 + Administrators + + + RECYCLEBIN_PAGES_VIEW + Pages View + + + RECYCLEBIN_PAGES_EDIT + Pages Edit + + + RECYCLEBIN_MODULES_VIEW + Modules View + + + RECYCLEBIN_MODULES_EDIT + Modules Edit + + + RECYCLEBIN_USERS_VIEW + Users View + + + RECYCLEBIN_USERS_EDIT + Users Edit + + + + + Dnn.Roles + Roles + nav_Roles + Roles + Manage + 20 + Administrators + + + + + Dnn.Security + Security + Dnn.PersonaBar.Security.MenuControllers.SecurityMenuController, Dnn.PersonaBar.Extensions + nav_Security + Security + Settings + 20 + Administrators + + + BASIC_LOGIN_SETTINGS_VIEW + Basic Login Settings View + + + BASIC_LOGIN_SETTINGS_EDIT + Basic Login Settings Edit + + + REGISTRATION_SETTINGS_VIEW + Registration Settings View + + + REGISTRATION_SETTINGS_EDIT + Registration Settings Edit + + + + + Dnn.Sites + Sites + Dnn.PersonaBar.Sites.MenuControllers.SitesMenuController, Dnn.PersonaBar.Extensions + nav_Sites + Sites + Manage + 40 + + + + + Dnn.SiteGroups + SiteGroups + Dnn.PersonaBar.Sites.MenuControllers.SitesMenuController, Dnn.PersonaBar.Extensions + nav_SiteGroups + SiteGroups + Manage + 45 + + + + + Dnn.Seo + Seo + Dnn.PersonaBar.Seo.Components.ExtensionMenuController, Dnn.PersonaBar.Extensions + nav_Seo + Seo + Settings + 30 + Administrators + + + + + Dnn.Servers + Servers + Dnn.PersonaBar.Servers.MenuControllers.ServersMenuController, Dnn.PersonaBar.Extensions + nav_Servers + Servers + Settings + 50 + Administrators + + + + + Dnn.SiteImportExport + SiteImportExport + Dnn.PersonaBar.SiteImportExport.MenuControllers.SiteImportExportMenuController, Dnn.PersonaBar.Extensions + nav_SiteImportExport + SiteImportExport + Settings + 50 + Administrators + + + + + Dnn.SiteSettings + SiteSettings + Dnn.PersonaBar.SiteSettings.MenuControllers.SiteSettingsMenuController, Dnn.PersonaBar.Extensions + nav_SiteSettings + SiteSettings + Settings + 10 + Administrators + + + SITE_INFO_VIEW + Site Info View + + + SITE_INFO_EDIT + Site Info Edit + + + + + Dnn.SqlConsole + SqlConsole + Dnn.PersonaBar.SqlConsole.MenuControllers.SqlConsoleMenuController, Dnn.PersonaBar.Extensions + nav_SqlConsole + SqlConsole + Settings + 80 + + + + + Dnn.TaskScheduler + TaskScheduler + Dnn.PersonaBar.TaskScheduler.MenuControllers.TaskSchedulerMenuController, Dnn.PersonaBar.Extensions + nav_TaskScheduler + TaskScheduler + Settings + 60 + + + + + Dnn.Themes + Themes + Dnn.PersonaBar.Themes.MenuControllers.ThemeMenuController, Dnn.PersonaBar.Extensions + nav_Themes + Themes + Manage + 30 + Administrators + + + + + Dnn.Users + Users + Dnn.PersonaBar.Users.Components.UsersMenuController, Dnn.PersonaBar.Extensions + nav_Users + Users + Manage + 10 + Administrators + + + ADD_USER + Add User + + + MANAGE_ROLES + Manage Roles + + + MANAGE_PROFILE + Manage Profile + + + VIEW_SETTINGS + View Settings + + + EDIT_SETTINGS + Edit Settings + + + DELETE_USER + Delete User + + + AUTHORIZE_UNAUTHORIZE_USER + Authorize/Unauthorize User + + + MANAGE_PASSWORD + Manage Password + + + + + Dnn.Vocabularies + Vocabularies + + nav_Vocabularies + vocabularies + Settings + 40 + Administrators + + + + + + diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.01.SqlDataProvider b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.01.SqlDataProvider index e313c567d64..b9d23680ad1 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.01.SqlDataProvider +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.01.SqlDataProvider @@ -1,89 +1,4 @@ -/************************************************************/ -/***** SqlDataProvider *****/ -/***** *****/ -/***** *****/ -/***** Note: To manually execute this script you must *****/ -/***** perform a search and replace operation *****/ -/***** for {databaseOwner} and {objectQualifier} *****/ -/***** *****/ -/************************************************************/ - -/*********************/ -/** ADD NOTES FIELD **/ -/*********************/ -IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME='{objectQualifier}IPFilter' AND COLUMN_NAME='Notes') - BEGIN - ALTER TABLE {databaseOwner}{objectQualifier}IPFilter - ADD Notes nvarchar(255) NULL - END -GO - -/**************************/ -/** UpdateIPFilter SPROC **/ -/**************************/ - -DROP PROCEDURE IF EXISTS {databaseOwner}[{objectQualifier}UpdateIPFilter] -GO - -CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdateIPFilter] - @IPFilterID int, - @IPAddress nvarchar(50), - @SubnetMask nvarchar(50), - @RuleType tinyint, - @LastModifiedByUserID int, - @Notes nvarchar(255) -AS - BEGIN - UPDATE {databaseOwner}{objectQualifier}IPFilter - SET - IPAddress = @IPAddress, - SubnetMask = @SubnetMask, - RuleType = @RuleType, - LastModifiedByUserID = @LastModifiedByUserID, - LastModifiedOnDate = getdate(), - Notes = @Notes - WHERE IPFilterID = @IPFilterID - END -GO - -/**************************/ -/** AddIPFilter SPROC **/ -/**************************/ - -DROP PROCEDURE IF EXISTS {databaseOwner}[{objectQualifier}AddIPFilter] -GO - -CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddIPFilter] - @IPAddress nvarchar(50), - @SubnetMask nvarchar(50), - @RuleType tinyint, - @CreatedByUserID int, - @Notes nvarchar(255) -AS - BEGIN - INSERT INTO {databaseOwner}{objectQualifier}IPFilter - ( - [IPAddress] - ,[SubnetMask] - ,[RuleType] - ,[CreatedByUserID] - ,[CreatedOnDate] - ,[LastModifiedByUserID] - ,[LastModifiedOnDate] - ,[Notes] - ) - VALUES - ( - @IPAddress , - @SubnetMask , - @RuleType, - @CreatedByUserID , - getdate() , - @CreatedByUserID , - getdate() , - @Notes - ) - - SELECT SCOPE_IDENTITY() - END -GO +/*****************************************************************/ +/** All scripts from 09.11.01 moved into 09.11.02 **/ +/** See https://github.com/dnnsoftware/Dnn.Platform/issues/5554 **/ +/*****************************************************************/ diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.02.SqlDataProvider b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.02.SqlDataProvider new file mode 100644 index 00000000000..053a1a3f61c --- /dev/null +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/SqlDataProvider/09.11.02.SqlDataProvider @@ -0,0 +1,90 @@ +/************************************************************/ +/***** SqlDataProvider *****/ +/***** *****/ +/***** *****/ +/***** Note: To manually execute this script you must *****/ +/***** perform a search and replace operation *****/ +/***** for {databaseOwner} and {objectQualifier} *****/ +/***** *****/ +/************************************************************/ + +/*********************/ +/** Add Notes field **/ +/*********************/ +IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id = OBJECT_ID('{databaseOwner}{objectQualifier}IPFilter') AND name = 'Notes') + BEGIN + ALTER TABLE {databaseOwner}{objectQualifier}IPFilter + ADD Notes nvarchar(255) NULL + END +GO + +/**************************/ +/** UpdateIPFilter SPROC **/ +/**************************/ +IF EXISTS (SELECT * FROM sys.procedures WHERE object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}UpdateIPFilter]')) + DROP PROCEDURE {databaseOwner}[{objectQualifier}UpdateIPFilter]; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}UpdateIPFilter] + @IPFilterID int, + @IPAddress nvarchar(50), + @SubnetMask nvarchar(50), + @RuleType tinyint, + @LastModifiedByUserID int, + @Notes nvarchar(255) +AS + BEGIN + UPDATE {databaseOwner}{objectQualifier}IPFilter + SET + IPAddress = @IPAddress, + SubnetMask = @SubnetMask, + RuleType = @RuleType, + LastModifiedByUserID = @LastModifiedByUserID, + LastModifiedOnDate = getdate(), + Notes = @Notes + WHERE IPFilterID = @IPFilterID + END +GO + +/**************************/ +/** AddIPFilter SPROC **/ +/**************************/ + +IF EXISTS (SELECT * FROM sys.procedures WHERE object_id = OBJECT_ID(N'{databaseOwner}[{objectQualifier}AddIPFilter]')) + DROP PROCEDURE {databaseOwner}[{objectQualifier}AddIPFilter]; +GO + +CREATE PROCEDURE {databaseOwner}[{objectQualifier}AddIPFilter] + @IPAddress nvarchar(50), + @SubnetMask nvarchar(50), + @RuleType tinyint, + @CreatedByUserID int, + @Notes nvarchar(255) +AS + BEGIN + INSERT INTO {databaseOwner}{objectQualifier}IPFilter + ( + [IPAddress] + ,[SubnetMask] + ,[RuleType] + ,[CreatedByUserID] + ,[CreatedOnDate] + ,[LastModifiedByUserID] + ,[LastModifiedOnDate] + ,[Notes] + ) + VALUES + ( + @IPAddress , + @SubnetMask , + @RuleType, + @CreatedByUserID , + getdate() , + @CreatedByUserID , + getdate() , + @Notes + ) + + SELECT SCOPE_IDENTITY() + END +GO