forked from x/icebergs
opt some
This commit is contained in:
parent
01bacc73a2
commit
af0d446abc
@ -210,6 +210,11 @@ func _serve_auth(m *ice.Message, key string, cmds []string, w http.ResponseWrite
|
|||||||
return kit.Simple(m.Time(), m.OptionSplit(ice.MSG_USERNICK, ice.MSG_USERNAME, ice.MSG_USERROLE))
|
return kit.Simple(m.Time(), m.OptionSplit(ice.MSG_USERNICK, ice.MSG_USERNAME, ice.MSG_USERROLE))
|
||||||
})); len(ls) > 0 {
|
})); len(ls) > 0 {
|
||||||
aaa.SessAuth(m, kit.Dict(aaa.USERNICK, ls[1], aaa.USERNAME, ls[2], aaa.USERROLE, ls[3]), CACHE, ls[0])
|
aaa.SessAuth(m, kit.Dict(aaa.USERNICK, ls[1], aaa.USERNAME, ls[2], aaa.USERROLE, ls[3]), CACHE, ls[0])
|
||||||
|
} else {
|
||||||
|
msg := m.Cmd(SPIDE, aaa.USER, "msg", http.MethodPost, "/chat/header/action/info", ice.MSG_SESSID, m.Option(ice.MSG_SESSID))
|
||||||
|
if msg.Option(ice.MSG_USERNAME) != "" {
|
||||||
|
aaa.SessCheck(m, m.Option(ice.MSG_SESSID, aaa.SessCreate(m, msg.Option(ice.MSG_USERNAME))))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Count(m, aaa.IP, m.Option(ice.MSG_USERIP), m.Option(ice.MSG_USERUA))
|
Count(m, aaa.IP, m.Option(ice.MSG_USERIP), m.Option(ice.MSG_USERUA))
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/cli"
|
"shylinux.com/x/icebergs/base/cli"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/log"
|
"shylinux.com/x/icebergs/base/log"
|
||||||
@ -201,6 +202,7 @@ func _spide_save(m *ice.Message, action, file, uri string, res *http.Response) {
|
|||||||
case SPIDE_MSG:
|
case SPIDE_MSG:
|
||||||
var data map[string][]string
|
var data map[string][]string
|
||||||
m.Assert(json.NewDecoder(res.Body).Decode(&data))
|
m.Assert(json.NewDecoder(res.Body).Decode(&data))
|
||||||
|
kit.For(data[ice.MSG_OPTION], func(k string) { m.Options(k, data[k]) })
|
||||||
kit.For(data[ice.MSG_APPEND], func(k string) { kit.For(data[k], func(v string) { m.Push(k, v) }) })
|
kit.For(data[ice.MSG_APPEND], func(k string) { kit.For(data[k], func(v string) { m.Push(k, v) }) })
|
||||||
m.Resultv(data[ice.MSG_RESULT])
|
m.Resultv(data[ice.MSG_RESULT])
|
||||||
case SPIDE_SAVE:
|
case SPIDE_SAVE:
|
||||||
@ -293,6 +295,7 @@ func init() {
|
|||||||
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), ice.OPS, nfs.USR_ICONS_CONTEXTS, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), ice.OPS, nfs.USR_ICONS_CONTEXTS, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:20000", conf[cli.CTX_DEMO]), ice.DEMO, nfs.USR_ICONS_VOLCANOS)
|
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:20000", conf[cli.CTX_DEMO]), ice.DEMO, nfs.USR_ICONS_VOLCANOS)
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png")
|
m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png")
|
||||||
|
m.Cmd("", mdb.CREATE, kit.Select("https://user.shylinux.com"), aaa.USER, "usr/icons/Mail.png")
|
||||||
}},
|
}},
|
||||||
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.IsSearchPreview(m, arg) {
|
if mdb.IsSearchPreview(m, arg) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package chat
|
package chat
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -130,6 +131,14 @@ func init() {
|
|||||||
m.Echo("login failure")
|
m.Echo("login failure")
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
ice.INFO: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {}},
|
||||||
|
aaa.USER: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
msg := m.Cmd(web.SPIDE, aaa.USER, "msg", http.MethodPost, "/chat/header/action/info", ice.MSG_SESSID, kit.Select(m.Option(ice.MSG_SESSID), arg, 0))
|
||||||
|
if msg.Option(ice.MSG_USERNAME) != "" {
|
||||||
|
aaa.SessCheck(m, m.Option(ice.MSG_SESSID, aaa.SessCreate(m, msg.Option(ice.MSG_USERNAME))))
|
||||||
|
m.Echo(m.Option(ice.MSG_SESSID))
|
||||||
|
}
|
||||||
|
}},
|
||||||
}, web.ApiAction(), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,help,icons,order,link,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
}, web.ApiAction(), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,help,icons,order,link,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if ice.Info.NodeType == web.WORKER {
|
if ice.Info.NodeType == web.WORKER {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user