• bbs.logout() vs bbs.logoff() vs bbs.hangup()

    From nolageek@CAPSHRIL to All on Thursday, March 24, 2016 23:50:31
    I'm still working on my shell and I'm trying to fine tune how I'd like my two logout options to work.


    'Regular Log Out' (runs a one liner, then asks user if they really want to log out.) For this option I've been using bbs.logoff(), but it uses noyes (no is the default) - I'd rather it be yesno (yes being the default) I figure I could just use console.yesno('Log Out') and log them out if they reply yes. But I'm trying to choose the most appropriate function: bbs.logout(), bbs.logoff() or bbs.hangup()


    (I also have a 'Fast Log Out' which immediately logs then out without any prompts whatsoever.)

    So for both of them I need to hang them up, either after being prompt or immediately.

    I've been using bbs.hangup(); to just drop carrier, but I was wondering if that's the best way or not.

    I see that bbs.logout() is listed as 'non-interactive' but it doesn't seem to do anything - it just takes me right back to the menu.

    I also see that bbs.logoff() can take an prompt argument but I've tried multiple ways and they all continue to prompt the user: bbs.logoff('false'), bbs.logoff(false), bbs.logoff(prompt=false), bbs.logoff('prompt=false'), etc...


    Tl;dr
    How can I immediately log off the user without prompting them? bbs.logoff(), bbs.logout(), bbs.hangup() ?

    |01-|03nolageek

    ---
    ■ Synchronet ■ Capitol Shrill BBS - Washington, DC - capitolshrill.com
  • From echicken@ECBBS to nolageek on Friday, March 25, 2016 12:30:58
    I also see that bbs.logoff() can take an prompt argument but I've tried multiple ways and they all continue to prompt the user: bbs.logoff('false'), bbs.logoff(false), bbs.logoff(prompt=false), bbs.logoff('prompt=false'), etc...

    bbs.logoff(false) works for me, and I would expect it to do what you want. I am still on 3.16 though, so perhaps something has changed since then.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    ■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com
  • From nolageek@CAPSHRIL to echicken on Friday, March 25, 2016 22:04:44
    Re: bbs.logout() vs bbs.logoff() vs bbs.hangup()
    By: echicken to nolageek on Fri Mar 25 2016 12:30 pm

    bbs.logoff(false) works for me, and I would expect it to do what you want. I am still on 3.16 though, so perhaps something has changed since then.

    I'll have to try them again in a bit. So close.

    One last thing I'm trying to let the user edit is their signature. Do you
    know what is that stored as? It's not user.signature :)

    |01-|03nolageek

    ---
    ■ Synchronet ■ Capitol Shrill BBS - Washington, DC - capitolshrill.com
  • From echicken@ECBBS to nolageek on Saturday, March 26, 2016 14:28:16
    One last thing I'm trying to let the user edit is their signature. Do you know what is that stored as? It's not user.signature :)

    I believe it's stored in 'data/user/####.sig', so something like this ought to work:

    console.editfile(format('%suser/%04d.sig', system.data_dir, user.number));

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
    ■ Synchronet ■ electronic chicken bbs - bbs.electronicchicken.com
  • From Digital Man to nolageek on Monday, March 28, 2016 16:44:27
    Re: bbs.logout() vs bbs.logoff() vs bbs.hangup()
    By: nolageek to All on Thu Mar 24 2016 11:50 pm

    I'm still working on my shell and I'm trying to fine tune how I'd like my two logout options to work.


    'Regular Log Out' (runs a one liner, then asks user if they really want to log out.) For this option I've been using bbs.logoff(), but it uses noyes (no is the default) - I'd rather it be yesno (yes being the default) I figure I could just use console.yesno('Log Out') and log them out if they reply yes. But I'm trying to choose the most appropriate function: bbs.logout(), bbs.logoff() or bbs.hangup()


    (I also have a 'Fast Log Out' which immediately logs then out without any prompts whatsoever.)

    So for both of them I need to hang them up, either after being prompt or immediately.

    I've been using bbs.hangup(); to just drop carrier, but I was wondering if that's the best way or not.

    I see that bbs.logout() is listed as 'non-interactive' but it doesn't seem to do anything - it just takes me right back to the menu.

    I also see that bbs.logoff() can take an prompt argument but I've tried multiple ways and they all continue to prompt the user: bbs.logoff('false'), bbs.logoff(false), bbs.logoff(prompt=false), bbs.logoff('prompt=false'), etc...


    Tl;dr
    How can I immediately log off the user without prompting them? bbs.logoff(), bbs.logout(), bbs.hangup() ?

    bbs.hangup() will do that.

    You don't need/want to call bbs.logout() normally. That's really only needed for a "re-login" or "change user" type of feature. When the user is disconnected in any way, the bbs.logout() logic is executed automatically, you don't need to force it.

    bbs.logoff() starts interactive stuff before hanging up. If don't want anything interactive before disconnecting the user, bbs.hangup() is all you need to do.

    digital man

    Synchronet "Real Fact" #83:
    The Electronic Frontier Foundation used to run Synchronet (circa 1993).
    Norco, CA WX: 59.6°F, 56.0% humidity, 14 mph NNE wind, 0.00 inches rain/24hrs