* add custom notification targets config interface
authorWilfried Göesgens <willi@citadel.org>
Sun, 28 Jun 2009 22:21:16 +0000 (22:21 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 28 Jun 2009 22:21:16 +0000 (22:21 +0000)
webcit/config.guess
webcit/config.sub
webcit/inetconf.c
webcit/pushemail.c
webcit/static/t/aide_inet_notify.html [new file with mode: 0644]
webcit/static/t/aide_inetconf.html
webcit/static/t/pushemail.html

index da8331460888af3b367e2a9df88cb52022866c73..f32079abda668e5fc8f8de6f226e7b26384e8a03 100755 (executable)
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 #   Free Software Foundation, Inc.
 
-timestamp='2009-04-27'
+timestamp='2008-01-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -324,9 +324,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        case `/usr/bin/uname -p` in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
-    s390x:SunOS:*:*)
-       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
-       exit ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
@@ -334,20 +331,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       eval $set_cc_for_build
-       SUN_ARCH="i386"
-       # If there is a compiler, see if it is configured for 64-bit objects.
-       # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
-       # This test works for both compilers.
-       if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-           if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-               (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-               grep IS_64BIT_ARCH >/dev/null
-           then
-               SUN_ARCH="x86_64"
-           fi
-       fi
-       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
@@ -812,7 +796,7 @@ EOF
            x86)
                echo i586-pc-interix${UNAME_RELEASE}
                exit ;;
-           EM64T | authenticamd | genuineintel)
+           EM64T | authenticamd)
                echo x86_64-unknown-interix${UNAME_RELEASE}
                exit ;;
            IA64)
@@ -951,9 +935,6 @@ EOF
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
        exit ;;
-    padre:Linux:*:*)
-       echo sparc-unknown-linux-gnu
-       exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -1004,6 +985,9 @@ EOF
          a.out-i386-linux)
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
                exit ;;
+         coff-i386)
+               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+               exit ;;
          "")
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
                # one that does not give us useful --help.
@@ -1118,11 +1102,8 @@ EOF
     pc:*:*:*)
        # Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i586.
-       # Note: whatever this is, it MUST be the same as what config.sub
-       # prints for the "djgpp" host, or else GDB configury will decide that
-       # this is a cross-build.
-       echo i586-pc-msdosdjgpp
+        # the processor, so we play safe by assuming i386.
+       echo i386-pc-msdosdjgpp
         exit ;;
     Intel:Mach:3*:*)
        echo i386-pc-mach3
@@ -1160,16 +1141,6 @@ EOF
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && { echo i486-ncr-sysv4; exit; } ;;
-    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
-       OS_REL='.3'
-       test -r /etc/.relid \
-           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
-       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
-       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
-       /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
        echo m68k-unknown-lynxos${UNAME_RELEASE}
        exit ;;
@@ -1245,9 +1216,6 @@ EOF
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
        exit ;;
-    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
-       echo i586-pc-haiku
-       exit ;;
     SX-4:SUPER-UX:*:*)
        echo sx4-nec-superux${UNAME_RELEASE}
        exit ;;
@@ -1356,9 +1324,6 @@ EOF
     i*86:rdos:*:*)
        echo ${UNAME_MACHINE}-pc-rdos
        exit ;;
-    i*86:AROS:*:*)
-       echo ${UNAME_MACHINE}-pc-aros
-       exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
index a39437d0158ed7058a189617db490472252a70ae..6759825a5b7fcf64476b4398dc0e30b3090b925c 100755 (executable)
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 #   Free Software Foundation, Inc.
 
-timestamp='2009-04-17'
+timestamp='2008-01-16'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -122,7 +122,6 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
-  kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -250,16 +249,13 @@ case $basic_machine in
        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
        | i370 | i860 | i960 | ia64 \
        | ip2k | iq2000 \
-       | lm32 \
        | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | mcore | mep | metag \
+       | maxq | mb | microblaze | mcore | mep \
        | mips | mipsbe | mipseb | mipsel | mipsle \
        | mips16 \
        | mips64 | mips64el \
