From: Art Cancro Date: Sat, 6 Oct 2007 04:06:03 +0000 (+0000) Subject: Added missing files to webcit build X-Git-Tag: v7.86~3011 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=5dd0be5ac393daefa256ac63da2a0831245eb059;p=citadel.git Added missing files to webcit build --- diff --git a/webcit/pushemail.c b/webcit/pushemail.c new file mode 100644 index 000000000..019e0fa1b --- /dev/null +++ b/webcit/pushemail.c @@ -0,0 +1,112 @@ +/* + * Edits a users push email settings + * Author: Mathew McBride + */ +#include "webcit.h" + +void display_pushemail(void) { + char buf[SIZ]; + int is_none = 0; + int is_pager = 0; + int is_funambol = 0; + char mobnum[20]; + svprintf("BOXTITLE", WCS_STRING, _("Push email and SMS settings")); + + /* Find any existing settings*/ + if (goto_config_room() == 0) { + int msgnum = 0; + serv_puts("MSGS ALL|0|1"); + serv_getln(buf, sizeof(buf)); + if (buf[0] == '8') { + serv_puts("subj|__ Push email settings __"); + serv_puts("000"); + while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) { + msgnum = atol(buf); + } + + } + if (msgnum > 0L) { + serv_printf("MSG0 %ld", msgnum); + serv_getln(buf, sizeof buf); + if (buf[0] == '1') { + while (serv_getln(buf, sizeof buf), + (strcmp(buf, "text") && strcmp(buf, "000"))) { + } + int i =0; + if (!strcmp(buf, "text")) { + while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { + if (strncasecmp(buf, "none", 4) == 0) { + is_none = 1; + } else if (strncasecmp(buf, "textmessage", 11) == 0) { + is_pager = 1; + i++; + } else if (strncasecmp(buf, "funambol", 8) == 0) { + is_funambol = 1; + } else if (i == 1) { + strncpy(mobnum, buf, 20); + i++; + } + } + } + } + } + if (is_none) { + svprintf("PUSH_NONE", WCS_STRING, "checked=\"checked\""); + } else if (is_pager) { + svprintf("PUSH_TEXT", WCS_STRING, "checked=\"checked\""); + svprintf("SMSNUM", WCS_STRING, "value=\"%s\"", mobnum); + } else if (is_funambol) { + svprintf("PUSH_FNBL", WCS_STRING, "checked=\"checked\""); + } + serv_printf("GOTO %s", WC->wc_roomname); + serv_getln(buf, sizeof buf); + } +output_headers(1, 1, 2, 0, 0, 0); +do_template("pushemail"); +//do_template("endbox"); +wDumpContent(1); +} + +void save_pushemail(void) { + char buf[SIZ]; + int msgnum = 0; + char *pushsetting = bstr("pushsetting"); + char *sms = NULL; + if (strncasecmp(pushsetting, "textmessage", 11) == 0) { + sms = bstr("user_sms_number"); + } + if (goto_config_room() != 0) return; /* oh well. */ + serv_puts("MSGS ALL|0|1"); + serv_getln(buf, sizeof buf); + if (buf[0] == '8') { + serv_puts("subj|__ Push email settings __"); + serv_puts("000"); + } else { + printf("Junk in save_pushemail buffer!: %s\n", buf); + return; + } + while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { + msgnum = atol(buf); + } + + if (msgnum > 0L) { + serv_printf("DELE %ld", msgnum); + serv_getln(buf, sizeof buf); + } + + serv_printf("ENT0 1||0|1|__ Push email settings __|"); + serv_getln(buf, sizeof buf); + if (buf[0] == '4') { + serv_puts(pushsetting); + if (sms != NULL) { + serv_puts(sms); + } + serv_puts(""); + serv_puts("000"); + } + + /** Go back to the room we're supposed to be in */ + serv_printf("GOTO %s", WC->wc_roomname); + serv_getln(buf, sizeof buf); + http_redirect("display_pushemail"); +} diff --git a/webcit/static/pushemail.html b/webcit/static/pushemail.html new file mode 100644 index 000000000..bf9213b8c --- /dev/null +++ b/webcit/static/pushemail.html @@ -0,0 +1,41 @@ + + +
+ +
+
+
+ + + +
+
+

If your administrator has enabled the functionality, Citadel can notify a + Funambol server that you haved recieved new email and automatically syncronize + any devices you have with the Funambol client installed.

+ +

Alternatively, if the administrator has configured it, Citadel can send a + text message to you when new mail arrives.

+
+ +
+

>Notify Funambol server

+ +

>Send a text message to... > (Use international format, without any + leading zeros, spaces or hypens, like +61415011501)

+ +

>Don't send any notifications

+ +

+
+
+
+
+
+