Hey Everyone:
If you're running or know DNN for YAF, I have this pressing issue that I need a bit of help with. Thanks in advance! :)
https://yetanotherforum.n...elete-Superusers-Now
Aha! I should've thought to search through the sprocs. You were correct about this. The RemoveUsers procedure was modified. This is a core code change. Had I known this was happening, I wouldn't have ever even tried using this module. :(
It was the only sproc that had the term yaf in it. I used these queries to find it:
yaf
SELECT OBJECT_NAME(object_id) FROM sys.sql_modules WHERE OBJECTPROPERTY(object_id, 'IsProcedure') = 1 AND definition LIKE '%yaf%'
SELECT OBJECT_NAME(id) FROM SYSCOMMENTS WHERE [text] LIKE '%yaf%' AND OBJECTPROPERTY(id, 'IsProcedure') = 1 GROUP BY OBJECT_NAME(id)
SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%yaf%' AND ROUTINE_TYPE='PROCEDURE'
I used a clean instance of DNN 9.12 (same version) to drop and recreate the sproc:
/****** Object: StoredProcedure [dbo].[RemoveUser] Script Date: 8/31/2023 9:07:40 AM ******/ DROP PROCEDURE [dbo].[RemoveUser] GO
/****** Object: StoredProcedure [dbo].[RemoveUser] Script Date: 8/31/2023 9:07:40 AM ******/ SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO
CREATE PROCEDURE [dbo].[RemoveUser] @UserID int, @PortalID int AS IF @PortalID IS NULL BEGIN -- Delete SuperUser DELETE FROM dbo.Users WHERE UserId = @UserID END ELSE BEGIN -- Remove User from Portal DELETE FROM dbo.UserPortals WHERE UserId = @UserID AND PortalId = @PortalID IF NOT EXISTS (SELECT 1 FROM dbo.UserPortals WHERE UserId = @UserID) -- Delete User (but not if SuperUser) BEGIN DELETE FROM dbo.Users WHERE UserId = @UserID AND IsSuperUser = 0 DELETE FROM dbo.UserRoles WHERE UserID = @UserID END ELSE BEGIN DELETE ur FROM dbo.UserRoles ur INNER JOIN dbo.Roles r ON r.RoleID = ur.RoleID WHERE UserID = @UserID AND r.PortalID = @PortalID END END GO
These are superusers I'm attempting to permanently remove, so far. They're already marked as deleted, but I still can't use the option in the Users view to "Permanently Delete." I get a new error, listed below. However, an interesting thing to note is that running the purge- user prompt command doesn't display any error at all. If I took that for it's word, the same user accounts I'm trying to delete are deleted, but they're still there.
purge- user
ERROR MESSAGE
Message:Internal Query Processor Error: The query processor encountered an unexpected error during execution (HRESULT = 0x80040e19).
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at PetaPoco.Database.<>c.b__353_0(IDbCommand c) at PetaPoco.Database.CommandHelper(IDbCommand cmd, Func`2 cmdFunc) at PetaPoco.Database.ExecuteNonQueryHelper(IDbCommand cmd) at PetaPoco.Database.ExecuteInternal(CommandType commandType, String sql, Object[] args) at DotNetNuke.Data.PetaPoco.PetaPocoHelper.ExecuteNonQuery(String connectionString, CommandType type, Int32 timeoutSec, String sql, Object[] args) at DotNetNuke.Data.SqlDataProvider.ExecuteNonQuery(String procedureName, Object[] commandParameters) at DotNetNuke.Security.Membership.AspNetMembershipProvider.RemoveUser(UserInfo user)
This means that there are likely MORE core code changes that were made. Ugh...
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.