-       | mips64octeon | mips64octeonel \
-       | mips64orion | mips64orionel \
-       | mips64r5900 | mips64r5900el \
        | mips64vr | mips64vrel \
+       | mips64orion | mips64orionel \
        | mips64vr4100 | mips64vr4100el \
        | mips64vr4300 | mips64vr4300el \
        | mips64vr5000 | mips64vr5000el \
@@ -272,7 +268,6 @@ case $basic_machine in
        | mipsisa64sr71k | mipsisa64sr71kel \
        | mipstx39 | mipstx39el \
        | mn10200 | mn10300 \
-       | moxie \
        | mt \
        | msp430 \
        | nios | nios2 \
@@ -282,7 +277,7 @@ case $basic_machine in
        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
        | pyramid \
        | score \
-       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
        | sh64 | sh64le \
        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -291,7 +286,7 @@ case $basic_machine in
        | v850 | v850e \
        | we32k \
        | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-       | z8k | z80)
+       | z8k)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -334,17 +329,14 @@ case $basic_machine in
        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
        | i*86-* | i860-* | i960-* | ia64-* \
        | ip2k-* | iq2000-* \
-       | lm32-* \
        | m32c-* | m32r-* | m32rle-* \
        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* \
        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
        | mips16-* \
        | mips64-* | mips64el-* \
-       | mips64octeon-* | mips64octeonel-* \
-       | mips64orion-* | mips64orionel-* \
-       | mips64r5900-* | mips64r5900el-* \
        | mips64vr-* | mips64vrel-* \
+       | mips64orion-* | mips64orionel-* \
        | mips64vr4100-* | mips64vr4100el-* \
        | mips64vr4300-* | mips64vr4300el-* \
        | mips64vr5000-* | mips64vr5000el-* \
@@ -366,20 +358,20 @@ case $basic_machine in
        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
        | pyramid-* \
        | romp-* | rs6000-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
        | sparclite-* \
        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
        | tahoe-* | thumb-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
        | tron-* \
        | v850-* | v850e-* | vax-* \
        | we32k-* \
        | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
        | xstormy16-* | xtensa*-* \
        | ymp-* \
-       | z8k-* | z80-*)
+       | z8k-*)
                ;;
        # Recognize the basic CPU types without company name, with glob match.
        xtensa*)
@@ -447,10 +439,6 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-bsd
                ;;
-       aros)
-               basic_machine=i386-pc
-               os=-aros
-               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -471,10 +459,6 @@ case $basic_machine in
                basic_machine=c90-cray
                os=-unicos
                ;;
-        cegcc)
-               basic_machine=arm-unknown
-               os=-cegcc
-               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -542,10 +526,6 @@ case $basic_machine in
                basic_machine=m88k-motorola
                os=-sysv3
                ;;
-       dicos)
-               basic_machine=i686-pc
-               os=-dicos
-               ;;
        djgpp)
                basic_machine=i586-pc
                os=-msdosdjgpp
@@ -1148,10 +1128,6 @@ case $basic_machine in
                basic_machine=z8k-unknown
                os=-sim
                ;;
-       z80-*-coff)
-               basic_machine=z80-unknown
-               os=-sim
-               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -1190,7 +1166,7 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+       sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
                basic_machine=sh-unknown
                ;;
        sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1262,9 +1238,8 @@ case $os in
        -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
              | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
-             | -kopensolaris* \
              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* | -aros* \
+             | -aos* \
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1273,7 +1248,7 @@ case $os in
              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* | -cegcc* \
+             | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
              | -uxpv* | -beos* | -mpeix* | -udk* \
@@ -1413,9 +1388,6 @@ case $os in
        -zvmoe)
                os=-zvmoe
                ;;
-       -dicos*)
-               os=-dicos
-               ;;
        -none)
                ;;
        *)
index 5882bb5bb5f088bbcd3580e82fae586099edbb6c..40966f24eb6284183f5f0c0bfe048d5c3b320123 100644 (file)
@@ -16,6 +16,7 @@ typedef enum _e_cfg {
        ic_spamass,
        ic_masq,
        ic_clamav,
+       ic_notify,
        ic_max
 } ECfg;
 
