Skip to content
Snippets Groups Projects
Commit 12451e1b authored by rswindell's avatar rswindell
Browse files

Created bbs good_passwordl() method, used to check if a requested user

password meets the minimum password requirements (length, uniqueness, etc).
parent aa65e8fe
No related branches found
No related tags found
No related merge requests found
...@@ -1015,6 +1015,21 @@ js_chksyspass(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval ...@@ -1015,6 +1015,21 @@ js_chksyspass(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
return(JS_TRUE); return(JS_TRUE);
} }
static JSBool
js_chkpass(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
sbbs_t* sbbs;
if((sbbs=(sbbs_t*)JS_GetContextPrivate(cx))==NULL)
return(JS_FALSE);
JSString* str=JS_ValueToString(cx,argv[0]);
*rval = BOOLEAN_TO_JSVAL(sbbs->chkpass(JS_GetStringBytes(str),&sbbs->useron,true));
return(JS_TRUE);
}
static JSBool static JSBool
js_text(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) js_text(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{ {
...@@ -2651,7 +2666,10 @@ static jsMethodSpec js_bbs_functions[] = { ...@@ -2651,7 +2666,10 @@ static jsMethodSpec js_bbs_functions[] = {
/* security */ /* security */
{"check_syspass", js_chksyspass, 0, JSTYPE_BOOLEAN, "" {"check_syspass", js_chksyspass, 0, JSTYPE_BOOLEAN, ""
,JSDOCSTR("prompt for and verify system password") ,JSDOCSTR("prompt for and verify system password")
}, },
{"good_password", js_chkpass, 1, JSTYPE_STRING, JSDOCSTR("string password")
,JSDOCSTR("check if requested user password meets minimum password requirements (length, uniqueness, etc.)")
},
/* chat/node stuff */ /* chat/node stuff */
{"page_sysop", js_pagesysop, 0, JSTYPE_BOOLEAN, "" {"page_sysop", js_pagesysop, 0, JSTYPE_BOOLEAN, ""
,JSDOCSTR("page the sysop for chat") ,JSDOCSTR("page the sysop for chat")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment