- the room edit mailinglist tab now knows howto add/delete a mail alias via SNET/GNET
return rooms;
}
+HashList *GetThisRoomMAlias(StrBuf *Target, WCTemplputParams *TP)
+{
+ wcsession *WCC = WC;
+ StrBuf *Line;
+ StrBuf *Token;
+ HashList *Aliases = NULL;
+ const char *pComma;
+ long aliaslen;
+ long locallen;
+ long State;
+
+ serv_puts("GNET "FILE_MAILALIAS);
+ Line = NewStrBuf();
+ StrBuf_ServGetln(Line);
+ if (GetServerStatus(Line, &State) == 1)
+ {
+ int Done = 0;
+ int n = 0;
+
+ Aliases = NewHash(1, NULL);
+ while(!Done && (StrBuf_ServGetln(Line) >= 0))
+ if ( (StrLength(Line)==3) &&
+ !strcmp(ChrPtr(Line), "000"))
+ {
+ Done = 1;
+ }
+ else
+ {
+ pComma = strchr(ChrPtr(Line), ',');
+ if (pComma == NULL)
+ continue;
+ aliaslen = pComma - ChrPtr(Line);
+ locallen = StrLength(Line) - 1 - aliaslen;
+ if (locallen - 5 != StrLength(WCC->CurRoom.name))
+ continue;
+ if (strncmp(pComma + 1, "room_", 5) != 0)
+ continue;
+
+ if (strcasecmp(pComma + 6, ChrPtr(WCC->CurRoom.name)) != 0)
+ continue;
+ Token = NewStrBufPlain(ChrPtr(Line), aliaslen);
+ Put(Aliases,
+ IKEY(n),
+ Token,
+ HFreeStrBuf);
+ n++; /* #0 is the type... */
+ }
+ }
+ else if (State == 550)
+ AppendImportantMessage(_("Higher access is required to access this function."), -1);
+
+ FreeStrBuf(&Line);
+
+ return Aliases;
+}
+
HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP)
{
wcsession *WCC = WC;
RegisterIterator("ITERATE:THISROOM:WHO_KNOWS", 0, NULL, GetWhoKnowsHash, NULL, DeleteHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
RegisterIterator("ITERATE:THISROOM:GNET", 1, NULL, GetNetConfigHash, NULL, NULL, CTX_STRBUFARR, CTX_NONE, IT_NOFLAG);
+ RegisterIterator("ITERATE:THISROOM:MALIAS", 1, NULL, GetThisRoomMAlias, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
RegisterIterator("LFLR", 0, NULL, GetFloorListHash, NULL, NULL, CTX_FLOORS, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
RegisterIterator("LKRA", 0, NULL, GetRoomListHashLKRA, NULL, NULL, CTX_ROOMS, CTX_NONE, IT_FLAG_DETECT_GROUPCHANGE);
int i, num_addrs;
StrBuf *Line;
StrBuf *TmpBuf;
+ int malias = 0;
+ char sepchar = '|';
int Done;
+ line[0] = '\0';
if (havebstr("force_room")) {
gotoroom(sbstr("force_room"));
}
strcat(line, bstr("line"));
strcat(line, bstr("suffix"));
}
+ else if (havebstr("alias")) {
+ malias = 1;
+ sepchar = ',';
+ strcat(line, bstr("prefix"));
+ strcat(line, ",");
+ strcat(line, "room_");
+ strcat(line, ChrPtr(WC->CurRoom.name));
+ }
else {
output_headers(1, 1, 1, 0, 0, 0);
do_template("room_edit");
Line = NewStrBuf();
TmpBuf = NewStrBuf();
- serv_puts("GNET");
+ if (malias)
+ serv_puts("GNET "FILE_MAILALIAS);
+ else
+ serv_puts("GNET");
StrBuf_ServGetln(Line);
if (GetServerStatus(Line, NULL) != 1) {
AppendImportantMessage(SRV_STATUS_MSG(Line));
/** This loop works for add *or* remove. Spiffy, eh? */
Done = 0;
- extract_token(cmpb0, line, 0, '|', sizeof cmpb0);
- extract_token(cmpb1, line, 1, '|', sizeof cmpb1);
+ extract_token(cmpb0, line, 0, sepchar, sizeof cmpb0);
+ extract_token(cmpb1, line, 1, sepchar, sizeof cmpb1);
while (!Done && StrBuf_ServGetln(Line)>=0) {
if ( (StrLength(Line)==3) &&
!strcmp(ChrPtr(Line), "000"))
}
else
{
- extract_token(cmpa0, ChrPtr(Line), 0, '|', sizeof cmpa0);
- extract_token(cmpa1, ChrPtr(Line), 1, '|', sizeof cmpa1);
- if ( (strcasecmp(cmpa0, cmpb0))
- || (strcasecmp(cmpa1, cmpb1)) ) {
+ if (StrLength(Line) == 0)
+ continue;
+
+ extract_token(cmpa0, ChrPtr(Line), 0, sepchar, sizeof cmpa0);
+ extract_token(cmpa1, ChrPtr(Line), 1, sepchar, sizeof cmpa1);
+ if ( (strcasecmp(cmpa0, cmpb0)) || (strcasecmp(cmpa1, cmpb1)) )
+ {
StrBufAppendBufPlain(Line, HKEY("\n"), 0);
StrBufAppendBuf(TmpBuf, Line, 0);
}
}
}
- serv_puts("SNET");
+ if (malias)
+ serv_puts("SNET "FILE_MAILALIAS);
+ else
+ serv_puts("SNET");
StrBuf_ServGetln(Line);
if (GetServerStatus(Line, NULL) != 4) {
--- /dev/null
+<tr class="<?ITERATE:ODDEVEN>"><td><?CONTEXTSTR("X")><a href="netedit?cmd=removealias?tab=listserv?alias=1&prefix=<?CONTEXTSTR("U")>?last_tabsel=<?TAB:N>"><?_("(remove)")></a></td></tr>
-<tr class="<?ITERATE:ODDEVEN>"><td><?CONTEXTSTRARR(1, "X")><a href="netedit?cmd=remove?tab=listserv?line=digestrecp|<?CONTEXTSTRARR(1, "U")>"><?_("(remove)")></a></td></tr>
+<tr class="<?ITERATE:ODDEVEN>"><td><?CONTEXTSTRARR(1, "X")><a href="netedit?cmd=remove?tab=listserv?line=digestrecp|<?CONTEXTSTRARR(1, "U")>?last_tabsel=<?TAB:N>"><?_("(remove)")></a></td></tr>
<tt><?%("COND:IS_HTTPS", 3, 1, 0, "https", "http")>://<?SERV:FQDN>/listsub</tt>
</td>
</tr>
-
<tr>
- <td colspan="2" align="center">
- <input type="hidden" name="last_tabsel" value="<?TAB:N>">
- <input type="hidden" name="nonce" value="<?NONCE>">
- <input type="hidden" name="go" value="<?THISROOM:NAME("X")>">
- <input type="submit" name="add_button" value="<?_("Save changes")>">
- </td>
+ <tr>
+ <td colspan="2" align="center">
+ <input type="hidden" name="last_tabsel" value="<?TAB:N>">
+ <input type="hidden" name="nonce" value="<?NONCE>">
+ <input type="hidden" name="go" value="<?THISROOM:NAME("X")>">
+ <input type="submit" name="add_button" value="<?_("Save changes")>">
+ </td>
</tr>
</table>
</form>
+ <table class="altern">
+ <td colspan="2">
+ <?_("Alternative public emailaddresses pointing to this room: ")>
+ </td>
+ <?ITERATE("ITERATE:THISROOM:MALIAS", ="room_edit_alias_removal", 0, 0, -1, "")>
+ <tr>
+ <td colspan="2">
+ <form method="post" action="netedit">
+ <p>
+ <input type="hidden" name="last_tabsel" value="<?TAB:N>">
+ <input type="hidden" name="alias" value="room_<?THISROOM:NAME("X")>">
+ <input type="hidden" name="nonce" value="<?NONCE>">
+ <input type="hidden" name="go" value="<?THISROOM:NAME("X")>">
+ <input type="text" id="prefix" name="prefix">
+ <input type="submit" name="add_button" value="<?_("Add")>">
+ </p>
+ </form>
+ </td>
+ </tr>
+ </table>
+
</center>
</div>