forked from x/icebergs
opt status
This commit is contained in:
parent
ed97853635
commit
1ae76b6c99
@ -42,6 +42,14 @@ func _user_search(m *ice.Message, kind, name, text string) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UserRoot(m *ice.Message) {
|
||||||
|
m.Option(ice.MSG_USERNAME, ice.Info.UserName)
|
||||||
|
m.Option(ice.MSG_USERROLE, ROOT)
|
||||||
|
|
||||||
|
if m.Richs(USER, "", ice.Info.UserName, nil) == nil {
|
||||||
|
_user_create(m, ice.Info.UserName, kit.Hashs())
|
||||||
|
}
|
||||||
|
}
|
||||||
func UserZone(m *ice.Message, username interface{}) (zone string) {
|
func UserZone(m *ice.Message, username interface{}) (zone string) {
|
||||||
m.Richs(USER, nil, kit.Format(username), func(key string, value map[string]interface{}) {
|
m.Richs(USER, nil, kit.Format(username), func(key string, value map[string]interface{}) {
|
||||||
value = kit.GetMeta(value)
|
value = kit.GetMeta(value)
|
||||||
|
@ -290,9 +290,8 @@ func (f *Frame) Start(m *ice.Message, arg ...string) bool {
|
|||||||
r, f.stdout = os.Stdin, os.Stdout
|
r, f.stdout = os.Stdin, os.Stdout
|
||||||
|
|
||||||
m.Option(ice.MSG_OPTS, ice.MSG_USERNAME)
|
m.Option(ice.MSG_OPTS, ice.MSG_USERNAME)
|
||||||
m.Option(ice.MSG_USERNAME, ice.Info.UserName)
|
aaa.UserRoot(m)
|
||||||
m.Option(ice.MSG_USERROLE, aaa.ROOT)
|
|
||||||
m.Option(ice.MSG_USERZONE, "boot")
|
|
||||||
default:
|
default:
|
||||||
f.target = m.Source()
|
f.target = m.Source()
|
||||||
|
|
||||||
|
@ -157,8 +157,9 @@ func _serve_login(msg *ice.Message, cmds []string, w http.ResponseWriter, r *htt
|
|||||||
aaa.SessCheck(msg, msg.Option(ice.MSG_SESSID))
|
aaa.SessCheck(msg, msg.Option(ice.MSG_SESSID))
|
||||||
// 会话认证
|
// 会话认证
|
||||||
}
|
}
|
||||||
|
|
||||||
if msg.Option(ice.MSG_USERNAME) == "" && tcp.IsLocalHost(msg, msg.Option(ice.MSG_USERIP)) && msg.Conf(SERVE, kit.Keym(tcp.LOCALHOST)) == "true" {
|
if msg.Option(ice.MSG_USERNAME) == "" && tcp.IsLocalHost(msg, msg.Option(ice.MSG_USERIP)) && msg.Conf(SERVE, kit.Keym(tcp.LOCALHOST)) == "true" {
|
||||||
aaa.UserLogin(msg, ice.Info.UserName, ice.Info.PassWord)
|
aaa.UserRoot(msg)
|
||||||
// 主机认证
|
// 主机认证
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user