From: Art Cancro Date: Mon, 2 Jun 2008 16:09:00 +0000 (+0000) Subject: Export format has changed due to the addition of a new X-Git-Tag: v7.86~2175 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=3f1b85695cf9338d2b5f7fc7f9f8afedcb9d608c Export format has changed due to the addition of a new 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. --- diff --git a/citadel/citadel.h b/citadel/citadel.h index 5db1181d0..35956a4ba 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -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 diff --git a/citadel/citserver.c b/citadel/citserver.c index bf2395156..29150820a 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -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"); } diff --git a/citadel/configure.ac b/citadel/configure.ac index 5c39ef79d..1c416b8a5 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -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) diff --git a/webcit/auth.c b/webcit/auth.c index 96503c1a7..2e3cc9a84 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -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, "
" "" @@ -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); diff --git a/webcit/openid.c b/webcit/openid.c index e34425832..ae037e851 100644 --- a/webcit/openid.c +++ b/webcit/openid.c @@ -20,32 +20,40 @@ void display_openids(void) svput("BOXTITLE", WCS_STRING, _("Manage Account/OpenID Associations")); do_template("beginbox"); - wprintf(""); - - 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("", (bg ? "even" : "odd")); - wprintf("\n"); + if (serv_info.serv_supports_openid) { + + wprintf("
"); - escputs(buf); - wprintf(""); - wprintf("", - _("Do you really want to delete this OpenID?")); - wprintf("%s", _("(delete)")); - wprintf("
"); + + 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("", (bg ? "even" : "odd")); + wprintf("\n"); + } + + wprintf("
"); + escputs(buf); + wprintf(""); + wprintf("", + _("Do you really want to delete this OpenID?")); + wprintf("%s", _("(delete)")); + wprintf("

\n"); + + wprintf("
\n"); + wprintf("\n", WC->nonce); + wprintf(_("Add an OpenID: ")); + wprintf("\n"); + wprintf("" + "
\n", _("Attach")); } - wprintf("
\n"); + else { + wprintf(_("%s does not permit authentication via OpenID."), serv_info.serv_humannode); + } - wprintf("
\n"); - wprintf("\n", WC->nonce); - wprintf(_("Add an OpenID: ")); - wprintf("\n"); - wprintf("" - "
\n", _("Attach")); do_template("endbox"); wprintf("
"); wDumpContent(2); diff --git a/webcit/serv_func.c b/webcit/serv_func.c index fed201102..9e7f0524f 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -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; } diff --git a/webcit/webcit.h b/webcit/webcit.h index de9f6e964..a054ea9da 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -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? */ };