X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fctdlproto%2Fserv_file.c;fp=citadel%2Fmodules%2Fctdlproto%2Fserv_file.c;h=c1e97d2f690b42cd7bc3cd5ce06d9134e5ef5424;hb=9cd327ec3b9efa44055c417dae722bc5375345b2;hp=7f75b4e2647562b1d5dd6741fcf45708893a706f;hpb=8c8db9a95457aa06b787c65ecdb6c926d6a2106f;p=citadel.git diff --git a/citadel/modules/ctdlproto/serv_file.c b/citadel/modules/ctdlproto/serv_file.c index 7f75b4e26..c1e97d2f6 100644 --- a/citadel/modules/ctdlproto/serv_file.c +++ b/citadel/modules/ctdlproto/serv_file.c @@ -246,25 +246,14 @@ void cmd_oimg(char *cmdbuf) return; } - if (!strcasecmp(filename, "_userpic_")) { - extract_token(which_user, cmdbuf, 1, '|', sizeof which_user); - if (CtdlGetUser(&usbuf, which_user) != 0) { - cprintf("%d No such user.\n", - ERROR + NO_SUCH_USER); - return; - } - snprintf(pathname, sizeof pathname, - "%s/%ld", - ctdl_usrpic_dir, - usbuf.usernum); - } else if (!strcasecmp(filename, "_floorpic_")) { + if (!strcasecmp(filename, "_floorpic_")) { which_floor = extract_int(cmdbuf, 1); - snprintf(pathname, sizeof pathname, - "%s/floor.%d", - ctdl_image_dir, which_floor); - } else if (!strcasecmp(filename, "_roompic_")) { + snprintf(pathname, sizeof pathname, "%s/floor.%d", ctdl_image_dir, which_floor); + } + else if (!strcasecmp(filename, "_roompic_")) { assoc_file_name(pathname, sizeof pathname, &CC->room, ctdl_image_dir); - } else { + } + else { for (a = 0; !IsEmptyStr(&filename[a]); ++a) { filename[a] = tolower(filename[a]); if ( (filename[a] == '/') || (filename[a] == '\\') ) { @@ -305,6 +294,7 @@ void cmd_oimg(char *cmdbuf) OpenCmdResult(pathname, GuessMimeType(&MimeTestBuf[0], 32)); } + /* * open a file for uploading */