Back to index

courier  0.68.2
Functions
pcp.h File Reference
#include "config.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void sqpcp_init ()
void sqpcp_close ()
void sqpcp_login (const char *, const char *)
int sqpcp_loggedin ()
int sqpcp_has_calendar ()
int sqpcp_has_groupware ()
void sqpcp_summary ()
struct PCPsqpcp_calendar ()
void sqpcp_newevent ()
void sqpcp_eventstart ()
void sqpcp_eventfrom ()
void sqpcp_eventtimes ()
void sqpcp_eventparticipants ()
void sqpcp_eventtext ()
void sqpcp_eventattach ()
void sqpcp_eventend ()
void sqpcp_deleteattach ()
void sqpcp_uploadattach ()
void sqpcp_attachpubkey ()
void sqpcp_attachprivkey ()
void sqpcp_preview ()
void sqpcp_save ()
void sqpcp_postpone ()
void sqpcp_todays_date ()
void sqpcp_todays_date_verbose ()
void sqpcp_daily_view ()
void sqpcp_prevday ()
void sqpcp_nextday ()
void sqpcp_weeklylink ()
void sqpcp_monthlylink ()
void sqpcp_show_cal_week ()
void sqpcp_show_cal_nextweek ()
void sqpcp_show_cal_prevweek ()
void sqpcp_displayweek ()
void sqpcp_show_cal_month ()
void sqpcp_show_cal_nextmonth ()
void sqpcp_show_cal_prevmonth ()
void sqpcp_displaymonth ()
void sqpcp_displayeventinit ()
void sqpcp_displayevent ()
void sqpcp_eventbacklink ()
void sqpcp_eventeditlink ()
int sqpcp_eventedit ()
void sqpcp_eventcanceluncancellink ()
void sqpcp_eventcanceluncancelimage ()
void sqpcp_eventcanceluncanceltext ()
void sqpcp_eventdeletelink ()
void sqpcp_deleteeventinit ()
void sqpcp_dodelete ()
void sqpcp_eventacl ()

Function Documentation

Definition at line 2186 of file pcp.c.

