• src/sbbs3/ftpsrvr.c js_file_area.c sbbs_ini.c userdat.c userdat.h webs

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Sunday, March 20, 2022 15:05:46
    https://gitlab.synchro.net/main/sbbs/-/commit/23a82123e0c2988d12d90868
    Modified Files:
    src/sbbs3/ftpsrvr.c js_file_area.c sbbs_ini.c userdat.c userdat.h websrvr.c websrvr.h
    Log Message:
    Add dynamic file area/base indexing to web server

    By setting sbbs.ini [web] FileIndexScript to an SSJS or XJS script filename, that script (by default, from your exec directory) will be executed when a file area/base listing has been http[s]-requested. File area/base requests are of the form <vpath_prefix> (for the list of libraries), <vpath_prefix>/<lib-name>/ (for list of directories of a library) or <vpath_prefix>/<lib-name>/<dir-code-suffix>/ (for a list of files in a directory). The new http_request "lib" and "dir" properties indicate that a library or directory listing was requested (if neither are defined, that's a request for the root / list of libs). The same configured script is executed to handle all 3 types of index/list requests.

    A sample script (webfileindex.ssj) will be committed soon.

    Authentication (via HTTP-AUTH) will be required if user #0 does not have access to all libraries or all directories within a required library.

    file_area.lib[].link has been changed from "/<vdir>/" to just "<vdir>" (no slashes) and renamed to "vdir".

    file_area.dir[].link has been changed from "/<vpath>/" to "<vpath>/" (no leading slash) and renamed to "vpath".

    Added file_area.dir[].vdir property that contains just the directory's virtual directory name.

    I don't think anyone was using these "link" properties since the dynamic FTP HTML index scripting feature is no longer supported.

    Added can_user_access_lib() to insure that the user has access to at least one directory of a library before allowing access to the library (e.g. via JS). Something similar should be created for message groups.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net