- /* Sharing the room with other Citadel nodes... */
- if (!strcmp(tab, "sharing")) {
- wc_printf("<div class=\"tabcontent\">");
-
- shared_with = strdup("");
- not_shared_with = strdup("");
-
- /** Learn the current configuration */
- serv_puts("CONF getsys|application/x-citadel-ignet-config");
- serv_getln(buf, sizeof buf);
- if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- extract_token(node, buf, 0, '|', sizeof node);
- not_shared_with = realloc(not_shared_with,
- strlen(not_shared_with) + 32);
- strcat(not_shared_with, node);
- strcat(not_shared_with, "\n");
- }
-
- serv_puts("GNET");
- serv_getln(buf, sizeof buf);
- if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- extract_token(cmd, buf, 0, '|', sizeof cmd);
- extract_token(node, buf, 1, '|', sizeof node);
- extract_token(remote_room, buf, 2, '|', sizeof remote_room);
- if (!strcasecmp(cmd, "ignet_push_share")) {
- shared_with = realloc(shared_with,
- strlen(shared_with) + 32);
- strcat(shared_with, node);
- if (!IsEmptyStr(remote_room)) {
- strcat(shared_with, "|");
- strcat(shared_with, remote_room);
- }
- strcat(shared_with, "\n");
- }
- }
-
- for (i=0; i<num_tokens(shared_with, '\n'); ++i) {
- extract_token(buf, shared_with, i, '\n', sizeof buf);
- extract_token(node, buf, 0, '|', sizeof node);
- for (j=0; j<num_tokens(not_shared_with, '\n'); ++j) {
- extract_token(cmd, not_shared_with, j, '\n', sizeof cmd);
- if (!strcasecmp(node, cmd)) {
- remove_token(not_shared_with, j, '\n');
- }
- }
- }
-
- /* Display the stuff */
- wc_printf("<CENTER><br />"
- "<table border=1 cellpadding=5><tr>"
- "<td><B><I>");
- wc_printf(_("Shared with"));
- wc_printf("</I></B></td>"
- "<td><B><I>");
- wc_printf(_("Not shared with"));
- wc_printf("</I></B></td></tr>\n"
- "<tr><td VALIGN=TOP>\n");
-
- wc_printf("<table border=0 cellpadding=5><tr class=\"tab_cell\"><td>");
- wc_printf(_("Remote node name"));
- wc_printf("</td><td>");
- wc_printf(_("Remote room name"));
- wc_printf("</td><td>");
- wc_printf(_("Actions"));
- wc_printf("</td></tr>\n");
-
- for (i=0; i<num_tokens(shared_with, '\n'); ++i) {
- extract_token(buf, shared_with, i, '\n', sizeof buf);
- extract_token(node, buf, 0, '|', sizeof node);
- extract_token(remote_room, buf, 1, '|', sizeof remote_room);
- if (!IsEmptyStr(node)) {
- wc_printf("<form method=\"POST\" action=\"netedit\">");
- wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
- wc_printf("<tr><td>%s</td>\n", node);
-
- wc_printf("<td>");
- if (!IsEmptyStr(remote_room)) {
- escputs(remote_room);
- }
- wc_printf("</td>");
-
- wc_printf("<td>");
-
- wc_printf("<input type=\"hidden\" NAME=\"line\" "
- "VALUE=\"ignet_push_share|");
- urlescputs(node);
- if (!IsEmptyStr(remote_room)) {
- wc_printf("|");
- urlescputs(remote_room);
- }
- wc_printf("\">");
- wc_printf("<input type=\"hidden\" NAME=\"tab\" VALUE=\"sharing\">\n");
- wc_printf("<input type=\"hidden\" NAME=\"cmd\" VALUE=\"remove\">\n");
- wc_printf("<input type=\"submit\" "
- "NAME=\"unshare_button\" VALUE=\"%s\">", _("Unshare"));
- wc_printf("</td></tr></form>\n");
- }
- }
-
- wc_printf("</table>\n");
- wc_printf("</td><td VALIGN=TOP>\n");
- wc_printf("<table border=0 cellpadding=5><tr class=\"tab_cell\"><td>");
- wc_printf(_("Remote node name"));
- wc_printf("</td><td>");
- wc_printf(_("Remote room name"));
- wc_printf("</td><td>");
- wc_printf(_("Actions"));
- wc_printf("</td></tr>\n");
-
- for (i=0; i<num_tokens(not_shared_with, '\n'); ++i) {
- extract_token(node, not_shared_with, i, '\n', sizeof node);
- if (!IsEmptyStr(node)) {
- wc_printf("<form method=\"POST\" action=\"netedit\">");
- wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
- wc_printf("<tr><td>");
- escputs(node);
- wc_printf("</td><td>"
- "<input type=\"INPUT\" "
- "NAME=\"suffix\" "
- "MAXLENGTH=128>"
- "</td><td>");
- wc_printf("<input type=\"hidden\" "
- "NAME=\"line\" "
- "VALUE=\"ignet_push_share|");
- urlescputs(node);
- wc_printf("|\">");
- wc_printf("<input type=\"hidden\" NAME=\"tab\" "
- "VALUE=\"sharing\">\n");
- wc_printf("<input type=\"hidden\" NAME=\"cmd\" "
- "VALUE=\"add\">\n");
- wc_printf("<input type=\"submit\" "
- "NAME=\"add_button\" VALUE=\"%s\">", _("Share"));
- wc_printf("</td></tr></form>\n");
- }
- }
-
- wc_printf("</table>\n");
- wc_printf("</td></tr>"
- "</table></CENTER><br />\n"
- "<I><B>%s</B><ul><li>", _("Notes:"));
- wc_printf(_("When sharing a room, "
- "it must be shared from both ends. Adding a node to "
- "the 'shared' list sends messages out, but in order to"
- " receive messages, the other nodes must be configured"
- " to send messages out to your system as well. "
- "<li>If the remote room name is blank, it is assumed "
- "that the room name is identical on the remote node."
- "<li>If the remote room name is different, the remote "
- "node must also configure the name of the room here."
- "</ul></I><br />\n"
- ));
-
- wc_printf("</div>");
- }
-
- if (not_shared_with != NULL)
- free (not_shared_with);
-
- /* Mailing list management */
- if (!strcmp(tab, "listserv")) {
- room_states RoomFlags;
- wc_printf("<div class=\"tabcontent\">");
-
- wc_printf("<br /><center>"
- "<table BORDER=0 WIDTH=100%% CELLPADDING=5>"
- "<tr><td VALIGN=TOP>");
-
- wc_printf(_("<i>The contents of this room are being "
- "mailed <b>as individual messages</b> "
- "to the following list recipients:"
- "</i><br /><br />\n"));
-
- serv_puts("GNET");
- serv_getln(buf, sizeof buf);
- if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- extract_token(cmd, buf, 0, '|', sizeof cmd);
- if (!strcasecmp(cmd, "listrecp")) {
- extract_token(recp, buf, 1, '|', sizeof recp);
-
- escputs(recp);
- wc_printf(" <a href=\"netedit?cmd=remove?tab=listserv?line=listrecp|");
- urlescputs(recp);
- wc_printf("\">");
- wc_printf(_("(remove)"));
- wc_printf("</A><br />");
- }
- }
- wc_printf("<br /><form method=\"POST\" action=\"netedit\">\n"
- "<input type=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
- "<input type=\"hidden\" NAME=\"prefix\" VALUE=\"listrecp|\">\n");
- wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
- wc_printf("<input type=\"text\" id=\"add_as_listrecp\" NAME=\"line\">\n");
- wc_printf("<input type=\"submit\" NAME=\"add_button\" VALUE=\"%s\">", _("Add"));
- wc_printf("</form>\n");
-
- wc_printf("</td><td VALIGN=TOP>\n");
-
- wc_printf(_("<i>The contents of this room are being "
- "mailed <b>in digest form</b> "
- "to the following list recipients:"
- "</i><br /><br />\n"));
-
- serv_puts("GNET");
- serv_getln(buf, sizeof buf);
- if (buf[0]=='1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- extract_token(cmd, buf, 0, '|', sizeof cmd);
- if (!strcasecmp(cmd, "digestrecp")) {
- extract_token(recp, buf, 1, '|', sizeof recp);
-
- escputs(recp);
- wc_printf(" <a href=\"netedit?cmd=remove?tab=listserv?line="
- "digestrecp|");
- urlescputs(recp);
- wc_printf("\">");
- wc_printf(_("(remove)"));
- wc_printf("</A><br />");
- }
- }
- wc_printf("<br /><form method=\"POST\" action=\"netedit\">\n"
- "<input type=\"hidden\" NAME=\"tab\" VALUE=\"listserv\">\n"
- "<input type=\"hidden\" NAME=\"prefix\" VALUE=\"digestrecp|\">\n");
- wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
- wc_printf("<input type=\"text\" id=\"add_as_digestrecp\" NAME=\"line\">\n");
- wc_printf("<input type=\"submit\" NAME=\"add_button\" VALUE=\"%s\">", _("Add"));
- wc_printf("</form>\n");
-
- wc_printf("</td></tr></table>\n");
-
- /** Pop open an address book -- begin **/
- wc_printf("<div align=right>"
- "<a href=\"javascript:PopOpenAddressBook('add_as_listrecp|%s|add_as_digestrecp|%s');\" "
- "title=\"%s\">"
- "<img align=middle border=0 width=24 height=24 src=\"static/viewcontacts_24x.gif\">"
- " %s</a>"
- "</div>",
- _("List"),
- _("Digest"),
- _("Add recipients from Contacts or other address books"),
- _("Add recipients from Contacts or other address books")
- );
- /* Pop open an address book -- end **/
-
- wc_printf("<br />\n<form method=\"GET\" action=\"toggle_self_service\">\n");
-
- get_roomflags (&RoomFlags);
-
- /* Self Service subscription? */
- wc_printf("<table><tr><td>\n");
- wc_printf(_("Allow self-service subscribe/unsubscribe requests."));
- wc_printf("</td><td><input type=\"checkbox\" name=\"QR2_SelfList\" value=\"yes\" %s></td></tr>\n"
- " <tr><td colspan=\"2\">\n",
- (is_selflist(&RoomFlags))?"checked":"");
- wc_printf(_("The URL for subscribe/unsubscribe is: "));
- wc_printf("<TT>%s://%s/listsub</TT></td></tr>\n",
- (is_https ? "https" : "http"),
- ChrPtr(WC->Hdr->HR.http_host));
- /* Public posting? */
- wc_printf("<tr><td>");
- wc_printf(_("Allow non-subscribers to mail to this room."));
- wc_printf("</td><td><input type=\"checkbox\" name=\"QR2_SubsOnly\" value=\"yes\" %s></td></tr>\n",
- (is_publiclist(&RoomFlags))?"checked":"");
-
- /* Moderated List? */
- wc_printf("<tr><td>");
- wc_printf(_("Room post publication needs Aide permission."));
- wc_printf("</td><td><input type=\"checkbox\" name=\"QR2_Moderated\" value=\"yes\" %s></td></tr>\n",
- (is_moderatedlist(&RoomFlags))?"checked":"");
-
-
- wc_printf("<tr><td colspan=\"2\" align=\"center\">"
- "<input type=\"submit\" NAME=\"add_button\" VALUE=\"%s\"></td></tr>", _("Save changes"));
- wc_printf("</table></form>");
-
-
- wc_printf("</CENTER>\n");
- wc_printf("</div>");
- }