bff64e9e3373993fd08827960bee66aceba72017
[citadel.git] / webcit / serv_func.c
1
2 #include "webcit.h"
3 #include "webserver.h"
4
5 int is_uds = 0;
6 char serv_sock_name[PATH_MAX] = "";
7
8 HashList *EmbeddableMimes = NULL;
9 StrBuf *EmbeddableMimeStrs = NULL;
10
11
12 void SetInlinMimeRenderers(void)
13 {
14         StrBuf *Buf;
15
16         Buf = NewStrBuf();
17
18         /* Tell the server what kind of richtext we prefer */
19         serv_putbuf(EmbeddableMimeStrs);
20         StrBuf_ServGetln(Buf);
21
22         FreeStrBuf(&Buf);
23 }
24
25
26 void DeleteServInfo(ServInfo **FreeMe)
27 {
28         if (*FreeMe == NULL)
29                 return;
30         FreeStrBuf(&(*FreeMe)->serv_nodename);
31         FreeStrBuf(&(*FreeMe)->serv_humannode);
32         FreeStrBuf(&(*FreeMe)->serv_fqdn);
33         FreeStrBuf(&(*FreeMe)->serv_software);
34         FreeStrBuf(&(*FreeMe)->serv_bbs_city);
35         FreeStrBuf(&(*FreeMe)->serv_sysadm);
36         FreeStrBuf(&(*FreeMe)->serv_default_cal_zone);
37         FreeStrBuf(&(*FreeMe)->serv_svn_revision);
38         free(*FreeMe);
39         *FreeMe = NULL;
40 }
41
42 /*
43  * get info about the server we've connected to
44  *
45  * browser_host         the citadel we want to connect to
46  * user_agent           which browser uses our client?
47  */
48 ServInfo *get_serv_info(StrBuf *browser_host, StrBuf *user_agent)
49 {
50         ServInfo *info;
51         StrBuf *Buf;
52         int a;
53         int rc;
54
55         Buf = NewStrBuf();
56
57         /* Tell the server what kind of client is connecting */
58         serv_printf("IDEN %d|%d|%d|%s|%s",
59                     DEVELOPER_ID,
60                     CLIENT_ID,
61                     CLIENT_VERSION,
62                     ChrPtr(user_agent),
63                     ChrPtr(browser_host)
64         );
65         StrBuf_ServGetln(Buf);
66         if (GetServerStatus(Buf, NULL) != 2) {
67                 syslog(LOG_WARNING, "get_serv_info(IDEN): unexpected answer [%s]\n",
68                         ChrPtr(Buf));
69                 FreeStrBuf(&Buf);
70                 return NULL;
71         }
72
73         /*
74          * Tell the server that when we save a calendar event, we
75          * want invitations to be generated by the Citadel server
76          * instead of by the client.
77          */
78         serv_puts("ICAL sgi|1");
79         StrBuf_ServGetln(Buf);
80         if (GetServerStatus(Buf, NULL) != 2) {
81                 syslog(LOG_WARNING, "get_serv_info(ICAL sgi|1): unexpected answer [%s]\n",
82                         ChrPtr(Buf));
83                 FreeStrBuf(&Buf);
84                 return NULL;
85         }
86
87         /* Now ask the server to tell us a little bit about itself... */
88         serv_puts("INFO");
89         StrBuf_ServGetln(Buf);
90         if (GetServerStatus(Buf, NULL) != 1) {
91                 syslog(LOG_WARNING, "get_serv_info(INFO sgi|1): unexpected answer [%s]\n",
92                         ChrPtr(Buf));
93                 FreeStrBuf(&Buf);
94                 return NULL;
95         }
96
97         info = (ServInfo*)malloc(sizeof(ServInfo));
98         memset(info, 0, sizeof(ServInfo));
99         a = 0;
100         while (rc = StrBuf_ServGetln(Buf),
101                (rc >= 0) &&
102                ((rc != 3) || 
103                 strcmp(ChrPtr(Buf), "000")))
104         {
105                 switch (a) {
106                 case 0:
107                         info->serv_pid = StrToi(Buf);
108                         WC->ctdl_pid = info->serv_pid;
109                         break;
110                 case 1:
111                         info->serv_nodename = NewStrBufDup(Buf);
112                         break;
113                 case 2:
114                         info->serv_humannode = NewStrBufDup(Buf);
115                         break;
116                 case 3:
117                         info->serv_fqdn = NewStrBufDup(Buf);
118                         break;
119                 case 4:
120                         info->serv_software = NewStrBufDup(Buf);
121                         break;
122                 case 5:
123                         info->serv_rev_level = StrToi(Buf);
124                         break;
125                 case 6:
126                         info->serv_bbs_city = NewStrBufDup(Buf);
127                         break;
128                 case 7:
129                         info->serv_sysadm = NewStrBufDup(Buf);
130                         break;
131                 case 14:
132                         info->serv_supports_ldap = StrToi(Buf);
133                         break;
134                 case 15:
135                         info->serv_newuser_disabled = StrToi(Buf);
136                         break;
137                 case 16:
138                         info->serv_default_cal_zone = NewStrBufDup(Buf);
139                         break;
140                 case 20:
141                         info->serv_supports_sieve = StrToi(Buf);
142                         break;
143                 case 21:
144                         info->serv_fulltext_enabled = StrToi(Buf);
145                         break;
146                 case 22:
147                         info->serv_svn_revision = NewStrBufDup(Buf);
148                         break;
149                 case 23:
150                         info->serv_supports_openid = StrToi(Buf);
151                         break;
152                 case 24:
153                         info->serv_supports_guest = StrToi(Buf);
154                         break;
155                 }
156                 ++a;
157         }
158         FreeStrBuf(&Buf);
159         return info;
160 }
161
162 int GetConnected (void)
163 {
164         StrBuf *Buf;
165         wcsession *WCC = WC;
166
167         if (WCC->ReadBuf == NULL)
168                 WCC->ReadBuf = NewStrBufPlain(NULL, SIZ * 4);
169         if (is_uds) /* unix domain socket */
170                 WCC->serv_sock = uds_connectsock(serv_sock_name);
171         else        /* tcp socket */
172                 WCC->serv_sock = tcp_connectsock(ctdlhost, ctdlport);
173         
174         if (WCC->serv_sock < 0) {
175                 WCC->connected = 0;
176                 FreeStrBuf(&WCC->ReadBuf);
177                 return 1;
178         }
179         else {
180                 long Status;
181                 int short_status;
182                 Buf = NewStrBuf();
183                 WCC->connected = 1;
184                 StrBuf_ServGetln(Buf);  /* get the server greeting */
185                 short_status = GetServerStatus(Buf, &Status);
186                 FreeStrBuf(&Buf);
187
188                 /* Server isn't ready for us? */
189                 if (short_status != 2) {
190                         if (Status == 551) {
191                                 hprintf("HTTP/1.1 503 Service Unavailable\r\n");
192                                 hprintf("Content-type: text/plain; charset=utf-8\r\n");
193                                 wc_printf(_("This server is already serving its maximum number of users and cannot accept any additional logins at this time.  Please try again later or contact your system administrator."));
194                         }
195                         else {
196                                 wc_printf("%ld %s\n",
197                                         Status,
198                                         _("Received unexpected answer from Citadel server; bailing out.")
199                                 );
200                                 hprintf("HTTP/1.1 502 Bad Gateway\r\n");
201                                 hprintf("Content-type: text/plain; charset=utf-8\r\n");
202                         }
203                         end_burst();
204                         end_webcit_session();
205                         return 1;
206                 }
207
208                 /*
209                  * From what host is our user connecting?  Go with
210                  * the host at the other end of the HTTP socket,
211                  * unless we are following X-Forwarded-For: headers
212                  * and such a header has already turned up something.
213                  */
214                 if ( (!follow_xff) || (StrLength(WCC->Hdr->HR.browser_host) == 0) ) {
215                         if (WCC->Hdr->HR.browser_host == NULL) {
216                                 WCC->Hdr->HR.browser_host = NewStrBuf();
217                                 Put(WCC->Hdr->HTTPHeaders, HKEY("FreeMeWithTheOtherHeaders"), 
218                                     WCC->Hdr->HR.browser_host, HFreeStrBuf);
219                         }
220                         locate_host(WCC->Hdr->HR.browser_host, WCC->Hdr->http_sock);
221                 }
222                 if (WCC->serv_info == NULL) {
223                         WCC->serv_info = get_serv_info(WCC->Hdr->HR.browser_host, WCC->Hdr->HR.user_agent);
224                 }
225                 if (WCC->serv_info == NULL){
226                         begin_burst();
227                         wc_printf(_("Received unexpected answer from Citadel server; bailing out."));
228                         hprintf("HTTP/1.1 502 Bad Gateway\r\n");
229                         hprintf("Content-type: text/plain; charset=utf-8\r\n");
230                         end_burst();
231                         end_webcit_session();
232                         return 1;
233                 }
234                 if (WCC->serv_info->serv_rev_level < MINIMUM_CIT_VERSION) {
235                         begin_burst();
236                         wc_printf(_("You are connected to a Citadel "
237                                   "server running Citadel %d.%02d. \n"
238                                   "In order to run this version of WebCit "
239                                   "you must also have Citadel %d.%02d or"
240                                   " newer.\n\n\n"),
241                                 WCC->serv_info->serv_rev_level / 100,
242                                 WCC->serv_info->serv_rev_level % 100,
243                                 MINIMUM_CIT_VERSION / 100,
244                                 MINIMUM_CIT_VERSION % 100
245                                 );
246                         hprintf("HTTP/1.1 200 OK\r\n");
247                         hprintf("Content-type: text/plain; charset=utf-8\r\n");
248                         end_burst();
249                         end_webcit_session();
250                         return 1;
251                 }
252                 SetInlinMimeRenderers();
253         }
254         return 0;
255 }
256
257
258 void FmOut(StrBuf *Target, const char *align, const StrBuf *Source)
259 {
260         const char *ptr, *pte;
261         const char *BufPtr = NULL;
262         StrBuf *Line = NewStrBufPlain(NULL, SIZ);
263         StrBuf *Line1 = NewStrBufPlain(NULL, SIZ);
264         StrBuf *Line2 = NewStrBufPlain(NULL, SIZ);
265         int bn = 0;
266         int bq = 0;
267         int i;
268         long len;
269         int intext = 0;
270
271         StrBufAppendPrintf(Target, "<div class=\"fmout-%s\">\n", align);
272
273         if (StrLength(Source) > 0) 
274                 do 
275                 {
276                         StrBufSipLine(Line, Source, &BufPtr);
277                         bq = 0;
278                         i = 0;
279                         ptr = ChrPtr(Line);
280                         len = StrLength(Line);
281                         pte = ptr + len;
282
283                         if ((intext == 1) && (isspace(*ptr))) {
284                                 StrBufAppendBufPlain(Target, HKEY("<br>"), 0);
285                         }
286                         intext = 1;
287                         if (isspace(*ptr)) while ((ptr < pte) &&
288                                                   ((*ptr == '>') ||
289                                                    isspace(*ptr)))
290                                            {
291                                                    if (*ptr == '>')
292                                                            bq++;
293                                                    ptr ++;
294                                                    i++;
295                                            }
296
297                         /*
298                          * Quoted text should be displayed in italics and in a
299                          * different colour.  This code understands Citadel-style
300                          * " >" quotes and will convert to <BLOCKQUOTE> tags.
301                          */
302                         if (i > 0) StrBufCutLeft(Line, i);
303                 
304
305                         for (i = bn; i < bq; i++)                               
306                                 StrBufAppendBufPlain(Target, HKEY("<blockquote>"), 0);
307                         for (i = bq; i < bn; i++)                               
308                                 StrBufAppendBufPlain(Target, HKEY("</blockquote>"), 0);
309                         bn = bq;
310
311                         if (StrLength(Line) == 0)
312                                 continue;
313
314                         /* Activate embedded URL's */
315                         UrlizeText(Line1, Line, Line2);
316
317                         StrEscAppend(Target, Line1, NULL, 0, 0);
318
319                         StrBufAppendBufPlain(Target, HKEY("\n"), 0);
320                 }
321                 while ((BufPtr != StrBufNOTNULL) &&
322                        (BufPtr != NULL));
323
324         for (i = 0; i < bn; i++) {
325                 StrBufAppendBufPlain(Target, HKEY("</blockquote>"), 0);
326         }
327         StrBufAppendBufPlain(Target, HKEY("</div><br>\n"), 0);
328         FreeStrBuf(&Line);
329         FreeStrBuf(&Line1);
330         FreeStrBuf(&Line2);
331 }
332
333
334
335 /*
336  *  Transmit message text (in memory) to the server.
337  */
338 void text_to_server(char *ptr)
339 {
340         char buf[256];
341         int ch, a, pos, len;
342
343         pos = 0;
344         buf[0] = 0;
345
346         while (ptr[pos] != 0) {
347                 ch = ptr[pos++];
348                 if (ch == 10) {
349                         len = strlen(buf);
350                         while ( (isspace(buf[len - 1]))
351                                 && (buf[0] !=  '\0') 
352                                 && (buf[1] !=  '\0') )
353                                 buf[--len] = 0;
354                         serv_puts(buf);
355                         buf[0] = 0;
356                         if (ptr[pos] != 0) strcat(buf, " ");
357                 } else {
358                         a = strlen(buf);
359                         buf[a + 1] = 0;
360                         buf[a] = ch;
361                         if ((ch == 32) && (strlen(buf) > 200)) {
362                                 buf[a] = 0;
363                                 serv_puts(buf);
364                                 buf[0] = 0;
365                         }
366                         if (strlen(buf) > 250) {
367                                 serv_puts(buf);
368                                 buf[0] = 0;
369                         }
370                 }
371         }
372         serv_puts(buf);
373 }
374
375
376 /*
377  * Transmit message text (in memory) to the server, converting to Quoted-Printable encoding as we go.
378  */
379 void text_to_server_qp(const StrBuf *SendMeEncoded)
380 {
381         StrBuf *ServBuf;
382
383         ServBuf = StrBufRFC2047encodeMessage(SendMeEncoded);
384         serv_putbuf(ServBuf);
385         FreeStrBuf(&ServBuf);
386 }
387
388
389
390
391 /*
392  * translate server message output to text (used for editing room info files and such)
393  */
394 void server_to_text()
395 {
396         char buf[SIZ];
397
398         int count = 0;
399
400         while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
401                 if ((buf[0] == 32) && (count > 0)) {
402                         wc_printf("\n");
403                 }
404                 wc_printf("%s", buf);
405                 ++count;
406         }
407 }
408
409
410
411
412 /*
413  * Read text from server, appending to a string buffer until the
414  * usual 000 terminator is found.  Caller is responsible for freeing
415  * the returned pointer.
416  */
417 int read_server_text(StrBuf *Buf, long *nLines)
418 {
419         wcsession *WCC = WC;
420         StrBuf *ReadBuf;
421         long nRead;
422         long nTotal = 0;
423         long nlines;
424         
425         nlines = 0;
426         ReadBuf = NewStrBuf();
427         while ((WCC->serv_sock!=-1) &&
428                (nRead = StrBuf_ServGetln(ReadBuf), (nRead >= 0) &&
429                 ((nRead != 3)||(strcmp(ChrPtr(ReadBuf), "000") != 0))))
430         {
431                 StrBufAppendBuf(Buf, ReadBuf, 0);
432                 StrBufAppendBufPlain(Buf, HKEY("\n"), 0);
433                 nTotal += nRead;
434                 nlines ++;
435         }
436         FreeStrBuf(&ReadBuf);
437         *nLines = nlines;
438         return nTotal;
439 }
440
441
442 int GetServerStatusMsg(StrBuf *Line, long* FullState, int PutImportantMessage, int MajorOK)
443 {
444         int rc;
445         if (FullState != NULL)
446                 *FullState = StrTol(Line);
447         rc = ChrPtr(Line)[0] - 48;
448         if ((!PutImportantMessage) || 
449             (MajorOK == rc)||
450             (StrLength(Line) <= 4))
451                 return rc;
452
453         AppendImportantMessage(ChrPtr(Line) + 4, StrLength(Line) - 4);
454         return rc;
455 }
456
457
458 void tmplput_serv_ip(StrBuf *Target, WCTemplputParams *TP)
459 {
460         StrBufAppendPrintf(Target, "%d", WC->ctdl_pid);
461 }
462
463 void tmplput_serv_admin(StrBuf *Target, WCTemplputParams *TP)
464 {
465         wcsession *WCC = WC;
466         if (WCC->serv_info == NULL)
467                 return;
468         StrBufAppendTemplate(Target, TP, WCC->serv_info->serv_sysadm, 0);
469 }
470
471 void tmplput_serv_nodename(StrBuf *Target, WCTemplputParams *TP)
472 {
473         wcsession *WCC = WC;
474         if (WCC->serv_info == NULL)
475                 return;
476         StrBufAppendTemplate(Target, TP, WCC->serv_info->serv_nodename, 0);
477 }
478
479 void tmplput_serv_humannode(StrBuf *Target, WCTemplputParams *TP)
480 {
481         wcsession *WCC = WC;
482         if (WCC->serv_info == NULL)
483                 return;
484         StrBufAppendTemplate(Target, TP, WCC->serv_info->serv_humannode, 0);
485 }
486
487 void tmplput_serv_fqdn(StrBuf *Target, WCTemplputParams *TP)
488 {
489         wcsession *WCC = WC;
490         if (WCC->serv_info == NULL)
491                 return;
492         StrBufAppendTemplate(Target, TP, WCC->serv_info->serv_fqdn, 0);
493 }
494
495 void tmplput_serv_software(StrBuf *Target, WCTemplputParams *TP)
496 {
497         wcsession *WCC = WC;
498         if (WCC->serv_info == NULL)
499                 return;
500         StrBufAppendTemplate(Target, TP, WCC->serv_info->serv_software, 0);
501 }
502
503 void tmplput_serv_rev_level(StrBuf *Target, WCTemplputParams *TP)
504 {
505         if (WC->serv_info == NULL) return;
506         StrBufAppendPrintf(Target, "%d", WC->serv_info->serv_rev_level);
507 }
508 int conditional_serv_newuser_disabled(StrBuf *Target, WCTemplputParams *TP)
509 {
510         wcsession *WCC = WC;
511         if (WCC->serv_info == NULL)
512                 return 0;
513         return WCC->serv_info->serv_newuser_disabled != 0;
514 }
515
516 int conditional_serv_supports_guest(StrBuf *Target, WCTemplputParams *TP)                                                                                                                                       
517 {
518         wcsession *WCC = WC;
519         if (WCC->serv_info == NULL)
520                 return 0;
521         return WCC->serv_info->serv_supports_guest != 0;
522 }
523
524 int conditional_serv_supports_openid(StrBuf *Target, WCTemplputParams *TP)
525 {
526         wcsession *WCC = WC;
527         if (WCC->serv_info == NULL)
528                 return 0;
529         return WCC->serv_info->serv_supports_openid != 0;
530 }
531
532 int conditional_serv_fulltext_enabled(StrBuf *Target, WCTemplputParams *TP)
533 {
534         wcsession *WCC = WC;
535         if (WCC->serv_info == NULL)
536                 return 0;
537         return WCC->serv_info->serv_fulltext_enabled != 0;
538 }
539
540 int conditional_serv_ldap_enabled(StrBuf *Target, WCTemplputParams *TP)
541 {
542         wcsession *WCC = WC;
543         if (WCC->serv_info == NULL)
544                 return 0;
545         return WCC->serv_info->serv_supports_ldap != 0;
546 }
547
548 void tmplput_serv_bbs_city(StrBuf *Target, WCTemplputParams *TP)
549 {
550         wcsession *WCC = WC;
551         if (WCC->serv_info == NULL)
552                 return;
553         StrBufAppendTemplate(Target, TP, WC->serv_info->serv_bbs_city, 0);
554 }
555
556 void tmplput_mesg(StrBuf *Target, WCTemplputParams *TP)
557 {
558         int n = 0;
559         int Done = 0;
560         StrBuf *Line;
561         StrBuf *Buf;
562
563         Buf = NewStrBuf();
564         Line = NewStrBuf();
565         serv_printf("MESG %s", TP->Tokens->Params[0]->Start);
566
567         StrBuf_ServGetln(Line);
568         if (GetServerStatus(Line, NULL) == 1) {
569                 while (!Done &&  (StrBuf_ServGetln(Line)>=0)) {
570                         if ( (StrLength(Line)==3) && 
571                              !strcmp(ChrPtr(Line), "000")) 
572                                 Done = 1;
573                         else
574                         {
575                                 if (n > 0)
576                                         StrBufAppendBufPlain(Buf, "\n", 1, 0);
577                                 StrBufAppendBuf(Buf, Line, 0);
578                         }
579                         n++;
580                 }
581         
582                 FlushStrBuf(Line);
583                 FmOut(Line, "center", Buf);
584                 StrBufAppendTemplate(Target, TP, Line, 1);
585         }
586         FreeStrBuf(&Buf);
587         FreeStrBuf(&Line);
588 }
589
590 void tmplput_site_prefix(StrBuf *Target, WCTemplputParams *TP) {
591         wcsession *WCC = WC;
592         if ((WCC != NULL) && (WCC->Hdr->HostHeader != NULL)) {
593                 StrBufAppendTemplate(Target, TP, WCC->Hdr->HostHeader, 0);
594         }
595 }
596
597 void RegisterEmbeddableMimeType(const char *MimeType, long MTLen, int Priority)
598 {
599         StrBuf *MT;
600         MT = NewStrBufPlain(MimeType, MTLen);
601         Put(EmbeddableMimes, IKEY(Priority), MT, HFreeStrBuf);
602 }
603
604 void CreateMimeStr(void)
605 {
606         HashPos  *it;
607         void *vMime;
608         long len = 0;
609         const char *Key;
610
611         it = GetNewHashPos(EmbeddableMimes, 0);
612         while (GetNextHashPos(EmbeddableMimes, it, &len, &Key, &vMime) &&
613                (vMime != NULL)) {
614                 if (StrLength(EmbeddableMimeStrs) > 0)
615                         StrBufAppendBufPlain(EmbeddableMimeStrs, HKEY("|"), 0);
616                 else 
617                         StrBufAppendBufPlain(EmbeddableMimeStrs, HKEY("MSGP "), 0);
618                 StrBufAppendBuf(EmbeddableMimeStrs, (StrBuf*) vMime, 0);
619         }
620         DeleteHashPos(&it);
621 }
622
623 void
624 ServerStartModule_SERV_FUNC
625 (void)
626 {
627         EmbeddableMimes = NewHash(1, Flathash);
628         EmbeddableMimeStrs = NewStrBuf();
629 }
630
631
632 void
633 ServerShutdownModule_SERV_FUNC
634 (void)
635 {
636         FreeStrBuf(&EmbeddableMimeStrs);
637         DeleteHash(&EmbeddableMimes);
638 }
639
640 void 
641 InitModule_SERVFUNC
642 (void)
643 {
644         is_uds = strcasecmp(ctdlhost, "uds") == 0;
645         if (is_uds)
646                 snprintf(serv_sock_name, PATH_MAX, "%s/citadel.socket", ctdlport);
647
648         RegisterConditional("COND:SERV:OPENID", 2, conditional_serv_supports_openid, CTX_NONE);
649         RegisterConditional("COND:SERV:NEWU", 2, conditional_serv_newuser_disabled, CTX_NONE);
650         RegisterConditional("COND:SERV:FULLTEXT_ENABLED", 2, conditional_serv_fulltext_enabled, CTX_NONE);
651         RegisterConditional("COND:SERV:LDAP_ENABLED", 2, conditional_serv_ldap_enabled, CTX_NONE);
652         RegisterConditional("COND:SERV:SUPPORTS_GUEST", 2, conditional_serv_supports_guest, CTX_NONE);
653         RegisterNamespace("SERV:PID", 0, 0, tmplput_serv_ip, NULL, CTX_NONE);
654         RegisterNamespace("SERV:NODENAME", 0, 1, tmplput_serv_nodename, NULL, CTX_NONE);
655         RegisterNamespace("SERV:HUMANNODE", 0, 1, tmplput_serv_humannode, NULL, CTX_NONE);
656         RegisterNamespace("SERV:FQDN", 0, 1, tmplput_serv_fqdn, NULL, CTX_NONE);
657         
658         RegisterNamespace("SERV:SOFTWARE", 0, 1, tmplput_serv_software, NULL, CTX_NONE);
659         RegisterNamespace("SERV:REV_LEVEL", 0, 0, tmplput_serv_rev_level, NULL, CTX_NONE);
660         RegisterNamespace("SERV:BBS_CITY", 0, 1, tmplput_serv_bbs_city, NULL, CTX_NONE);
661         RegisterNamespace("SERV:MESG", 1, 2, tmplput_mesg, NULL, CTX_NONE);
662         RegisterNamespace("SERV:ADMIN", 0, 1, tmplput_serv_admin, NULL, CTX_NONE);
663
664         RegisterNamespace("SERV:SITE:PREFIX", 0, 1, tmplput_site_prefix, NULL, CTX_NONE);
665
666
667 }
668
669
670
671 void 
672 SessionDestroyModule_SERVFUNC
673 (wcsession *sess)
674 {
675         DeleteServInfo(&sess->serv_info);
676 }