@@ -33,7 +34,8 @@ ConstStrBuf CfgNames[] = {
        { HKEY("rbl") },
        { HKEY("spamassassin") },
        { HKEY("masqdomain") },
-       { HKEY("clamav") }
+       { HKEY("clamav") },
+       { HKEY("notify") }
 };
 
        
index bc6a340dfc5a596102bf0a4b591fa108b9c11dd1..b899db1f4c46d815bfeee480ec88c19b291f30d3 100644 (file)
@@ -8,11 +8,15 @@ void display_pushemail(void)
 {
        int Done = 0;
        StrBuf *Buf;
-       int is_none = 0;
-       int is_pager = 0;
-       int is_funambol = 0;
+       long vector[8] = {8, 0, 0, 1, 2, 3, 4, 5};
+       WCTemplputParams SubTP;
        char mobnum[20];
 
+       memset(&SubTP, 0, sizeof(WCTemplputParams));
+       SubTP.Filter.ContextType = CTX_LONGVECTOR;
+       SubTP.Context = &vector;
+       vector[0] = 16;
+
        /* Find any existing settings*/
        Buf = NewStrBuf();
        if (goto_config_room(Buf) == 0) {
@@ -59,12 +63,14 @@ void display_pushemail(void)
                                                break;
                                        }
                                        if (strncasecmp(ChrPtr(Buf), "none", 4) == 0) {
-                                               is_none = 1;
+                                               vector[1] = 0;
                                        } else if (strncasecmp(ChrPtr(Buf), "textmessage", 11) == 0) {
-                                               is_pager = 1;
+                                               vector[1] = 1;
                                                i++;
                                        } else if (strncasecmp(ChrPtr(Buf), "funambol", 8) == 0) {
-                                               is_funambol = 1;
+                                               vector[1] = 2;
+                                       } else if (strncasecmp(ChrPtr(Buf), "httpmessage", 12) == 0) {
+                                               vector[1] = 3;
                                        } else if (i == 1) {
                                                strncpy(mobnum, ChrPtr(Buf), 20);
                                                i++;
@@ -73,26 +79,13 @@ void display_pushemail(void)
                        }
                }
                }
-               /* TODO: do in a saner fashion. */
-               svput("PUSH_NONE", WCS_STRING, " "); /* defaults */
-               svput("PUSH_TEXT", WCS_STRING, " ");
-               svput("PUSH_FNBL", WCS_STRING, " ");
                svput("SMSNUM", WCS_STRING, " ");
-               if (is_none) {
-                       svput("PUSH_NONE", WCS_STRING, "checked=\"checked\"");
-               } else if (is_pager) {
-                       svput("PUSH_TEXT", WCS_STRING, "checked=\"checked\"");
-                       svprintf(HKEY("SMSNUM"), WCS_STRING, "value=\"%s\"", mobnum);
-               } else if (is_funambol) {
-                       svput("PUSH_FNBL", WCS_STRING, "checked=\"checked\"");
-               }
                serv_printf("GOTO %s", ChrPtr(WC->wc_roomname));
                StrBuf_ServGetln(Buf);
                GetServerStatus(Buf, NULL);
        }
        output_headers(1, 1, 2, 0, 0, 0);
-       do_template("pushemail", NULL);
-/*do_template("endbox"); */
+       DoTemplate(HKEY("pushemail"), NULL, &SubTP);
        wDumpContent(1);
        FreeStrBuf(&Buf);
 }
@@ -121,6 +114,7 @@ void save_pushemail(void)
                serv_puts("000");
        } else {
                printf("Junk in save_pushemail buffer!: %s\n", buf);
+               FreeStrBuf(&Buf);
                return;
        }
 
@@ -156,6 +150,7 @@ void save_pushemail(void)
        StrBuf_ServGetln(Buf);
        GetServerStatus(Buf, NULL);
        http_redirect("display_pushemail");
+       FreeStrBuf(&Buf);
 }
 
 void 
