mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
members object provider default from config.
This commit is contained in:
parent
00586baffc
commit
8f277c61c9
@ -22,7 +22,35 @@ type MemberManagerCtx struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (manager *MemberManagerCtx) Connect() error {
|
func (manager *MemberManagerCtx) Connect() error {
|
||||||
return nil
|
var err error
|
||||||
|
|
||||||
|
if manager.config.AdminPassword != "" {
|
||||||
|
// create default admin account at startup
|
||||||
|
_, err = manager.Insert("admin", manager.config.AdminPassword, types.MemberProfile{
|
||||||
|
Name: "Administrator",
|
||||||
|
IsAdmin: true,
|
||||||
|
CanLogin: true,
|
||||||
|
CanConnect: true,
|
||||||
|
CanWatch: true,
|
||||||
|
CanHost: true,
|
||||||
|
CanAccessClipboard: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if manager.config.UserPassword != "" {
|
||||||
|
// create default user account at startup
|
||||||
|
_, err = manager.Insert("user", manager.config.UserPassword, types.MemberProfile{
|
||||||
|
Name: "User",
|
||||||
|
IsAdmin: false,
|
||||||
|
CanLogin: true,
|
||||||
|
CanConnect: true,
|
||||||
|
CanWatch: true,
|
||||||
|
CanHost: true,
|
||||||
|
CanAccessClipboard: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *MemberManagerCtx) Disconnect() error {
|
func (manager *MemberManagerCtx) Disconnect() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user