start point of hotlist support (untested)

This commit is contained in:
2026-01-25 22:47:28 -07:00
parent c5b2c3d64b
commit 0dd66709d9
6 changed files with 114 additions and 20 deletions
+7 -4
View File
@@ -680,7 +680,7 @@ func AmCreateNewUser(ctx context.Context, username string, password string, remi
defer func() {
AmStoreAudit(ar)
}()
anon, _ := getAnonUserID(ctx)
anon, _ := AmGetAnonUser(ctx)
success := false
tx := amdb.MustBegin()
defer func() {
@@ -728,7 +728,7 @@ func AmCreateNewUser(ctx context.Context, username string, password string, remi
// add user properties
props := make([]UserProperties, 0)
if err = tx.SelectContext(ctx, &props, "SELECT * FROM propuser WHERE uid = ?", anon); err != nil {
if err = tx.SelectContext(ctx, &props, "SELECT * FROM propuser WHERE uid = ?", anon.Uid); err != nil {
return nil, err
}
for _, p := range props {
@@ -739,7 +739,7 @@ func AmCreateNewUser(ctx context.Context, username string, password string, remi
}
// add user sideboxes
if err = copySideboxes(ctx, tx, user.Uid, anon); err != nil {
if err = copySideboxes(ctx, tx, user.Uid, anon.Uid); err != nil {
return nil, err
}
@@ -756,7 +756,10 @@ func AmCreateNewUser(ctx context.Context, username string, password string, remi
return nil, err
}
// TODO: copy conference hotlists
// copy conference hotlists
if err = AmCopyConferenceHotlist(ctx, anon, user); err != nil {
return nil, err
}
// operation was a success - add an audit record
ar = AmNewAudit(AuditAccountCreated, user.Uid, remoteIP)