X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Finetconf.c;fp=webcit%2Finetconf.c;h=bbba2eece9ef9f27fd93baf960efb53be86bd976;hp=d7707f019c3804df68354361b2cb9f047fce1f88;hb=289dd0dda4753ba41840d1a318923d6ea20f73bc;hpb=c04a48443a8f1c0dd65b856321cab22bbc460566 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); + }