diff --git a/webcit/static/t/aide_inet_notify.html b/webcit/static/t/aide_inet_notify.html
new file mode 100644 (file)
index 0000000..b7708f5
--- /dev/null
@@ -0,0 +1,14 @@
+<span class="menudesc">
+<?_("(URLS for notifications when users receive new mails; )")> <?_("Syntax: Notificationtemplatename:http[s]://user:password@hostname/path")>
+</span><br />
+<table border=0 cellspacing="2" cellpadding="2" width=94% class="altern" >
+<?ITERATE("SERVCFG:INET", "section_aide_inetconf_entry", 0, 0, -1, "notify")>
+<form method="post" action="save_inetconf">
+<input type="hidden" name="nonce" value='<?NONCE>'>
+<tr><td>
+<input type="text" name="ename" maxlength="256">
+<input type="hidden" name="etype" VALUE="notify">
+</td><td align=left>
+<input type="submit" name="oper" value="Add">
+<input type="hidden" name="template" value="aide_inetconf">
+</td></tr></table></form>
index 4207e272e2587f245a6c8543529f94142a9dd2c1..75bc8369923736351088218972942b3af1ee9954 100644 (file)
@@ -14,6 +14,7 @@
 <?DOBOXED("aide_inet_aliases", _("Local host aliases"))><br />
 <?DOBOXED("aide_inet_dirnames", _("Directory domains"))><br />
 <?DOBOXED("aide_inet_smarthosts", _("Smart hosts"))>
+<?DOBOXED("aide_inet_notify", _("Notification hosts"))>
 
 </td><td valign=top>
 
index 143fed06634385680308325dc3b483e0fc40ccb9..459b2c39728d4f69ded7d3ea89ba8eb83d16b7a8 100644 (file)
@@ -3,6 +3,7 @@
     </div>
 
     <div id="content" class="config_service">
+    <p>
     <!-- NOT beginbox -->
     <div class="box">
     <div class="boxlabel"><?_("Push email and SMS settings")></div>
         </div>
 
         <form id="pushconfig" method="post" action="save_pushemail">
-          <p class="option"><input type="radio" name="pushsetting" value=
-          "funambol" <?PUSH_FNBL> ><strong>Notify Funambol server</strong></p>
+          <p class="option">
+           <input type="radio" name="pushsetting" value="funambol" <?%("COND:LONGVECTOR", 1, 1, 4, 'CHECKED', "")>>
+           <strong><?_("Notify Funambol server")></strong>
+         </p>
 
-          <p class="option"><input type="radio" name="pushsetting" value=
-          "textmessage" <?PUSH_TEXT> ><strong>Send a text message</strong> to... <input type="text"
-          name="user_sms_number" size="20" <?SMSNUM> > <?_("(Use international format, without any leading zeros, spaces or hypens, like +61415011501)")></p>
+          <p class="option">
+           <input type="radio" name="pushsetting" value="textmessage" <?%("COND:LONGVECTOR", 1, 1, 3, 'CHECKED', "")>>
+           <strong><?_("Send a text message to...")></strong> 
+           <input type="text" name="user_sms_number" size="20" value="<?SMSNUM>" >
+           <?_("(Use international format, without any leading zeros, spaces or hypens, like +61415011501)")>
+         </p>
 
-          <p class="option"><input type="radio" name="pushsetting" value=
-          "none" <?PUSH_NONE> ><strong><?_("Don't send any notifications"></strong></p>
+          <p class="option">
+           <input type="radio" name="pushsetting" value="httpmessage" <?%("COND:LONGVECTOR", 1, 1, 5, 'CHECKED', "")>>
+           <strong><?_("Use custom notification scheme configured by your Admin")></strong>
+         </p>
+
+          <p class="option">
+           <input type="radio" name="pushsetting" value="none" <?%("COND:LONGVECTOR", 1, 1, 2, 'CHECKED'q, "")>>
+           <strong><?_("Don\'t send any notifications")></strong>
+         </p>
 
           <p><input type="submit" name="submit" value="Save settings"></p>
         </form>
@@ -37,3 +50,4 @@
       </div>
       </div>
       </div>
+    </p>