{
       char *msg;

       msg=savedraft();
       previewdraft(msg, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2178 of file pcp.c.

{
       char *msg;

       msg=savedraft();
       previewdraft(msg, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

struct PCP* sqpcp_calendar ( ) [read]

Definition at line 749 of file pcp.c.

{
       const char *p;

       if (!sqpcp_mode())
       {
              errno=ENOENT;
              return (NULL);
       }

       if (calendar)
              return (calendar);

       p=getenv("AUTHADDR");

       if (!p)
       {
              errno=ENOENT;
              return (NULL);
       }

       if (sqpcp_has_groupware())
       {
              char token[256];
              char *pp;

              FILE *f=fopen(TOKEN, "r");

              if (!f)
                     return (NULL);

              if (fgets(token, sizeof(token), f) == NULL)
              {
                     fclose(f);
                     return (NULL);
              }

              if ((pp=strchr(token, '\n')) != 0) *pp=0;

              fclose(f);
              if (token[0] == 0)
              {
                     unlink(TOKEN);
                     return (NULL);
              }

              calendar=pcp_reopen_server(p, token, NULL);

              if (calendar)
              {
                     p=pcp_authtoken(calendar);

                     if (p && strcmp(p, token))
                     {
                            int u=umask(077);

                            /* Save new authentication token */

                            f=fopen(TOKEN, "w");
                            umask(u);
                            if (f)
                            {
                                   fprintf(f, "%s\n", token);
                                   fclose(f);
                            }
                     }
              }
              else
              {
                     unlink(TOKEN);
              }
              return (calendar);
       }

       return ((calendar=pcp_open_dir("calendar", p)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_close ( )

Definition at line 102 of file pcp.c.

Here is the caller graph for this function:

void sqpcp_daily_view ( )

Definition at line 2918 of file pcp.c.

{
       unsigned y, m, d;
       time_t start;
       time_t end;

       struct PCP *pcp;
       struct cacherecord *recs;
       unsigned n_recs;

       if (*cgi("clearcache"))
              unlink(CACHE);

       if (sscanf(cgi("date"), "%4u%2u%2u", &y, &m, &d) != 3
           || pcp_parse_ymd(y, m, d, &start, &end))
              return;

       if ((pcp=sqpcp_calendar()) == NULL)
       {
              printf("<span class=\"error\">%s</span>", strerror(errno));
              return;
       }

       if (createcache(pcp, &recs, &n_recs, start, end))
       {
              show_pcp_errmsg(pcp_errmsg(pcp));
              return;
       }

       (void)do_daily_view(recs, n_recs, VIEW_DAILY, NULL, NULL);
       destroycache(recs, n_recs);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2144 of file pcp.c.

{
       char *msg;

       msg=savedraft();
       previewdraft(msg, deleteattach);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3437 of file pcp.c.

{
       sqpcp_displayeventinit();
       if (*cgi("event_proxy"))
              printf("%s", getarg("PROXYWARN"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3275 of file pcp.c.

{
       struct PCP *pcp=sqpcp_calendar();
       const char *event_id_list[2];
       struct PCP_retr r;
       struct display_retr dr;
       struct maildir_tmpcreate_info createInfo;
       struct display_retr_time_list *tl;
       struct display_retr_participant_list *pl;

       if (!pcp)
              return;

       event_id_list[0]=cgi("eventid");
       event_id_list[1]=0;

       memset(&r, 0, sizeof(r));
       memset(&dr, 0, sizeof(dr));
       r.event_id_list=event_id_list;
       r.callback_arg=&dr;
       r.callback_rfc822_func=save_displayed_event;
       r.callback_retr_date=save_displayed_date;
       r.callback_retr_participants=save_displayed_participants;

       maildir_purgemimegpg(); /* Delete previous :calendar: file */

       maildir_tmpcreate_init(&createInfo);
       createInfo.uniq=":calendar:";
       createInfo.doordie=1;

       if ((dr.f=maildir_tmpcreate_fp(&createInfo)) == NULL)
       {
              error(strerror(errno));
       }

       cgi_put(MIMEGPGFILENAME, strrchr(createInfo.tmpname, '/')+1);

       if (pcp_retr(pcp, &r))
       {
              free_display_retr(&dr);
              fclose(dr.f);
              cgi_put(MIMEGPGFILENAME, "");
              unlink(createInfo.tmpname);
              maildir_tmpcreate_free(&createInfo);
              show_pcp_errmsg(pcp_errmsg(pcp));
              return;
       }
       fclose(dr.f);

       printf("<table class=\"calendarevent\" align=\"center\" border=\"0\"><tr valign=\"top\"><th align=\"left\">%s</th><td>",
              getarg("EVENT"));

       for (tl=dr.time_list; tl; tl=tl->next)
       {
              char buffer[512];

              if (pcp_fmttimerange(buffer, sizeof(buffer),
                                 tl->start, tl->end))
                     continue;

              printf("<span class=\"tt\">");
              print_safe(buffer);
              printf("</span><br />\n");
       }
       printf("</td></tr>\n");

       if (dr.participant_list)
       {
              printf("<tr valign=\"top\"><th align=\"left\">%s</th><td>",
                     getarg("PARTICIPANTS"));
              for (pl=dr.participant_list; pl; pl=pl->next)
              {
                     printf("<span class=\"tt\">&lt;");
                     print_safe(pl->participant);
                     printf("&gt;</span><br />\n");
              }
              printf("</td></tr>");
       }
       printf("</table>\n");
       folder_showmsg(INBOX "." DRAFTS, 0);
       free_display_retr(&dr);
       cgi_put(MIMEGPGFILENAME, "");
       maildir_tmpcreate_free(&createInfo);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3164 of file pcp.c.

{
       struct PCP *pcp;
       const char *event_id_list[2];
       struct PCP_retr r;

       showerror();

       pcp=sqpcp_calendar();

       if (!pcp)
              return;

       event_id_list[0]=cgi("eventid");
       event_id_list[1]=0;

       init_save_conflict();
       if (*cgi("docancel"))
       {
              if (pcp_cancel(pcp, event_id_list[0], NULL))
                     show_pcp_errmsg(pcp_errmsg(pcp));
              unlink(CACHE);
       }

       if (*cgi("douncancel"))
       {
              struct PCP_uncancel u;
              int flags=0;

              memset(&u, 0, sizeof(u));

              if (*cgi("okconflict"))
                     flags |= PCP_OK_CONFLICT;

              u.uncancel_conflict_callback=save_conflict;
              if (pcp_uncancel(pcp, event_id_list[0], flags, &u))
              {
                     saveerror(pcp, &u.errcode);
                     showerror();
                     if (u.errcode == PCP_ERR_CONFLICT)
                            cgi_put("okconflict", "1");
              }
              unlink(CACHE);
       }

       memset(&r, 0, sizeof(r));
       r.event_id_list=event_id_list;
       r.callback_retr_status=set_status;

       if (pcp_retr(pcp, &r))
       {
              show_pcp_errmsg(pcp_errmsg(pcp));
              return;
       }

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4013 of file pcp.c.

{
       int i, y, m;
       time_t start=get_start_of_month(), save_start;
       time_t end;
       struct PCP *pcp=sqpcp_calendar();
       struct cacherecord *recs;
       unsigned n_recs;
       struct tm *tmptr;

       if (!pcp)
              return;

       if ((tmptr=localtime(&start)) == NULL)
              return;

       y=tmptr->tm_year + 1900;
       m=tmptr->tm_mon + 1;

       if (++m > 12)
       {
              m=1;
              ++y;
       }

       if (pcp_parse_ymd(y, m, 1, &end, &save_start))
              return;

       if (createcache(pcp, &recs, &n_recs, start, end))
       {
              show_pcp_errmsg(pcp_errmsg(pcp));
              return;
       }

       printf("<table align=\"center\" border=\"0\" class=\"monthly-border\""
              " cellpadding=\"0\" cellspacing=\"0\" width=\"100%%\">"
              "<tr><td>\n");
       printf("<table border=\"1\" class=\"monthly-bg\" cellspacing=\"0\" cellpadding=\"10\" width=\"100%%\">"
              "<tr valign=\"top\">");

       for (i=0; i<7; i++)
       {
              printf("<td width=\"14%%\" align=\"center\" class=\"monthly-day\">");
              print_safe(pcp_wdayname((i + pref_startofweek) % 7));
              printf("</td>");
       }
       printf("</tr>\n");

       while (start < end)
       {
              printf("<tr valign=\"top\">\n");

              for (i=0; i<7; i++)
              {
                     struct tm *tmptr;
                     time_t next_day;

                     tmptr=localtime(&start);

                     if (tmptr->tm_wday != (i + pref_startofweek) % 7
                         || start >= end)
                     {
                            printf("<td width=\"14%%\" class=\"monthly-bg-othermonth\">&nbsp;</td>");
                            continue;
                     }

                     printf("<td width=\"14%%\">");


                     printf("<a href=\"");
                     output_scriptptrget();
                     printf("&amp;form=eventdaily&amp;date=");

                     if (tmptr)
                     {
                            printf("%04d%02d%02d", tmptr->tm_year + 1900,
                                   tmptr->tm_mon+1,
                                   tmptr->tm_mday);
                     }
                     printf("\" class=\"monthly-day\">");

                     printf("%2d", tmptr->tm_mday);
                     printf("</a><div align=\"center\"><hr width=\"70%%\" /></div>\n");

                     next_day=start;
                     nextday(&next_day);

                     do_daily_view(recs, n_recs, VIEW_MONTHLY, &start,
                                  &next_day);

                     start=next_day;
                     printf("</td>\n");
              }
              printf("</tr>\n");
       }
       destroycache(recs, n_recs);
       printf("</table>\n");
       printf("</td></tr></table>\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3849 of file pcp.c.

{
       int i;
       time_t start=get_start_of_week(), save_start;
       time_t end;
       struct PCP *pcp=sqpcp_calendar();
       struct cacherecord *recs;
       unsigned n_recs;

       if (!pcp)
              return;

       save_start=start;

       for (i=0; i<7; i++)
       {
              nextday(&start);
       }

       if (createcache(pcp, &recs, &n_recs, save_start, start))
       {
              show_pcp_errmsg(pcp_errmsg(pcp));
              return;
       }

       printf("<table align=\"center\" border=\"0\" class=\"weekly-border\""
              " cellpadding=\"0\" cellspacing=\"0\" width=\"100%%\">"
              "<tr><td>\n");
       printf("<table border=\"1\" class=\"weekly-bg\" cellspacing=\"0\" cellpadding=\"10\" width=\"100%%\">"
              "<tr valign=\"top\">");

       start=save_start;
       for (i=0; i<7; i++)
       {
              const char *p;
              struct tm *tmptr;

              printf("<td width=\"14%%\">");
              p=pcp_wdayname((i + pref_startofweek) % 7);
              printf("<div align=\"center\" class=\"weekly-day\">");
              printf("<a href=\"");
              output_scriptptrget();
              printf("&amp;form=eventdaily&amp;date=");

              tmptr=localtime(&start);

              if (tmptr)
              {
                     printf("%04d%02d%02d", tmptr->tm_year + 1900,
                            tmptr->tm_mon+1,
                            tmptr->tm_mday);
              }
              printf("\">");
              print_safe(p);
              printf("</a><hr width=\"70%%\" />");
              printf("</div>\n");

              end=start;
              nextday(&end);


              do_daily_view(recs, n_recs, VIEW_WEEKLY, &start, &end);

              start=end;
              printf("</td>");
       }
       destroycache(recs, n_recs);
       printf("</tr></table>\n");
       printf("</td></tr></table>\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_dodelete ( )

Definition at line 3455 of file pcp.c.

{
       struct PCP *pcp=sqpcp_calendar();
       struct PCP_retr r;
       const char *event_list_ary[2];
       struct PCP_delete del;
       struct proxy_update_list pul;
       FILE *tmpfp;

       if (!pcp)
              return;

       memset(&del, 0, sizeof(del));
       del.id=cgi("eventid");

       memset(&r, 0, sizeof(r));
       event_list_ary[0]=del.id;
       event_list_ary[1]=NULL;
       r.event_id_list=event_list_ary;
       r.callback_headers_func=save_orig_headers;

       tmpfp=tmpfile();
       if (!tmpfp)
              enomem();
       r.callback_arg=tmpfp;
       pcp_retr(pcp, &r);

       {
              time_t t;

              time(&t);

              fprintf(tmpfp, "Date: %s\n\n", rfc822_mkdate(t));
       }

       memset(&pul, 0, sizeof(pul));
       del.proxy_callback=&proxy_update_list_save;
       del.proxy_callback_ptr=&pul;

       if (pcp_delete(pcp, &del))
       {
              saveerror(pcp, &del.errcode);
              output_form("eventdelete.html");
       }
       else
       {
              proxy_notify_email(tmpfp, &pul, NULL, 0);
       }
       fclose(tmpfp);
       proxy_update_list_free(&pul);
       unlink(CACHE);
       output_form("eventdaily.html");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_eventacl ( )

Definition at line 4163 of file pcp.c.

{
       const char *p;
       struct acl_list *acl_list=NULL;
       struct PCP *pcp;
       struct acl_list *pp;

       if (!sqpcp_has_groupware())
              return;

       p=cgi("addemail");

       while (*p && isspace((int)(unsigned char)*p))
              ++p;

       if (!*p)
              p=cgi("addressbookname");

       if (*p)
              addacl(p);

       pcp=sqpcp_calendar();

       if (!pcp)
              return;

       if (*(p=cgi("remove")))
       {
              if (pcp_acl(pcp, p, 0))
              {
                     saveerror(pcp, NULL);
                     showerror();
              }
       }

       if (pcp_list_acl(pcp, listacl, &acl_list))
       {
              saveerror(pcp, NULL);
              showerror();
       }
       else if (ab_get_nameaddr(save_listacl_names, acl_list))
       {
              int dummy=PCP_ERR_SYSERR;

              saveerror(NULL, &dummy);
              showerror();
       }
       else if (acl_list)
       {
              printf("<table align=\"center\">\n");

              for (pp=acl_list; pp; pp=pp->next)
              {
                     printf("<tr><td align=\"right\"><span class=\"tt\">");
                     if (pp->addr)
                            ab_nameaddr_show(pp->name, pp->addr);

                     printf("</span></td><td>-");
                     if (pp->flags & PCP_ACL_MODIFY)
                            printf("&nbsp;%s", getarg("MODIFY"));
                     if (pp->flags & PCP_ACL_CONFLICT)
                            printf("&nbsp;%s", getarg("CONFLICT"));
                     printf("</td><td><a href=\"");
                     output_scriptptrget();
                     printf("&amp;form=eventacl&amp;remove=");
                     output_urlencoded(pp->addr);
                     printf("\">%s</a></td></tr>\n", getarg("REMOVE"));
              }
              printf("</table>\n");
       }

       while ((pp=acl_list) != NULL)
       {
              acl_list=pp->next;
              if (pp->addr)
                     free(pp->addr);
              if (pp->name)
                     free(pp->name);
              free(pp);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1112 of file pcp.c.

{
       const char *p;

       p=cgi("draftmessage");

       if (p && *p)
       {
              attachments_head(NULL, cgi("pos"), p);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3390 of file pcp.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3425 of file pcp.c.

{
       printf("%s", getarg(*cgi("event_cancelled")
                         ? "UNCANCELIMAGE":"CANCELIMAGE"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3416 of file pcp.c.

{
       print_event_link_url(cgi("eventid"), *cgi("event_cancelled")
                      ? (*cgi("okconflict") ?
                         "&amp;okconflict=1&amp;douncancel=1"
                         :"&amp;douncancel=1")
                          :"&amp;docancel=1");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3431 of file pcp.c.

{
       printf("%s", getarg(*cgi("event_cancelled")
                         ? "UNCANCELTEXT":"CANCELTEXT"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3405 of file pcp.c.

{
       const char *p=cgi("date");

       output_scriptptrget();
       printf("&amp;eventid=");

       output_urlencoded(cgi("eventid"));
       printf("&amp;form=eventdelete&amp;date=%s", p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sqpcp_eventedit ( )

Definition at line 3513 of file pcp.c.

{
       struct PCP *pcp=sqpcp_calendar();
       int newdraftfd;
       char *draftfilename;

       if (!pcp)
              return (-1);

       newdraftfd=maildir_createmsg(INBOX "." DRAFTS, 0, &draftfilename);
       if (doeventedit(pcp, newdraftfd))
       {
              maildir_deletenewmsg(newdraftfd, INBOX "." DRAFTS, draftfilename);
       }
       else if (maildir_closemsg(newdraftfd, INBOX "." DRAFTS, draftfilename, 1, 0))
       {
              cgi_put("error", "quota");
       }
       else
       {
              static char *filenamebuf=0;

              if (filenamebuf)
                     free(filenamebuf);

              filenamebuf=draftfilename;
              cgi_put("draftmessage", filenamebuf);
              return (0);
       }
       free(draftfilename);
       return (-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3396 of file pcp.c.

{
       const char *p=cgi("date");

       output_scriptptrget();
       printf("&amp;form=event-edit&amp;date=%s&amp;eventid=", p);
       output_urlencoded(cgi("eventid"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_eventend ( )

Definition at line 975 of file pcp.c.

{
       struct my_participant *m;

       while ((m=my_participant_list) != NULL)
       {
              my_participant_list=m->next;
              if (m->name)
                     free(m->name);
              if (m->address)
                     free(m->address);
              free(m);
       }

       if (event_time_list)
              free(event_time_list);
       event_time_list=NULL;
       n_event_time_list=0;

}

Here is the caller graph for this function:

void sqpcp_eventfrom ( )

Definition at line 1065 of file pcp.c.

{
       if (auth_getoptionenvint("wbnochangingfrom"))
       {
              printf("<span class=\"tt\">");
              print_safe(login_fromhdr());
              printf("</span>");
       }
       else
       {
              const char *p=cgi("headerfrom");

              if (!p || !*p)
                     p=pref_from;
              if (!p || !*p)
                     p=login_fromhdr();
              if (!p)
                     p="";

              printf("<input type=\"text\" name=\"headerfrom\" size=\"60\" value=\"");
              output_attrencoded(p);
              printf("\" />");
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1035 of file pcp.c.

{
       struct my_participant *m;

       if (!my_participant_list)
              return;

       (void)ab_get_nameaddr(save_participant_names, my_participant_list);

       printf("<table border=\"0\">");

       for (m=my_participant_list; m; m=m->next)
       {
              printf("<tr><td><span class=\"tt\">");
              if (m->address)
                     ab_nameaddr_show(m->name, m->address);

              printf("</span></td><td>&nbsp;&nbsp;<a href=\"");

              output_scriptptrget();
              printf("&amp;form=newevent&amp;draftmessage=");
              output_urlencoded(cgi("draftmessage"));
              printf("&amp;do.delparticipant=");
              output_urlencoded(m->address);
              printf("\"><font size=\"-2\">(%s)</font></a></td></tr>\n",
                     getarg("REMOVE"));
       }
       printf("</table>");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_eventstart ( )

Definition at line 861 of file pcp.c.

{
       const char *p=cgi("draftmessage");
       FILE *oldfp;
       struct rfc822hdr h;
       struct PCP_event_time_list {
              struct PCP_event_time_list *next;
              struct PCP_event_time t;
       } *event_time_listp=NULL, **lastp= &event_time_listp;
       unsigned event_time_list_cnt=0;

       sqpcp_eventend();

       if (!p || !*p)
              return;

       oldfp=openoldfp(p, NULL);
       if (!oldfp)
              return;

       rfc822hdr_init(&h, 8192);
       while (rfc822hdr_read(&h, oldfp, NULL, 0) == 0)
       {
              if (strcasecmp(h.header, "X-Event-Time") == 0 && h.value)
              {
                     unsigned long n1, n2;

                     if (sscanf(h.value, "%lu %lu", &n1, &n2) == 2)
                     {
                            struct PCP_event_time_list *t=
                                   malloc(sizeof(**lastp));

                            if (!t)
                            {
                                   rfc822hdr_free(&h);
                                   sqpcp_eventend();
                                   enomem();
                                   return;
                            }
                            *lastp=t;
                            t->next=NULL;
                            t->t.start=(time_t)n1;
                            t->t.end=(time_t)n2;
                            ++event_time_list_cnt;
                            lastp=&t->next;
                     }
              }
              else if (strcasecmp(h.header, "X-Event-Participant") == 0 && h.value)
              {
                     add_my_participant(h.value);
              }
              else if (strcasecmp(h.header, "from") == 0 && h.value)
              {
                     rfc822hdr_collapse(&h);
                     if (from_buf)
                            free(from_buf);

                     from_buf=NULL;

                     if ((from_buf=
                          rfc822_display_hdrvalue_tobuf(h.header,
                                                    h.value,
                                                    sqwebmail_content_charset,
                                                    NULL, NULL)) == NULL)
                            from_buf=strdup(h.value);

                     if (from_buf)
                            cgi_put("from", from_buf);
              }
              else if (strcasecmp(h.header, "subject") == 0 && h.value)
              {
                     rfc822hdr_collapse(&h);
                     if (subj_buf)
                            free(subj_buf);

                     subj_buf=rfc822_display_hdrvalue_tobuf(h.header,
                                                        h.value,
                                                        sqwebmail_content_charset,
                                                        NULL, NULL);
                     if (!subj_buf)
                            subj_buf=strdup(subj_buf);

                     if (subj_buf)
                            cgi_put("headersubject", subj_buf);
              }
       }
       rfc822hdr_free(&h);
       if (event_time_list_cnt)
       {
              struct PCP_event_time *list1;
              struct PCP_event_time_list *p;

              list1=malloc(sizeof(struct PCP_event_time_list)
                          *event_time_list_cnt);
              if (!list1)
              {
                     sqpcp_eventend();
                     enomem();
                     return;
              }
              event_time_list_cnt=0;
              while ((p=event_time_listp) != NULL)
              {
                     list1[event_time_list_cnt]=p->t;
                     ++event_time_list_cnt;
                     event_time_listp=p->next;
                     free(p);
              }

              event_time_list=list1;
              n_event_time_list=event_time_list_cnt;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_eventtext ( )

Definition at line 1090 of file pcp.c.

{
       const char *p;

       printf("<textarea name=\"message\" cols=\"%d\" rows=\"15\" wrap=\"soft\">",
              MYLINESIZE);
       p=cgi("draftmessage");

       if (p && *p)
       {
              FILE *fp=openoldfp(p, NULL);
              int dummy;

              if (fp)
              {
                     newmsg_showfp(fp, &dummy);
              }
              fclose(fp);
       }
       printf("</textarea>\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_eventtimes ( )

Definition at line 996 of file pcp.c.

{
       char buffer[512];
       unsigned i;

       for (i=0; i<n_event_time_list; i++)
       {
              if (i)
                     printf("<br />\n");
              if (pcp_fmttimerange(buffer, sizeof(buffer),
                                 event_time_list[i].start,
                                 event_time_list[i].end))
                     continue;
              printf("<span class=\"tt\">");
              print_safe(buffer);
              printf("&nbsp;&nbsp;</span><a href=\"");
              output_scriptptrget();
              printf("&amp;form=newevent&amp;draftmessage=");
              output_urlencoded(cgi("draftmessage"));
              printf("&amp;do.deleventtime=%s-%s\"><font size=\"-2\">"
                     "(%s)</font></a>",
                     libmail_str_time_t(event_time_list[i].start, buffer),
                     libmail_str_time_t(event_time_list[i].end, buffer+NUMBUFSIZE),
                     getarg("REMOVE")
                     );
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 222 of file pcp.c.

{
       return (sqpcp_mode() ? 1:0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 227 of file pcp.c.

{
       const char *p=sqpcp_mode();

       return (p && strcmp(p, "net") == 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_init ( )

Definition at line 93 of file pcp.c.

Here is the caller graph for this function:

int sqpcp_loggedin ( )

Definition at line 245 of file pcp.c.

{
       struct PCP *pcp;

       if (!sqpcp_mode())
              return (0);

       if (sqpcp_has_groupware())
       {
              struct stat stat_buf;

              if (stat(TOKEN, &stat_buf))
                     return (0);   /* Login session dropped */
       }

       if (!need_refresh())
              return (1);
       pcp=sqpcp_calendar();
       if (pcp)
              refreshcache(pcp);
       return (1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_login ( const char *  ,
const char *   
)

Definition at line 149 of file pcp.c.

{
       do_pcplogin(userid, password, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2894 of file pcp.c.

{
       const char *p=cgi("date");

       if (!*p)
              p=cgi("weekof");
       output_scriptptrget();
       printf("&amp;form=eventmonthly&amp;monthof=%s", p);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_newevent ( )

Definition at line 1687 of file pcp.c.

{
       char *draftfilename;
       int newdraftfd;
       const char *p;
       unsigned long prev_size=0;
       FILE *oldfp=NULL;
       int errflag=0;
       int do_newevent= *cgi("do.neweventtime") ? 1:0;
       int do_newparticipant= *cgi("do.addparticipant") ? 1:0;
       int do_delevent=0;
       int do_delparticipant= *cgi("do.delparticipant") ? 1:0;
       time_t delstart=0, delend=0;

       static char *draftmessage_buf=0;

       showerror();

       if (!do_newevent)
       {
              if ((p=cgi("do.deleventtime")) && *p)
              {
                     unsigned long a, b;

                     if (sscanf(p, "%lu-%lu", &a, &b) == 2)
                     {
                            delstart=(time_t)a;
                            delend=(time_t)b;
                            do_delevent=1;
                     }
              }
       }

       p=cgi("draftmessage");

       if (!do_newevent && !do_delevent && !do_newparticipant
           && !do_delparticipant)
       {
              if (*cgi("do.neweventpreview") && p && *p)
              {
                     printf("<table width=\"100%%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\" class=\"box-small-outer\"><tr><td>\n");
                     printf("<table width=\"100%%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\" class=\"preview\"><tr><td>\n");
                     newmsg_preview(p);
                     printf("</td></tr></table>\n");
                     printf("</td></tr></table>\n");
              }
              return;
       }

       if (p && *p)
       {
              oldfp=openoldfp(p, &prev_size);
              if (!oldfp)
                     p="";
       }

       if (p && *p)
       {
              newdraftfd=maildir_recreatemsg(INBOX "." DRAFTS, p, &draftfilename);
       }
       else
       {
              newdraftfd=maildir_createmsg(INBOX "." DRAFTS, 0, &draftfilename);
              maildir_writemsgstr(newdraftfd, "X-Event: 1\n");

              if (draftmessage_buf)
                     free(draftmessage_buf);
              if ((draftmessage_buf=strdup(draftfilename)) != 0)
                     cgi_put("draftmessage", draftmessage_buf);
       }

       if (do_newevent || do_delevent || do_newparticipant
           || do_delparticipant)
       {
              if (oldfp)
              {
                     struct rfc822hdr h;

                     rfc822hdr_init(&h, 8192);
                     while (rfc822hdr_read(&h, oldfp, NULL, 0) == 0)
                     {
                            unsigned long a, b;
                            if (do_delevent && strcasecmp(h.header,
                                                       "X-Event-Time")
                                == 0 && h.value && sscanf(h.value,
                                                       "%lu %lu",
                                                       &a, &b) == 2)

                            {
                                   if ( (time_t)a == delstart &&
                                        (time_t)b == delend)
                                          continue;
                            }

                            if (do_delparticipant
                                && strcasecmp(h.header, "X-Event-Participant")
                                == 0 && h.value)
                            {
                                   if (strcmp(h.value,
                                             cgi("do.delparticipant"))
                                       == 0)
                                          continue;
                            }
                            if (strcasecmp(h.header,
                                          "X-Event-Participant") == 0 &&
                                h.value)
                                   add_my_participant(h.value);

                            if (strcasecmp(h.header, "To") == 0)
                                   continue;
                            /* To: header rebuilt later */

                            maildir_writemsgstr(newdraftfd, h.header);
                            maildir_writemsgstr(newdraftfd, ": ");
                            maildir_writemsgstr(newdraftfd, h.value);
                            maildir_writemsgstr(newdraftfd, "\n");
                     }
                     rfc822hdr_free(&h);

              }

              if (do_newevent && addtime(newdraftfd))
              {
                     errflag=1;
                     printf("%s", getarg("TIMEERR"));
              }

              if (do_newparticipant)
              {
                     const char *p=cgi("addressbookname");

                     if (!*p)
                            p=cgi("participant1");

                     addparticipant(newdraftfd, p);
              }

              (void)ab_get_nameaddr(save_participant_names,
                                  my_participant_list);

#if 0
              {
                     struct rfc822t *t;
                     struct rfc822a *a;
                     char *p;
                     char *tohdr;
                     size_t tohdr_size;

                     mktohdr(NULL, &tohdr_size);

                     tohdr=malloc(tohdr_size);
                     if (!tohdr)
                            enomem();

                     mktohdr(tohdr, &tohdr_size);

                     if ((t=rfc822t_alloc_new(tohdr, NULL, NULL)) == NULL)
                     {
                            free(tohdr);
                            enomem();
                     }

                     if ((a=rfc822a_alloc(t)) == NULL)
                     {
                            rfc822t_free(t);
                            free(tohdr);
                            enomem();
                     }

                     p=rfc2047_encode_header(a,sqwebmail_content_charset);

                     if (!p)
                     {
                            rfc822a_free(a);
                            rfc822t_free(t);
                            free(tohdr);
                            enomem();
                     }
                     free(tohdr);
                     tohdr=p;
                     rfc822a_free(a);
                     rfc822t_free(t);

                     maildir_writemsgstr(newdraftfd, tohdr);
                     maildir_writemsgstr(newdraftfd, "\n");
                     free(tohdr);
              }
#endif

              sqpcp_eventend(); /* Deallocate participant list */

              maildir_writemsgstr(newdraftfd, "\n");
       }

       if (oldfp)
       {
              char buf[BUFSIZ];
              int n;

              while ((n=fread(buf, 1, sizeof(buf), oldfp)) > 0)
                     maildir_writemsg(newdraftfd, buf, n);
       }

       if (oldfp)
              fclose(oldfp);

       if (errflag)
       {
              maildir_deletenewmsg(newdraftfd, INBOX "." DRAFTS, draftfilename);
       }
       else if (maildir_closemsg(newdraftfd, INBOX "." DRAFTS, draftfilename, 1,
                              prev_size))
       {
              printf("%s", getarg("QUOTAERR"));
       }

       free(draftfilename);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_nextday ( )

Definition at line 3103 of file pcp.c.

{
       unsigned y, m, d;
       time_t start;
       time_t end;
       struct tm *tm;
       char buf[256];

       if (sscanf(cgi("date"), "%4u%2u%2u", &y, &m, &d) != 3
           || pcp_parse_ymd(y, m, d, &start, &end))
              return;

       start=end;

       if ((tm=localtime(&start)) == NULL)
              return;

       y=tm->tm_year + 1900;
       m=tm->tm_mon + 1;
       d=tm->tm_mday;

       if (pcp_parse_ymd(y, m, d, &start, &end)
           || (tm=localtime(&start)) == NULL
           || strftime(buf, sizeof(buf), getarg("NEXTDAY"), tm) == 0)
              return;

       printf("<a class=\"dailynextprev\" href=\"");
       output_scriptptrget();
       printf("&amp;form=eventdaily&amp;date=%04d%02d%02d\">%s</a>", y, m, d, buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_postpone ( )

Definition at line 2133 of file pcp.c.

{
       char *msg;

       msg=savedraft();
       free(msg);
       output_form("folders.html");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_prevday ( )

Definition at line 3072 of file pcp.c.

{
       unsigned y, m, d;
       time_t start;
       time_t end;
       struct tm *tm;
       char buf[256];

       if (sscanf(cgi("date"), "%4u%2u%2u", &y, &m, &d) != 3
           || pcp_parse_ymd(y, m, d, &start, &end))
              return;

       start -= 12 * 60 * 60;

       if ((tm=localtime(&start)) == NULL)
              return;

       y=tm->tm_year + 1900;
       m=tm->tm_mon + 1;
       d=tm->tm_mday;

       if (pcp_parse_ymd(y, m, d, &start, &end)
           || (tm=localtime(&start)) == NULL
           || strftime(buf, sizeof(buf), getarg("PREVDAY"), tm) == 0)
              return;

       printf("<a class=\"dailynextprev\" href=\"");
       output_scriptptrget();
       printf("&amp;form=eventdaily&amp;date=%04d%02d%02d\">%s</a>", y, m, d, buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_preview ( )

Definition at line 2125 of file pcp.c.

{
       char *msg;

       msg=savedraft();
       previewdraft(msg, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_save ( )

Definition at line 2411 of file pcp.c.

{
       char *msg, *sentmsg, *p;
       FILE *fp;
       struct saveinfo si;
       int isgpgerr;

       msg=savedraft();
       if (*cgi("error"))   /* Error, go back to the screen */
       {
              previewdraft(msg, NULL);
              return;
       }

       fp=openoldfp(msg, NULL);
       if (!fp)
       {
              free(msg);
              enomem();
       }

       if (init_saveinfo(&si, fp))
       {
              fclose(fp);
              free(msg);
              enomem();
       }

       if (si.times == 0)
       {
              fclose(fp);
              cgi_put("error", "time");
              previewdraft(msg, NULL);
              return;
       }
       fclose(fp);

       sentmsg=newmsg_createsentmsg(msg, &isgpgerr);

       /* Immediately remove the formatted event text from the sent folder */

       if (sentmsg)
       {
              p=maildir_find(INBOX "." SENT, sentmsg);
              free(sentmsg);
              sentmsg=p;
       }

       if (!sentmsg)
       {
              cgi_put("error", "quota");  /* TODO: gpgerr */
              free_saveinfo(&si);
              previewdraft(msg, NULL);
              return;
       }


       fp=fopen(sentmsg, "r");
       if (!fp)
       {
              free(sentmsg);
              free(msg);
              free_saveinfo(&si);
              enomem();
              return;
       }

       fcntl(fileno(fp), F_SETFD, FD_CLOEXEC);

       unlink(sentmsg);
       dropquota(sentmsg, fileno(fp));
       free(sentmsg);

       if (dosave(fp, &si))
       {
              fclose(fp);
              free_saveinfo(&si);
              previewdraft(msg, NULL);
              return;
       }
       fclose(fp);

       p=maildir_find(INBOX "." DRAFTS, msg);
       free(msg);

       fp=p ? fopen(p, "r"):NULL;
       unlink(p);
       if (fp)
       {
              dropquota(p, fileno(fp));
              fclose(fp);
       }
       free(p);
       free_saveinfo(&si);
       output_form("folders.html");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3951 of file pcp.c.

{
       time_t start=get_start_of_month();
       struct tm *tmptr;
       char buf[512];

       if ((tmptr=localtime(&start)) == NULL)
              return;

       if (strftime(buf, sizeof(buf), getarg("DATEFORMAT"), tmptr) == 0)
              return;

       print_safe(buf);

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3967 of file pcp.c.

{
       time_t start=get_start_of_month();
       struct tm *tmptr;
       int m, y;

       if ((tmptr=localtime(&start)) == NULL)
              return;

       y=tmptr->tm_year + 1900;
       m=tmptr->tm_mon + 1;

       ++m;
       if (m > 12)
       {
              m=1;
              ++y;
       }

       output_scriptptrget();
       printf("&amp;form=eventmonthly&amp;monthof=%04d%02d01", y, m);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3813 of file pcp.c.

{
       time_t start=get_start_of_week();
       int i;
       struct tm *tmptr;

       for (i=0; i<7; i++)
              nextday(&start);

       if ((tmptr=localtime(&start)) == NULL)
              return;

       output_scriptptrget();
       printf("&amp;form=eventweekly&amp;weekof=%04d%02d%02d",
              tmptr->tm_year + 1900, tmptr->tm_mon+1, tmptr->tm_mday);

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3990 of file pcp.c.

{
       time_t start=get_start_of_month();
       struct tm *tmptr;
       int m, y;

       if ((tmptr=localtime(&start)) == NULL)
              return;

       y=tmptr->tm_year + 1900;
       m=tmptr->tm_mon + 1;

       --m;
       if (m <= 0)
       {
              m=12;
              --y;
       }

       output_scriptptrget();
       printf("&amp;form=eventmonthly&amp;monthof=%04d%02d01", y, m);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3831 of file pcp.c.

{
       time_t start=get_start_of_week();
       int i;
       struct tm *tmptr;

       for (i=0; i<7; i++)
              prevday(&start);

       if ((tmptr=localtime(&start)) == NULL)
              return;

       output_scriptptrget();
       printf("&amp;form=eventweekly&amp;weekof=%04d%02d%02d",
              tmptr->tm_year + 1900, tmptr->tm_mon+1, tmptr->tm_mday);

}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3798 of file pcp.c.

{
       time_t start=get_start_of_week();
       struct tm *tmptr;
       char buf[512];

       if ((tmptr=localtime(&start)) == NULL)
              return;

       if (strftime(buf, sizeof(buf), getarg("DATEFORMAT"), tmptr) == 0)
              return;

       print_safe(buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_summary ( )

Definition at line 1129 of file pcp.c.

{
       FILE *fp;
       int cnt=0;
       time_t now;
       struct tm *tmptr;

       if (!sqpcp_mode())
              return;

       if (*cgi("do.calendarlogin"))
       {
              const char *userid=getenv("AUTHADDR");
              const char *password=cgi("password");

              if (userid && password)
              {
                     do_pcplogin(userid, password, 1);
              }
       }

       if (sqpcp_has_groupware())
       {
              if (!sqpcp_loggedin())
              {
                     insert_include("calendarlogin");
                     return;
              }
       }

       time(&now);
       tmptr=localtime(&now);

       if (tmptr)
       {
              char *p=scriptptrget();
              char *q=malloc(strlen(p)+200);

              if (!q)
              {
                     free(p);
                     enomem();
              }

              strcpy(q, p);
              free(p);
              strcat(q, "&amp;form=eventdaily&amp;clearcache=1&amp;date=");
              sprintf(q+strlen(q), "%04d%02d%02d",
                     tmptr->tm_year + 1900,
                     tmptr->tm_mon+1,
                     tmptr->tm_mday);

              printf(getarg("CALENDAR"), q);
              free(q);
       }

       printf("<table class=\"eventsummary\" width=\"100%%\">");

       if ((fp=fopen(CACHE, "r")) != NULL)
       {
              char buffer[BUFSIZ];
              int i;
              char last_date[256];
              char date[256];
              char date2[256];
              struct tm *tm;
              char yyyymmdd[9];

              char time1[128];
              char time2[128];

              last_date[0]=0;

              for (;;)
              {
                     int c;
                     struct cacherecord cr;

                     i=0;

                     while ((c=getc(fp)) != EOF && c != '\n')
                     {
                            if (i < sizeof(buffer)-1)
                                   buffer[i++]=(char)c;
                     }
                     buffer[i]=0;
                     if (i == 0 && c == EOF)
                            break;

                     parsecache_rec(buffer, &cr);

                     if (pcp_fmttime(date, sizeof(date),
                                   cr.start, FMTTIME_DATE))
                            continue;
                     if (pcp_fmttime(date2, sizeof(date2),
                                   cr.end, FMTTIME_DATE))
                            continue;

                     if (pcp_fmttime(time1, sizeof(time1),
                                   cr.start,
                                   FMTTIME_TIME))
                            continue;

                     if (pcp_fmttime(time2,
                                   sizeof(time2),
                                   cr.end,
                                   FMTTIME_TIME))
                            continue;

                     tm=localtime(&cr.start);
                     if (!tm)
                            continue;
                     sprintf(yyyymmdd, "%04d%02d%02d",
                            tm->tm_year + 1900,
                            tm->tm_mon + 1,
                            tm->tm_mday);

                     i=0;
                     if (last_date[0] && strcmp(last_date, date) == 0)
                     {
                            if (strcmp(last_date, date2) == 0)
                            {
                                   /* Same day as last event */

                                   printf("<tr><td align=\"left\" width=\"1%%\">&nbsp;</td>"
                                          "<td align=\"left\">&nbsp;"
                                          "<a href=\"");
                                   print_event_link_url(cr.eventid, "");
                                   printf("&amp;date=%s\">", yyyymmdd);
                                   print_safe(time1);
                                   printf("&nbsp;-&nbsp;");
                                   print_safe(time2);
                                   printf("</a></td>");
                                   i=1;
                            }
                            else
                            {
                                   last_date[0]=0;
                            }
                     }
                     else
                     {
                            last_date[0]=0;
                            if (strcmp(date, date2) == 0)
                                   strcpy(last_date, date);
                     }

                     if (!i)
                     {
                            if (cnt)
                                   printf("<tr><td style=\"line-height: 0px; font-size: 8px\" colspan=\"3\">"
                                          "&nbsp;"
                                          "</td></tr>\n");
                            if (strcmp(date, date2))
                            {
                                   printf("<tr><td colspan=\"2\">"
                                          "<a href=\"");
                                   print_event_link_url(cr.eventid, "");
                                   printf("&amp;date=%s\">", yyyymmdd);
                                   print_safe(date);
                                   printf("&nbsp;");
                                   print_safe(time1);
                                   printf("&nbsp;-&nbsp;");
                                   print_safe(date2);
                                   printf("&nbsp;");
                                   print_safe(time2);
                                   printf("</a></td>");
                            }
                            else
                            {
                                   printf("<tr><td width=\"1%%\">"
                                          "<a href=\"");
                                   print_event_link_url(cr.eventid, "");
                                   printf("&amp;date=%s\">", yyyymmdd);
                                   print_safe(date);
                                   printf("</a></td><td>&nbsp;"
                                          "<a href=\"");
                                   print_event_link_url(cr.eventid, "");
                                   printf("&amp;date=%s\">", yyyymmdd);
                                   print_safe(time1);
                                   printf("&nbsp;-&nbsp;");
                                   print_safe(time2);
                                   printf("</a></td>");
                            }
                     }

                     printf("<td width=\"100%%\">"
                            "<a href=\"");
                     print_event_link_url(cr.eventid, "");
                     printf("&amp;date=%s\">&nbsp;&nbsp;", yyyymmdd);
                     print_event_subject(cr.flags, cr.subject, 60);
                     printf("</a></td></tr>\n");
                     ++cnt;
              }
              fclose(fp);
       }

       if (cnt == 0)
       {
              printf("<tr><td align=\"center\">%s</td></tr>\n",
                     getarg("NOEVENTS"));
       }

       printf("</table>\n");
       printf("<a href=\"");
       output_scriptptrget();
       printf("&amp;form=newevent\">%s</a>", getarg("NEWEVENT"));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2856 of file pcp.c.

{
       unsigned y, m, d;
       time_t start;
       time_t end;
       char buf[100];

       if (sscanf(cgi("date"), "%4u%2u%2u", &y, &m, &d) != 3
           || pcp_parse_ymd(y, m, d, &start, &end)
           || pcp_fmttime(buf, sizeof(buf), start, FMTTIME_DATE))
              return;

       print_safe(buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2871 of file pcp.c.

{
       unsigned y, m, d;
       time_t start;
       time_t end;
       char buf[500];
       struct tm *tmptr;

       if (sscanf(cgi("date"), "%4u%2u%2u", &y, &m, &d) != 3
           || pcp_parse_ymd(y, m, d, &start, &end)
           || (tmptr=localtime(&start)) == NULL
           || strftime(buf, sizeof(buf), getarg("DATEFORMAT"), tmptr) == 0)
              return;

       print_safe(buf);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2159 of file pcp.c.

{
       char *msg;

       msg=savedraft();
       previewdraft(msg, doupload);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sqpcp_weeklylink ( )

Definition at line 2888 of file pcp.c.

{
       output_scriptptrget();
       printf("&amp;form=eventweekly&amp;weekof=%s", cgi("date"));
}

Here is the call graph for this function:

Here is the caller graph for this function: