audit message when server starts and shuts down

This commit is contained in:
2026-02-21 22:05:33 -07:00
parent 6189b474d0
commit 6e06c7a3a8
5 changed files with 46 additions and 0 deletions
+11
View File
@@ -561,6 +561,17 @@ func AmGetAnonUser(ctx context.Context) (*User, error) {
return rc, err
}
// AmGetBOFH returns the user account of the global system administrator.
func AmGetBOFH(ctx context.Context) (*User, error) {
row := amdb.QueryRowContext(ctx, "SELECT uid FROM users WHERE base_lvl = ?", AmRole("Global.BOFH").Level())
var uid int32
err := row.Scan(&uid)
if err != nil {
return nil, err
}
return AmGetUser(ctx, uid)
}
// hashPassword hashes the password value.
func hashPassword(password string) string {
if len(password) == 0 {