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

Added properties to dir: settings (misc), can_upload, can_download, is_exempt

and is_operator.
parent c9a361cc
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,10 @@ JSObject* DLLCALL js_CreateFileAreaObject(JSContext* cx, JSObject* parent, scfg_
if(!JS_SetProperty(cx, dirobj, "description", &val))
return(NULL);
val=INT_TO_JSVAL(cfg->dir[d]->misc);
if(!JS_SetProperty(cx, dirobj, "settings", &val))
return(NULL);
sprintf(vpath,"/%s/%s/%s"
,cfg->lib[l]->sname
,cfg->dir[d]->code
......@@ -146,6 +150,34 @@ JSObject* DLLCALL js_CreateFileAreaObject(JSContext* cx, JSObject* parent, scfg_
if(!JS_SetProperty(cx, dirobj, "link", &val))
return(NULL);
if(user==NULL || chk_ar(cfg,cfg->dir[d]->ul_ar,user))
val=BOOLEAN_TO_JSVAL(JS_TRUE);
else
val=BOOLEAN_TO_JSVAL(JS_FALSE);
if(!JS_SetProperty(cx, dirobj, "can_upload", &val))
return(NULL);
if(user==NULL || chk_ar(cfg,cfg->dir[d]->dl_ar,user))
val=BOOLEAN_TO_JSVAL(JS_TRUE);
else
val=BOOLEAN_TO_JSVAL(JS_FALSE);
if(!JS_SetProperty(cx, dirobj, "can_download", &val))
return(NULL);
if(user==NULL || chk_ar(cfg,cfg->dir[d]->ex_ar,user))
val=BOOLEAN_TO_JSVAL(JS_TRUE);
else
val=BOOLEAN_TO_JSVAL(JS_FALSE);
if(!JS_SetProperty(cx, dirobj, "is_exempt", &val))
return(NULL);
if(user==NULL || chk_ar(cfg,cfg->dir[d]->op_ar,user))
val=BOOLEAN_TO_JSVAL(JS_TRUE);
else
val=BOOLEAN_TO_JSVAL(JS_FALSE);
if(!JS_SetProperty(cx, dirobj, "is_operator", &val))
return(NULL);
if(!JS_GetArrayLength(cx, dir_list, &index)) /* inexplicable exception here on Jul-6-2001 */
return(NULL); /* and again on Aug-7-2001 and Oct-21-2001 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment