From 3ac22385f2cb2256db718e47f5ae3c6d13353b70 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 5 Jun 2022 15:14:34 -0700 Subject: added janny managment for admin board pages --- db/database.go | 49 ++++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 35 deletions(-) (limited to 'db') diff --git a/db/database.go b/db/database.go index c6c2fc7..2c42cf5 100644 --- a/db/database.go +++ b/db/database.go @@ -85,45 +85,24 @@ func CreateNewBoard(actor activitypub.Actor) (activitypub.Actor, error) { } } - var verify util.Verify + { + var verify util.Verify + verify.Type = "admin" + verify.Identifier = actor.Id - verify.Type = "admin" - verify.Identifier = actor.Id - - if verify.Code, err = util.CreateKey(50); err != nil { - return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") - } - - if err := verify.Create(); err != nil { - return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") - } - - verify.Type = "janitor" - verify.Identifier = actor.Id - - if verify.Code, err = util.CreateKey(50); err != nil { - return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") - } - - if err := verify.Create(); err != nil { - return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") - } - - var nverify util.Verify - nverify.Board = actor.Id - nverify.Identifier = "admin" - nverify.Type = "admin" - - if err := nverify.CreateBoardMod(); err != nil { - return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") + if err := actor.CreateVerification(verify); err != nil { + return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") + } } - nverify.Board = actor.Id - nverify.Identifier = "janitor" - nverify.Type = "janitor" + { + var verify util.Verify + verify.Type = "janitor" + verify.Identifier = actor.Id - if err := nverify.CreateBoardMod(); err != nil { - return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") + if err := actor.CreateVerification(verify); err != nil { + return activitypub.Actor{}, util.MakeError(err, "CreateNewBoardDB") + } } activitypub.CreatePem(actor) -- cgit v1.2.3