From a9bbbcb6b52772c9139a0af780e5945b15f8ebf9 Mon Sep 17 00:00:00 2001 From: Amy Gale Ruth Bowersox Date: Mon, 16 Feb 2026 23:06:48 -0700 Subject: [PATCH] added admin user dialog definition and minor change to dialog manager it needs --- ui/dialog.go | 7 ++ ui/dialogs/admin_user.yaml | 210 +++++++++++++++++++++++++++++++++++++ 2 files changed, 217 insertions(+) create mode 100644 ui/dialogs/admin_user.yaml diff --git a/ui/dialog.go b/ui/dialog.go index 74bbe25..fcbd683 100644 --- a/ui/dialog.go +++ b/ui/dialog.go @@ -241,6 +241,13 @@ func (fld *DialogItem) IsEmpty() bool { return len(fld.Value) == 0 } +// SetTargetUser alters a dialog's content to reflect a target user. +func (d *Dialog) SetTargetUser(u *database.User) { + d.Title = strings.ReplaceAll(d.Title, "[USERNAME]", u.Username) + d.Subtitle = strings.ReplaceAll(d.Subtitle, "[USERNAME]", u.Username) + d.Action = strings.ReplaceAll(d.Action, "[USERNAME]", u.Username) +} + // SetCommunity alters a dialog's content to reflect the community. func (d *Dialog) SetCommunity(comm *database.Community) { d.Title = strings.ReplaceAll(d.Title, "[CNAME]", comm.Name) diff --git a/ui/dialogs/admin_user.yaml b/ui/dialogs/admin_user.yaml new file mode 100644 index 0000000..4337b66 --- /dev/null +++ b/ui/dialogs/admin_user.yaml @@ -0,0 +1,210 @@ +# +# Amsterdam Web Communities System +# Copyright (c) 2025 Erbosoft Metaverse Design Solutions, All Rights Reserved +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. +# +name: "admin.modify.user" +formName: "moduserform" +menuSelector: "nochange" +title: "Modify User Account" +subtitle: "User: [USERNAME]" +action: "/sysadmin/users/[USERNAME]" +fields: + - type: "header" + name: "header1" + caption: "Security Information" + subcaption: "To change the user's password, enter a new password into the fields below." + - type: "password" + name: "pass1" + caption: "Password" + size: 32 + maxlength: 128 + - type: "password" + name: "pass2" + caption: "Password" + subcaption: "(retype)" + size: 32 + maxlength: 128 + - type: "text" + name: "remind" + caption: "Password reminder phrase" + size: 32 + maxlength: 255 + - type: "rolelist" + name: "base_lvl" + caption: "Base security level" + required: true + param: "Global.UserLevels" + - type: "checkbox" + name: "verify_email" + caption: "E-mail address verified" + - type: "checkbox" + name: "lockout" + caption: "Account locked out" + - type: "checkbox" + name: "nophoto" + caption: "Disallow photo upload for this user" + - type: "header" + name: "header2" + caption: "Name" + - type: "text" + name: "prefix" + caption: "Prefix" + subcaption: "(Mr., Ms., etc.)" + size: 8 + maxlength: 8 + - type: "text" + name: "first" + caption: "First Name" + required: true + size: 32 + maxlength: 64 + - type: "text" + name: "mid" + caption: "Middle Initial" + size: 1 + maxlength: 1 + - type: "text" + name: "last" + caption: "Last Name" + required: true + size: 32 + maxlength: 64 + - type: "text" + name: "suffix" + caption: "Suffix" + subcaption: "(Jr., III, etc.)" + size: 8 + maxlength: 8 + - type: "header" + name: "header3" + caption: "Location" + - type: "text" + name: "company" + caption: "Company" + size: 32 + maxlength: 255 + - type: "text" + name: "addr1" + caption: "Address" + size: 32 + maxlength: 255 + - type: "text" + name: "addr2" + caption: "Address" + subcaption: "(line 2)" + size: 32 + maxlength: 255 + - type: "checkbox" + name: "pvt_addr" + caption: "Hide address in profile" + - type: "text" + name: "loc" + caption: "City" + required: true + size: 32 + maxlength: 64 + - type: "text" + name: "reg" + caption: "State/Province" + required: true + size: 32 + maxlength: 64 + - type: "text" + name: "pcode" + caption: "Zip/Postal Code" + required: true + size: 32 + maxlength: 64 + - type: "countrylist" + name: "country" + caption: "Country" + required: true + - type: "header" + name: "header4" + caption: "Phone Numbers" + - type: "text" + name: "phone" + caption: "Telephone" + size: 32 + maxlength: 32 + - type: "text" + name: "mobile" + caption: "Mobile/cellphone" + size: 32 + maxlength: 32 + - type: "checkbox" + name: "pvt_phone" + caption: "Hide phone/mobile numbers in profile" + - type: "text" + name: "fax" + caption: "Fax" + size: 32 + maxlength: 32 + - type: "checkbox" + name: "pvt_fax" + caption: "Hide fax number in profile" + - type: "header" + name: "header5" + caption: "Internet" + - type: "email" + name: "email" + caption: "E-Mail Address" + required: true + size: 32 + maxlength: 255 + - type: "checkbox" + name: "pvt_email" + caption: "Hide E-mail address in profile" + - type: "text" + name: "url" + caption: "Home Page" + subcaption: "(URL)" + size: 32 + maxlength: 255 + - type: "header" + name: "header6" + caption: "Personal" + - type: "date" + name: "dob" + caption: "Date of Birth" + param: "year:-100" + - type: "text" + name: "descr" + caption: "Personal description" + size: 32 + maxlength: 255 + - type: "userphoto" + name: "photo" + caption: "User Photo" + param: "/profile_photo" + - type: "header" + name: "header7" + caption: "User Preferences" + - type: "checkbox" + name: "pic_in_post" + caption: "Display user photos next to conference posts" + subcaption: "(where applicable)" + - type: "checkbox" + name: "no_mass_mail" + caption: "Don't send me mass E-mail from community/conference hosts" + - type: "localelist" + name: "locale" + caption: "Default locale" + subcaption: "(for formatting dates/times)" + required: true + - type: "tzlist" + name: "tz" + caption: "Default time zone" + required: true + - type: "button" + name: "update" + caption: "Update" + param: "blue" + - type: "button" + name: "cancel" + caption: "Cancel" + param: "red"