From: Wilfried Goesgens Date: Mon, 17 Dec 2012 23:43:58 +0000 (+0100) Subject: Room-Editing: offer a dropdown to choose from configured domains X-Git-Tag: v8.20~169 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=289dd0dda4753ba41840d1a318923d6ea20f73bc Room-Editing: offer a dropdown to choose from configured domains --- diff --git a/webcit/inetconf.c b/webcit/inetconf.c index d7707f019..bbba2eece 100644 --- a/webcit/inetconf.c +++ b/webcit/inetconf.c @@ -201,6 +201,48 @@ HashList *GetInetConfHash(StrBuf *Target, WCTemplputParams *TP) return vHash; } + +HashList *GetValidDomainNames(StrBuf *Target, WCTemplputParams *TP) +{ + StrBuf *Line; + HashList *ValidDomainNames = NULL; + long State; + int gvdnlevel = 0; + + serv_printf("GVDN %d", gvdnlevel); + Line = NewStrBuf(); + StrBuf_ServGetln(Line); + if (GetServerStatus(Line, &State) == 1) + { + int Done = 0; + int n = 0; + + ValidDomainNames = NewHash(1, NULL); + while(!Done && (StrBuf_ServGetln(Line) >= 0)) + if ( (StrLength(Line)==3) && + !strcmp(ChrPtr(Line), "000")) + { + Done = 1; + } + else + { + Put(ValidDomainNames, + IKEY(n), + NewStrBufDup(Line), + HFreeStrBuf); + n++; /* #0 is the type... */ + } + } + else if (State == 550) + AppendImportantMessage(_("Higher access is required to access this function."), -1); + + FreeStrBuf(&Line); + + return ValidDomainNames; +} + + + void InitModule_INETCONF (void) @@ -208,4 +250,6 @@ InitModule_INETCONF WebcitAddUrlHandler(HKEY("save_inetconf"), "", 0, new_save_inetconf, 0); RegisterIterator("SERVCFG:INET", 1, NULL, GetInetConfHash, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG); RegisterNamespace("SERVCFG:FLUSHINETCFG",0, 0, DeleteInetConfHash, NULL, CTX_NONE); + RegisterIterator("ITERATE:VALID:DOMAINNAMES", 1, NULL, GetValidDomainNames, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG); + } diff --git a/webcit/roomops.c b/webcit/roomops.c index 3dd97ecab..23f027f85 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1078,9 +1078,16 @@ void netedit(void) { strcat(line, bstr("suffix")); } else if (havebstr("alias")) { + const char *domain; malias = 1; sepchar = ','; + domain = bstr("aliasdomain"); strcat(line, bstr("prefix")); + if (!IsEmptyStr(domain)) + { + strcat(line, "@"); + strcat(line, domain); + } strcat(line, ","); strcat(line, "room_"); strcat(line, ChrPtr(WC->CurRoom.name)); diff --git a/webcit/static/t/room/edit/alias_domainname.html b/webcit/static/t/room/edit/alias_domainname.html new file mode 100644 index 000000000..cca12775f --- /dev/null +++ b/webcit/static/t/room/edit/alias_domainname.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/room/edit/tab_listserv.html b/webcit/static/t/room/edit/tab_listserv.html index f34e024ee..1c1db769e 100644 --- a/webcit/static/t/room/edit/tab_listserv.html +++ b/webcit/static/t/room/edit/tab_listserv.html @@ -97,6 +97,11 @@ "> + @ + ">