Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 1a00f950 authored by rswindell's avatar rswindell

Create sbbs_t::js_create_user_objects(), creates user, msg_area, and file_area

objects during user logon and newuser creation.
parent 0b4d359d
......@@ -68,19 +68,7 @@ bool sbbs_t::logon()
client_on(client_socket,&client,TRUE /* update */);
#ifdef JAVASCRIPT
if(js_cx!=NULL) {
/* user object */
if(js_CreateUserObject(js_cx, js_glob, &cfg, "user", useron.number)==NULL)
lprintf("!JavaScript ERROR creating user object");
/* file_area object */
if(js_CreateFileAreaObject(js_cx, js_glob, &cfg, &useron, "")==NULL)
lprintf("!JavaScript ERROR creating file_area object");
/* msg_area object */
if(js_CreateMsgAreaObject(js_cx, js_glob, &cfg, &useron, subscan)==NULL)
lprintf("!JavaScript ERROR creating msg_area object");
}
js_create_user_objects();
#endif
if(useron.rest&FLAG('Q'))
......
......@@ -556,6 +556,24 @@ bool sbbs_t::js_init()
return(true);
}
void sbbs_t::js_create_user_objects(void)
{
if(js_cx==NULL)
return;
/* user object */
if(js_CreateUserObject(js_cx, js_glob, &cfg, "user", useron.number)==NULL)
lprintf("!JavaScript ERROR creating user object");
/* file_area object */
if(js_CreateFileAreaObject(js_cx, js_glob, &cfg, &useron, "")==NULL)
lprintf("!JavaScript ERROR creating file_area object");
/* msg_area object */
if(js_CreateMsgAreaObject(js_cx, js_glob, &cfg, &useron, subscan)==NULL)
lprintf("!JavaScript ERROR creating msg_area object");
}
#endif /* JAVASCRIPT */
#ifdef _WINSOCKAPI_
......
......@@ -483,6 +483,10 @@ void sbbs_t::newuser()
sprintf(str,"%suser/%04u.sig",cfg.data_dir,useron.number); /* delete signature */
remove(str);
#ifdef JAVASCRIPT
js_create_user_objects();
#endif
if(cfg.newuser_mod[0])
exec_bin(cfg.newuser_mod,&main_csi);
user_event(EVENT_NEWUSER);
......
......@@ -186,6 +186,7 @@ public:
ulong js_loop;
long js_execfile(char *fname);
bool js_init(void);
void js_create_user_objects(void);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment