Add Administration user management: list, password reset, email change, group assignments
Playwright Tests / test (push) Canceled after 0s
Playwright Tests / test (push) Canceled after 0s
Wires the previously-unused fis_admin_* user/group stored procs into the Admin module (fds_sys-gated), adds a users grid with a per-row ribbon (reset password, change email, manage group membership), and always emails a password reset result to the user rather than showing it to the admin. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ CREATE PROCEDURE [dbo].[fis_admin_resetUserPassword]
|
||||
@authaccount varchar(10)
|
||||
,@useraccount_id varchar(10)
|
||||
,@enc_key uniqueidentifier
|
||||
,@newpassword nvarchar(20) = NULL /* admin-supplied password; when NULL a random one is generated */
|
||||
AS
|
||||
BEGIN
|
||||
SET NOCOUNT ON;
|
||||
@@ -17,19 +18,23 @@ BEGIN
|
||||
DECLARE @utcnow datetime = GETUTCDATE();
|
||||
DECLARE @auth smallint = [dbo].[fis_admin_getUserAuth](@authaccount);
|
||||
|
||||
DECLARE @newpassword nvarchar(20) = [dbo].[ocms_fn_generatePassword] (8, 0, 1, 1);
|
||||
IF @newpassword IS NULL
|
||||
BEGIN
|
||||
SET @newpassword = [dbo].[ocms_fn_generatePassword] (8, 0, 1, 1);
|
||||
END
|
||||
|
||||
|
||||
IF @auth > 1 OR @authaccount = @useraccount_id
|
||||
BEGIN
|
||||
|
||||
|
||||
UPDATE [dbo].[fis_useraccounts]
|
||||
SET [password_enc] = ENCRYPTBYKEY(@enc_key, @newpassword)
|
||||
, [DateModified] = GETUTCDATE()
|
||||
, [UserModified] = @authaccount
|
||||
WHERE [useraccount_id] = @useraccount_id AND [dateDeleted] is null;
|
||||
|
||||
SELECT CAST(CASE WHEN DECRYPTBYKEY((SELECT TOP(1) [password_enc] FROM [dbo].[fis_useraccounts] WHERE [useraccount_id] = @useraccount_id)) = @newpassword THEN 1 ELSE 0 END as bit);
|
||||
|
||||
SELECT CAST(CASE WHEN DECRYPTBYKEY((SELECT TOP(1) [password_enc] FROM [dbo].[fis_useraccounts] WHERE [useraccount_id] = @useraccount_id)) = @newpassword THEN 1 ELSE 0 END as bit) as [success]
|
||||
, @newpassword as [newpassword];
|
||||
|
||||
END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user