Skip to content
Snippets Groups Projects
Commit c9e2c1fb authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

bbs.logoff() now returns a boolean: false if log-off was denied

Previously, there was no good way for the caller to determine if the\
user opted (when prompted) to actually log-off or not.
parent 4573dfb8
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3918 passed
...@@ -1940,7 +1940,7 @@ js_logoff(JSContext *cx, uintN argc, jsval *arglist) ...@@ -1940,7 +1940,7 @@ js_logoff(JSContext *cx, uintN argc, jsval *arglist)
if((sbbs=js_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL) if((sbbs=js_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL)
return(JS_FALSE); return(JS_FALSE);
JS_SET_RVAL(cx, arglist, JSVAL_VOID); JS_SET_RVAL(cx, arglist, JSVAL_FALSE);
if(argc) if(argc)
JS_ValueToBoolean(cx,argv[0],&prompt); JS_ValueToBoolean(cx,argv[0],&prompt);
...@@ -1953,6 +1953,7 @@ js_logoff(JSContext *cx, uintN argc, jsval *arglist) ...@@ -1953,6 +1953,7 @@ js_logoff(JSContext *cx, uintN argc, jsval *arglist)
sbbs->menu("logoff"); sbbs->menu("logoff");
sbbs->sync(); sbbs->sync();
sbbs->hangup(); sbbs->hangup();
JS_SET_RVAL(cx, arglist, JSVAL_TRUE);
} }
JS_RESUMEREQUEST(cx, rc); JS_RESUMEREQUEST(cx, rc);
...@@ -4406,8 +4407,8 @@ static jsSyncMethodSpec js_bbs_functions[] = { ...@@ -4406,8 +4407,8 @@ static jsSyncMethodSpec js_bbs_functions[] = {
,JSDOCSTR("interactive logon procedure") ,JSDOCSTR("interactive logon procedure")
,310 ,310
}, },
{"logoff", js_logoff, 1, JSTYPE_VOID, JSDOCSTR("[prompt=<i>true</i>]") {"logoff", js_logoff, 1, JSTYPE_BOOLEAN, JSDOCSTR("[prompt=<i>true</i>]")
,JSDOCSTR("interactive logoff procedure, pass <i>false</i> for <i>prompt</i> argument to avoid yes/no prompt") ,JSDOCSTR("interactive logoff procedure, pass <i>false</i> for <i>prompt</i> argument to avoid yes/no prompt, returns <i>false</i> if denied logoff")
,315 ,315
}, },
{"logout", js_logout, 0, JSTYPE_VOID, JSDOCSTR("") {"logout", js_logout, 0, JSTYPE_VOID, JSDOCSTR("")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment