signup
This commit is contained in:
parent
00145e662b
commit
6d0b928b0e
|
@ -270,7 +270,19 @@ func SignUpUser(w http.ResponseWriter, r *http.Request) {
|
||||||
if userCreated != msg {
|
if userCreated != msg {
|
||||||
succ = false
|
succ = false
|
||||||
data["msg"] = msg
|
data["msg"] = msg
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create a HTTP session
|
||||||
|
httpSession, _ := HTTPSession.Get(r, "wide-session")
|
||||||
|
httpSession.Values["username"] = username
|
||||||
|
httpSession.Values["id"] = strconv.Itoa(rand.Int())
|
||||||
|
httpSession.Options.MaxAge = conf.Wide.HTTPSessionMaxAge
|
||||||
|
if "" != conf.Wide.Context {
|
||||||
|
httpSession.Options.Path = conf.Wide.Context
|
||||||
|
}
|
||||||
|
httpSession.Save(r, w)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FixedTimeSave saves online users' configurations periodically (1 minute).
|
// FixedTimeSave saves online users' configurations periodically (1 minute).
|
||||||
|
|
|
@ -50,13 +50,16 @@ var session = {
|
||||||
}, 30000);
|
}, 30000);
|
||||||
},
|
},
|
||||||
restore: function () {
|
restore: function () {
|
||||||
|
if (!config.latestSessionContent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var fileTree = config.latestSessionContent.FileTree,
|
var fileTree = config.latestSessionContent.FileTree,
|
||||||
files = config.latestSessionContent.Files,
|
files = config.latestSessionContent.Files,
|
||||||
currentFile = config.latestSessionContent.CurrentFile,
|
currentFile = config.latestSessionContent.CurrentFile,
|
||||||
id = "",
|
id = "",
|
||||||
nodesToOpen = [];
|
nodesToOpen = [];
|
||||||
|
|
||||||
|
|
||||||
var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());
|
var nodes = tree.fileTree.transformToArray(tree.fileTree.getNodes());
|
||||||
|
|
||||||
for (var i = 0, ii = nodes.length; i < ii; i++) {
|
for (var i = 0, ii = nodes.length; i < ii; i++) {
|
||||||
|
|
Loading…
Reference in New Issue