Export format has changed due to the addition of a new
authorArt Cancro <ajc@citadel.org>
Mon, 2 Jun 2008 16:09:00 +0000 (16:09 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 2 Jun 2008 16:09:00 +0000 (16:09 +0000)
table, so the version number has changed.  Also added a serv_info field to
advise the client (e.g. WebCit) whether the server supports OpenID.  The
main reason is because we can only do OpenID in native auth mode -- but we
can also use this to temporarily shut off all OpenID features if we need
to complete a new software release before OpenID is finished.

citadel/citadel.h
citadel/citserver.c
citadel/configure.ac
webcit/auth.c
webcit/openid.c
webcit/serv_func.c
webcit/webcit.h

index 5db1181d07d68ec5d17068d905d79ae9fb1b63ec..35956a4ba72dece7b50fa7fa57bac914c4aed84f 100644 (file)
@@ -38,9 +38,9 @@ extern "C" {
  * usually more strict because you're not really supposed to dump/load and
  * upgrade at the same time.
  */
-#define REV_LEVEL      736             /* This version */
+#define REV_LEVEL      737             /* This version */
 #define REV_MIN                591             /* Oldest compatible database */
-#define EXPORT_REV_MIN 733             /* Oldest compatible export files */
+#define EXPORT_REV_MIN 737             /* Oldest compatible export files */
 #define LIBCITADEL_MIN 115             /* Minimum required version of libcitadel */
 
 #define SERVER_TYPE 0                  /* zero for stock Citadel; other developers please
index bf23951560ba3a933500bcfe8b4cad5c6d27a50c..29150820afd2c7eb2c042c30cdbef9681a0c457e 100644 (file)
@@ -309,6 +309,13 @@ void cmd_info(void) {
        cprintf("1\n");         /* yes, Sieve mail filtering is supported */
        cprintf("%d\n", config.c_enable_fulltext);
        cprintf("%s\n", svn_revision());
+
+       if (config.c_auth_mode == AUTHMODE_NATIVE) {
+               cprintf("1\n"); /* OpenID is enabled when using native auth */
+       }
+       else {
+               cprintf("0\n"); /* OpenID is disabled when using non-native auth */
+       }
        
        cprintf("000\n");
 }
index 5c39ef79d966a8ca92471193bce751d968f20983..1c416b8a5eabb3cc765816f652516c3850f5be8b 100644 (file)
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 dnl $Id$
 AC_PREREQ(2.52)
-AC_INIT([Citadel], [7.36], [http://www.citadel.org/])
+AC_INIT([Citadel], [7.37], [http://www.citadel.org/])
 AC_REVISION([$Revision: 5108 $])
 AC_CONFIG_SRCDIR([citserver.c])
 AC_PREFIX_DEFAULT(/usr/local/citadel)
index 96503c1a7f33c5608694336a567d06b8dc5bb701..2e3cc9a8418cd52afb9660324b5123bfd0d42b18 100644 (file)
@@ -78,7 +78,7 @@ void display_login(char *mesg)
                svput("NEWUSER_BUTTON_POST", WCS_STRING, "");
        }
 
-       if (1) {        // FIXME we have to check whether the server offers openid
+       if (serv_info.serv_supports_openid) {
                svprintf(HKEY("OFFER_OPENID_LOGIN"), WCS_STRING,
                        "<div align=center>"
                        "<a href=\"display_openid_login\">"
@@ -321,7 +321,6 @@ void finalize_openid_login(void)
        if (havebstr("openid.mode")) {
                if (!strcasecmp(bstr("openid.mode"), "id_res")) {
 
-                       // FIXME id accepted but the code isn't finished
                        serv_puts("OIDF");
                        serv_getln(buf, sizeof buf);
 
index e34425832036b55850cdac5c699bf412ded8e323..ae037e851c6eb688766d9d0b59ce27e7fc12d096 100644 (file)
@@ -20,32 +20,40 @@ void display_openids(void)
        svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations"));
        do_template("beginbox");
 
-       wprintf("<table class=\"altern\">");
-
-       serv_puts("OIDL");
-       serv_getln(buf, sizeof buf);
-       if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
-               bg = 1 - bg;
-               wprintf("<tr class=\"%s\">", (bg ? "even" : "odd"));
-               wprintf("<td><img src=\"static/openid-small.gif\"></td><td>");
-               escputs(buf);
-               wprintf("</td><td>");
-               wprintf("<a href=\"openid_detach?id_to_detach=");
-               urlescputs(buf);
-               wprintf("\" onClick=\"return confirm('%s');\">",
-                       _("Do you really want to delete this OpenID?"));
-               wprintf("%s</a>", _("(delete)"));
-               wprintf("</td></tr>\n");
+       if (serv_info.serv_supports_openid) {
+
+               wprintf("<table class=\"altern\">");
+       
+               serv_puts("OIDL");
+               serv_getln(buf, sizeof buf);
+               if (buf[0] == '1') while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+                       bg = 1 - bg;
+                       wprintf("<tr class=\"%s\">", (bg ? "even" : "odd"));
+                       wprintf("<td><img src=\"static/openid-small.gif\"></td><td>");
+                       escputs(buf);
+                       wprintf("</td><td>");
+                       wprintf("<a href=\"openid_detach?id_to_detach=");
+                       urlescputs(buf);
+                       wprintf("\" onClick=\"return confirm('%s');\">",
+                               _("Do you really want to delete this OpenID?"));
+                       wprintf("%s</a>", _("(delete)"));
+                       wprintf("</td></tr>\n");
+               }
+       
+               wprintf("</table><br />\n");
+       
+               wprintf("<form method=\"POST\" action=\"openid_attach\">\n");
+               wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
+               wprintf(_("Add an OpenID: "));
+               wprintf("<input type=\"text\" name=\"openid_url\" class=\"openid_urlarea\" size=\"40\">\n");
+               wprintf("<input type=\"submit\" name=\"attach_button\" value=\"%s\">"
+                       "</form></center>\n", _("Attach"));
        }
 
-       wprintf("</table><br />\n");
+       else {
+               wprintf(_("%s does not permit authentication via OpenID."), serv_info.serv_humannode);
+       }
 
-        wprintf("<form method=\"POST\" action=\"openid_attach\">\n");
-       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
-       wprintf(_("Add an OpenID: "));
-        wprintf("<input type=\"text\" name=\"openid_url\" class=\"openid_urlarea\" size=\"40\">\n");
-        wprintf("<input type=\"submit\" name=\"attach_button\" value=\"%s\">"
-               "</form></center>\n", _("Attach"));
        do_template("endbox");
        wprintf("</div>");
        wDumpContent(2);
index fed2011020372d934d32963f258f2be2198c49b4..9e7f0524fc816e27aaf46317e5d8d363b71423e2 100644 (file)
@@ -95,6 +95,9 @@ void get_serv_info(char *browser_host, char *user_agent)
                case 22:
                        safestrncpy(serv_info.serv_svn_revision, buf, sizeof serv_info.serv_svn_revision);
                        break;
+               case 23:
+                       serv_info.serv_supports_openid = atoi(buf);
+                       break;
                }
                ++a;
        }
index de9f6e964532e68fcf03cb08c88c42cbc9e26c49..a054ea9dac30bb7a8065e1e11e3cf045d9985f3f 100644 (file)
@@ -124,9 +124,9 @@ extern locale_t wc_locales[];
 #define PORT_NUM               2000            /* port number to listen on */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         736             /* This version of WebCit */
-#define MINIMUM_CIT_VERSION    730             /* min required Citadel ver */
-#define        LIBCITADEL_MIN          114             /* min required libcitadel ver */
+#define CLIENT_VERSION         737             /* This version of WebCit */
+#define MINIMUM_CIT_VERSION    737             /* min required Citadel ver */
+#define        LIBCITADEL_MIN          115             /* min required libcitadel ver */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"
 #define LB                     (1)             /* Internal escape chars */
@@ -252,6 +252,7 @@ struct serv_info {
        int serv_supports_sieve;        /* Does the server support Sieve mail filtering? */
        int serv_fulltext_enabled;      /* Does the server have the full text index enabled? */
        char serv_svn_revision[256];    /* SVN revision of the server */
+       int serv_supports_openid;       /* Does the server support authentication via OpenID? */
 };