Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit 87909ed

Browse files
committed
add user verify and unverify
admins can now verify and unverify users
1 parent 9ddbd4f commit 87909ed

File tree

6 files changed

+342
-11
lines changed

6 files changed

+342
-11
lines changed

database/user.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ type User struct {
9191
Legal bool
9292
// ProfileProgress is a float which denotes user profile completeness on the frontend
9393
ProfileProgress float64
94+
// Verified marks a person as verified
95+
Verified bool
96+
// VerifyReq requests verification
97+
VerifyReq bool
98+
// VerifiedBy stores the index of the admin who verified the user
99+
VerifiedBy int
100+
// VerifiedTime stores when the user was verified
101+
VerifiedTime string
94102
}
95103

96104
// MailboxHelper is a helper struct that can be used to send admin notifications to users
@@ -605,3 +613,15 @@ func (a *User) AddtoMailbox(subject string, message string) error {
605613
a.Mailbox = append(a.Mailbox, x)
606614
return a.Save()
607615
}
616+
617+
// VerReq requests account verification
618+
func (a *User) VerReq() error {
619+
a.VerifyReq = true
620+
return a.Save()
621+
}
622+
623+
// UnverReq un-requests account verification
624+
func (a *User) UnverReq() error {
625+
a.VerifyReq = false
626+
return a.Save()
627+
}

go.mod

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,34 @@ module github.com/YaleOpenLab/openx
33
go 1.13
44

55
require (
6-
github.com/Varunram/essentials v0.0.0-20200511082308-5399e9622e81
6+
github.com/Varunram/essentials v0.0.0-20200519142747-e1f5f5a44c33
77
github.com/algorand/go-algorand-sdk v1.3.0 // indirect
88
github.com/bithyve/research v0.0.0-20191102090848-d238806b60bf
99
github.com/boltdb/bolt v1.3.1
1010
github.com/btcsuite/btcd v0.20.1-beta // indirect
11+
github.com/fsnotify/fsnotify v1.4.9 // indirect
12+
github.com/go-chi/chi v4.1.1+incompatible // indirect
13+
github.com/go-errors/errors v1.0.2 // indirect
1114
github.com/ipfs/go-ipfs-api v0.0.3 // indirect
15+
github.com/ipfs/go-ipfs-files v0.0.8 // indirect
1216
github.com/jessevdk/go-flags v1.4.0
17+
github.com/lib/pq v1.5.2 // indirect
18+
github.com/libp2p/go-libp2p-core v0.5.6 // indirect
19+
github.com/mitchellh/mapstructure v1.3.1 // indirect
20+
github.com/multiformats/go-multiaddr-net v0.1.5 // indirect
21+
github.com/multiformats/go-multibase v0.0.3 // indirect
22+
github.com/pelletier/go-toml v1.8.0 // indirect
1323
github.com/pkg/errors v0.9.1
1424
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7
25+
github.com/sirupsen/logrus v1.6.0 // indirect
26+
github.com/spf13/afero v1.2.2 // indirect
27+
github.com/spf13/cast v1.3.1 // indirect
28+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
29+
github.com/spf13/pflag v1.0.5 // indirect
1530
github.com/spf13/viper v1.7.0
16-
github.com/stellar/go v0.0.0-20200519000909-93dd37921340
31+
github.com/stellar/go v0.0.0-20200522225735-c19111f1f904
32+
github.com/stellar/go-xdr v0.0.0-20200331223602-71a1e6d555f2 // indirect
33+
github.com/stretchr/objx v0.2.0 // indirect
34+
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
35+
gopkg.in/ini.v1 v1.56.0 // indirect
1736
)

0 commit comments

Comments
 (0)