mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-07 13:15:28 +02:00
* Better handling of TOONODE (existing user already logged in)
This commit is contained in:
parent
723f9d554f
commit
7cc1fe55c0
1 changed files with 2 additions and 20 deletions
|
@ -22,26 +22,8 @@ function login(callingMenu, formData, extraArgs) {
|
||||||
userLogin(callingMenu.client, formData.value.username, formData.value.password, function authResult(err) {
|
userLogin(callingMenu.client, formData.value.username, formData.value.password, function authResult(err) {
|
||||||
if(err) {
|
if(err) {
|
||||||
// login failure
|
// login failure
|
||||||
if(err.existingConn) {
|
if(err.existingConn && _.has(callingMenu, 'menuConfig.config.tooNodeMenu')) {
|
||||||
client.term.rawWrite(ansi.resetScreen());
|
callingMenu.gotoMenu(callingMenu.menuConfig.config.tooNodeMenu);
|
||||||
|
|
||||||
var artOpts = {
|
|
||||||
client : client,
|
|
||||||
font : _.has(callingMenu, 'menuConfig.config.tooNode.font') ? callingMenu.menuConfig.config.tooNode.font : null,
|
|
||||||
name : _.has(callingMenu, 'menuConfig.config.tooNode.art') ? callingMenu.menuConfig.config.tooNode.art : 'TOONODE',
|
|
||||||
};
|
|
||||||
|
|
||||||
theme.displayThemeArt(artOpts, function artDisplayed(err) {
|
|
||||||
if(err) {
|
|
||||||
client.term.write('\nA user by that name is already logged in.\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(function timeout() {
|
|
||||||
callingMenu.prevMenu();
|
|
||||||
}, 2000);
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
// Other error
|
// Other error
|
||||||
callingMenu.prevMenu();
|
callingMenu.prevMenu();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue