From 3051e63651cd7cc4249641f3c91a54a107fefe47 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 27 Sep 2007 19:19:03 +0000 Subject: [PATCH] The 'edit or delete this room' menu is now accessible by ordinary users for mailbox rooms which belong to them. They are presented with an abbreviated set of tabs which reflect only the functions available to them. --- webcit/mainmenu.c | 2 +- webcit/roomops.c | 621 ++++++++++++++++++++++++---------------------- 2 files changed, 320 insertions(+), 303 deletions(-) diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index da4b60d8e..c7966490c 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -130,7 +130,7 @@ void display_main_menu(void) snprintf(buf, SIZ, _("Zap (forget) this room (%s)"), WC->wc_roomname); - if ((WC->axlevel >= 6) || (WC->is_room_aide)) + if ( (WC->axlevel >= 6) || (WC->is_room_aide) || (WC->is_mailbox) ) print_menu_box(_("Advanced room commands"),"adminitems", 5, "display_editroom", _("Edit or delete this room"), "display_private", _("Go to a 'hidden' room"), diff --git a/webcit/roomops.c b/webcit/roomops.c index 99030fb02..565a37f37 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1038,21 +1038,6 @@ void display_editroom(void) if (IsEmptyStr(tab)) tab = "admin"; load_floorlist(); - serv_puts("GETR"); - serv_getln(buf, sizeof buf); - - if (buf[0] != '2') { - strcpy(WC->ImportantMessage, &buf[4]); - display_main_menu(); - return; - } - extract_token(er_name, &buf[4], 0, '|', sizeof er_name); - extract_token(er_password, &buf[4], 1, '|', sizeof er_password); - extract_token(er_dirname, &buf[4], 2, '|', sizeof er_dirname); - er_flags = extract_int(&buf[4], 3); - er_floor = extract_int(&buf[4], 4); - er_flags2 = extract_int(&buf[4], 7); - output_headers(1, 1, 1, 0, 0, 0); wprintf("
"); @@ -1072,65 +1057,69 @@ void display_editroom(void) } wprintf("\n"); - wprintf("
  • "); - wprintf(_("Configuration")); - } - else { - wprintf(" tab_cell_edit\">"); - wprintf(_("Configuration")); - wprintf(""); - } - wprintf("
  • \n"); + if ( (WC->axlevel >= 6) || (WC->is_room_aide) ) { + + wprintf("
  • "); + wprintf(_("Configuration")); + } + else { + wprintf(" tab_cell_edit\">"); + wprintf(_("Configuration")); + wprintf(""); + } + wprintf("
  • \n"); + + wprintf("
  • "); + wprintf(_("Message expire policy")); + } + else { + wprintf(" tab_cell_edit\">"); + wprintf(_("Message expire policy")); + wprintf(""); + } + wprintf("
  • \n"); - wprintf("
  • "); - wprintf(_("Message expire policy")); - } - else { - wprintf(" tab_cell_edit\">"); - wprintf(_("Message expire policy")); - wprintf(""); - } - wprintf("
  • \n"); + wprintf("
  • "); + wprintf(_("Access controls")); + } + else { + wprintf(" tab_cell_edit\">"); + wprintf(_("Access controls")); + wprintf(""); + } + wprintf("
  • \n"); - wprintf("
  • "); - wprintf(_("Access controls")); - } - else { - wprintf(" tab_cell_edit\">"); - wprintf(_("Access controls")); - wprintf(""); - } - wprintf("
  • \n"); + wprintf("
  • "); + wprintf(_("Sharing")); + } + else { + wprintf(" tab_cell_edit\">"); + wprintf(_("Sharing")); + wprintf(""); + } + wprintf("
  • \n"); - wprintf("
  • "); - wprintf(_("Sharing")); - } - else { - wprintf(" tab_cell_edit\">"); - wprintf(_("Sharing")); - wprintf(""); - } - wprintf("
  • \n"); + wprintf("
  • "); + wprintf(_("Mailing list service")); + } + else { + wprintf("< tab_cell_edit\">"); + wprintf(_("Mailing list service")); + wprintf(""); + } + wprintf("
  • \n"); - wprintf("
  • "); - wprintf(_("Mailing list service")); - } - else { - wprintf("< tab_cell_edit\">"); - wprintf(_("Mailing list service")); - wprintf(""); } - wprintf("
  • \n"); wprintf("
  • "); - wprintf("
    \n"); - wprintf("\n", WC->nonce); - - wprintf("
    • "); - wprintf(_("Name of room: ")); - wprintf("\n", - er_name, - (sizeof(er_name)-1) - ); - - wprintf("
    • "); - wprintf(_("Resides on floor: ")); - wprintf("\n"); - - wprintf("
    • "); - wprintf(_("Type of room:")); - wprintf("
        \n"); - - wprintf("
      • "); - wprintf(_("Public (automatically appears to everyone)")); - wprintf("\n"); - - wprintf("
      • "); - wprintf(_("Private - hidden (accessible to anyone who knows its name)")); - - wprintf("\n
      • "); - wprintf(_("Private - require password: ")); - wprintf("\n\n", - er_password); - - wprintf("
      • "); - wprintf(_("Private - invitation only")); - - wprintf("\n
      • "); - wprintf(_("If private, cause current users to forget room")); - - wprintf("\n
      \n"); - - wprintf("
    • "); - wprintf(_("Preferred users only")); - - wprintf("\n
    • "); - wprintf(_("Read-only room")); - - wprintf("\n
    • "); - wprintf(_("All users allowed to post may also delete messages")); - - /** directory stuff */ - wprintf("\n
    • "); - wprintf(_("File directory room")); - - wprintf("\n
      • "); - wprintf(_("Directory name: ")); - wprintf("\n", - er_dirname); + serv_puts("GETR"); + serv_getln(buf, sizeof buf); - wprintf("
      • "); - wprintf(_("Uploading allowed")); + if (!strncmp(buf, "550", 3)) { + wprintf("

        %s


        \n", + _("Higher access is required to access this function.") + ); + } + else if (buf[0] != '2') { + wprintf("

        %s


        \n", &buf[4]); + } + else { + extract_token(er_name, &buf[4], 0, '|', sizeof er_name); + extract_token(er_password, &buf[4], 1, '|', sizeof er_password); + extract_token(er_dirname, &buf[4], 2, '|', sizeof er_dirname); + er_flags = extract_int(&buf[4], 3); + er_floor = extract_int(&buf[4], 4); + er_flags2 = extract_int(&buf[4], 7); - wprintf("\n
      • "); - wprintf(_("Downloading allowed")); + wprintf("\n"); + wprintf("\n", WC->nonce); + + wprintf("
        • "); + wprintf(_("Name of room: ")); + wprintf("\n", + er_name, + (sizeof(er_name)-1) + ); + + wprintf("
        • "); + wprintf(_("Resides on floor: ")); + wprintf("\n"); + + wprintf("
        • "); + wprintf(_("Type of room:")); + wprintf("
            \n"); - wprintf("\n
          • "); - wprintf(_("Visible directory")); - wprintf("
          \n"); + wprintf("> "); + wprintf(_("Public (automatically appears to everyone)")); + wprintf("\n"); - /** end of directory stuff */ - - wprintf("
        • "); - wprintf(_("Network shared room")); - - wprintf("\n
        • "); - wprintf(_("Permanent (does not auto-purge)")); - - wprintf("\n
        • "); - wprintf(_("Subject Required (Force users to specify a message subject)")); - - /** start of anon options */ + wprintf("
        • "); + wprintf(_("Private - hidden (accessible to anyone who knows its name)")); + + wprintf("\n
        • "); + wprintf(_("Private - require password: ")); + wprintf("\n\n", + er_password); + + wprintf("
        • "); + wprintf(_("Private - invitation only")); + + wprintf("\n
        • "); + wprintf(_("If private, cause current users to forget room")); + + wprintf("\n
        \n"); + + wprintf("
      • "); + wprintf(_("Preferred users only")); + + wprintf("\n
      • "); + wprintf(_("Read-only room")); + + wprintf("\n
      • "); + wprintf(_("All users allowed to post may also delete messages")); + + /** directory stuff */ + wprintf("\n
      • "); + wprintf(_("File directory room")); - wprintf("\n
      • "); - wprintf(_("Anonymous messages")); - wprintf("
          \n"); + wprintf("\n
          • "); + wprintf(_("Directory name: ")); + wprintf("\n", + er_dirname); - wprintf("
          • "); - wprintf(_("No anonymous messages")); + wprintf("> "); + wprintf(_("Uploading allowed")); + + wprintf("\n
          • "); + wprintf(_("Downloading allowed")); + + wprintf("\n
          • "); + wprintf(_("Visible directory")); + wprintf("
          \n"); + + /** end of directory stuff */ - wprintf("\n
        • "); - wprintf(_("All messages are anonymous")); + wprintf("
        • "); + wprintf(_("Network shared room")); - wprintf("\n
        • "); - wprintf(_("Prompt user when entering messages")); - wprintf("
        \n"); + wprintf("\n
      • "); + wprintf(_("Permanent (does not auto-purge)")); - /* end of anon options */ + wprintf("\n
      • "); + wprintf(_("Subject Required (Force users to specify a message subject)")); - wprintf("
      • "); - wprintf(_("Room aide: ")); - serv_puts("GETA"); - serv_getln(buf, sizeof buf); - if (buf[0] != '2') { - wprintf("%s\n", &buf[4]); - } else { - extract_token(er_roomaide, &buf[4], 0, '|', sizeof er_roomaide); - wprintf("\n", er_roomaide); - } + /** start of anon options */ + + wprintf("\n
      • "); + wprintf(_("Anonymous messages")); + wprintf("
          \n"); + + wprintf("
        • "); + wprintf(_("No anonymous messages")); - wprintf("
        \n"); - wprintf("\n" - "" - " " - "" - "
        \n", - _("Save changes"), - _("Cancel") - ); + wprintf("\n
      • "); + wprintf(_("All messages are anonymous")); + + wprintf("\n
      • "); + wprintf(_("Prompt user when entering messages")); + wprintf("
      \n"); + + /* end of anon options */ + + wprintf("
    • "); + wprintf(_("Room aide: ")); + serv_puts("GETA"); + serv_getln(buf, sizeof buf); + if (buf[0] != '2') { + wprintf("%s\n", &buf[4]); + } else { + extract_token(er_roomaide, &buf[4], 0, '|', sizeof er_roomaide); + wprintf("\n", er_roomaide); + } + + wprintf("
    \n"); + wprintf("\n" + "" + " " + "" + "
    \n", + _("Save changes"), + _("Cancel") + ); + } wprintf("
  • "); } @@ -1627,86 +1636,94 @@ void display_editroom(void) serv_puts("GPEX room"); serv_getln(buf, sizeof buf); - if (buf[0] == '2') { - roompolicy = extract_int(&buf[4], 0); - roomvalue = extract_int(&buf[4], 1); + if (!strncmp(buf, "550", 3)) { + wprintf("

    %s


    \n", + _("Higher access is required to access this function.") + ); } - - serv_puts("GPEX floor"); - serv_getln(buf, sizeof buf); - if (buf[0] == '2') { - floorpolicy = extract_int(&buf[4], 0); - floorvalue = extract_int(&buf[4], 1); + else if (buf[0] != '2') { + wprintf("

    %s


    \n", &buf[4]); } + else { + roompolicy = extract_int(&buf[4], 0); + roomvalue = extract_int(&buf[4], 1); - wprintf("
    \n"); - wprintf("\n", WC->nonce); - wprintf("\n"); - wprintf("\n"); - - if (WC->axlevel >= 6) { - wprintf("\n"); + serv_puts("GPEX floor"); + serv_getln(buf, sizeof buf); + if (buf[0] == '2') { + floorpolicy = extract_int(&buf[4], 0); + floorvalue = extract_int(&buf[4], 1); + } + + wprintf("
    \n"); + wprintf("\n", WC->nonce); + wprintf("
    "); - wprintf(_("Message expire policy for this room")); - wprintf("
    ("); - escputs(WC->wc_roomname); - wprintf(")
    "); - wprintf("", - ((roompolicy == 0) ? "CHECKED" : "") ); - wprintf(_("Use the default policy for this floor")); - wprintf("
    \n"); - wprintf("", - ((roompolicy == 1) ? "CHECKED" : "") ); - wprintf(_("Never automatically expire messages")); - wprintf("
    \n"); - wprintf("", - ((roompolicy == 2) ? "CHECKED" : "") ); - wprintf(_("Expire by message count")); - wprintf("
    \n"); - wprintf("", - ((roompolicy == 3) ? "CHECKED" : "") ); - wprintf(_("Expire by message age")); - wprintf("
    "); - wprintf(_("Number of messages or days: ")); - wprintf("", roomvalue); - wprintf("

    \n"); wprintf("\n"); + + if (WC->axlevel >= 6) { + wprintf("\n"); + wprintf("\n"); + + wprintf("
    "); - wprintf(_("Message expire policy for this floor")); + wprintf(_("Message expire policy for this room")); wprintf("
    ("); - escputs(floorlist[WC->wc_floor]); + escputs(WC->wc_roomname); wprintf(")
    "); - wprintf("", - ((floorpolicy == 0) ? "CHECKED" : "") ); - wprintf(_("Use the system default")); + wprintf("", + ((roompolicy == 0) ? "CHECKED" : "") ); + wprintf(_("Use the default policy for this floor")); wprintf("
    \n"); - wprintf("", - ((floorpolicy == 1) ? "CHECKED" : "") ); + wprintf("", + ((roompolicy == 1) ? "CHECKED" : "") ); wprintf(_("Never automatically expire messages")); wprintf("
    \n"); - wprintf("", - ((floorpolicy == 2) ? "CHECKED" : "") ); + wprintf("", + ((roompolicy == 2) ? "CHECKED" : "") ); wprintf(_("Expire by message count")); wprintf("
    \n"); - wprintf("", - ((floorpolicy == 3) ? "CHECKED" : "") ); + wprintf("", + ((roompolicy == 3) ? "CHECKED" : "") ); wprintf(_("Expire by message age")); wprintf("
    "); wprintf(_("Number of messages or days: ")); - wprintf("", - floorvalue); + wprintf("", roomvalue); + wprintf("

    "); + wprintf(_("Message expire policy for this floor")); + wprintf("
    ("); + escputs(floorlist[WC->wc_floor]); + wprintf(")
    "); + wprintf("", + ((floorpolicy == 0) ? "CHECKED" : "") ); + wprintf(_("Use the system default")); + wprintf("
    \n"); + wprintf("", + ((floorpolicy == 1) ? "CHECKED" : "") ); + wprintf(_("Never automatically expire messages")); + wprintf("
    \n"); + wprintf("", + ((floorpolicy == 2) ? "CHECKED" : "") ); + wprintf(_("Expire by message count")); + wprintf("
    \n"); + wprintf("", + ((floorpolicy == 3) ? "CHECKED" : "") ); + wprintf(_("Expire by message age")); + wprintf("
    "); + wprintf(_("Number of messages or days: ")); + wprintf("", + floorvalue); + } + + wprintf("
    \n"); + wprintf("

    \n"); + wprintf("", _("Save changes")); + wprintf(" "); + wprintf("", _("Cancel")); + wprintf("
    \n" + "\n" + "\n" + ); } - wprintf("
    \n"); - wprintf("
    \n"); - wprintf("", _("Save changes")); - wprintf(" "); - wprintf("", _("Cancel")); - wprintf("
    \n"); - - wprintf("\n" - "\n" - "\n" - ); - wprintf(""); } -- 2.39.2