]> code.citadel.org Git - citadel.git/blobdiff - webcit/webcit.c
Completed the 'upload a file' dialog.
[citadel.git] / webcit / webcit.c
index afb88822e97c15f98147753a48a19e4b2f0459de..c8a49e6025a6343dacf60fa7ab48bd13e2d07214 100644 (file)
@@ -1013,7 +1013,7 @@ void session_loop(struct httprequest *req)
        char user_agent[256];
        int body_start = 0;
        int is_static = 0;
-
+       int n_static = 0;
        /**
         * We stuff these with the values coming from the client cookies,
         * so we can use them to reconnect a timed out session if we have to.
@@ -1173,13 +1173,15 @@ void session_loop(struct httprequest *req)
        for (a=0; a<ndirs; ++a) {
                if (!strcasecmp(action, (char*)static_content_dirs[a])) { /* map web to disk location */
                        is_static = 1;
+                       n_static = a;
                }
        }
        if (is_static) {
                if (nBackDots < 2)
                {
                        snprintf(buf, sizeof buf, "%s/%s/%s/%s/%s/%s/%s/%s",
-                                index[0], index[1], index[2], index[3], index[4], index[5], index[6], index[7]);
+                                static_dirs[n_static], 
+                                index[1], index[2], index[3], index[4], index[5], index[6], index[7]);
                        for (a=0; a<8; ++a) {
                                if (buf[strlen(buf)-1] == '/') {
                                        buf[strlen(buf)-1] = 0;
@@ -1654,6 +1656,12 @@ void session_loop(struct httprequest *req)
                wDumpContent(1);
        } else if (!strcasecmp(action, "updatenote")) {
                updatenote();
+       } else if (!strcasecmp(action, "display_room_directory")) {
+               display_room_directory();
+       } else if (!strcasecmp(action, "download_file")) {
+               download_file(index[1]);
+       } else if (!strcasecmp(action, "upload_file")) {
+               upload_file();
        }
 
        /** When all else fais, display the main menu. */