From: Art Cancro Date: Thu, 15 May 2008 04:27:24 +0000 (+0000) Subject: Get the login screen ready for OpenID support X-Git-Tag: v7.86~2256 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=1bc9ac3216ae35bb1470838e8613ddf544923e87;p=citadel.git Get the login screen ready for OpenID support --- diff --git a/webcit/auth.c b/webcit/auth.c index a057e5877..5a0d14595 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -78,6 +78,14 @@ void display_login(char *mesg) svput("NEWUSER_BUTTON_POST", WCS_STRING, ""); } +#ifdef TECH_PREVIEW + svprintf(HKEY("OFFER_OPENID_LOGIN"), WCS_STRING, "%s", + "Click here to login with OpenID" // FIXME localize when ready + ); +#else + svput("OFFER_OPENID_LOGIN", WCS_STRING, ""); +#endif + do_template("login"); wDumpContent(2); @@ -86,6 +94,50 @@ void display_login(char *mesg) +/* + * Display the openid-enabled login screen + * mesg = the error message if last attempt failed. + */ +void display_openid_login(char *mesg) +{ + char buf[SIZ]; + + output_headers(1, 1, 2, 0, 0, 0); + wprintf("
\n"); + + if (mesg != NULL) if (!IsEmptyStr(mesg)) { + stresc(buf, SIZ, mesg, 0, 0); + svprintf(HKEY("MESG"), WCS_STRING, "%s", buf); + } + + svprintf(HKEY("LOGIN_INSTRUCTIONS"), WCS_STRING, + _("") + ); + + svput("OPENID_BOX", WCS_STRING, _("OpenID URL:")); + svput("LANGUAGE_BOX", WCS_STRING, _("Language:")); + svput("LOGIN_BUTTON", WCS_STRING, _("Login")); + svput("EXIT_BUTTON", WCS_STRING, _("Exit")); + svput("HELLO", WCS_SERVCMD, "MESG hello"); + svprintf(HKEY("BOXTITLE"), WCS_STRING, _("%s - powered by Citadel"), + serv_info.serv_humannode); + svcallback("DO_LANGUAGE_BOX", offer_languages); + + do_template("openid_login"); + wDumpContent(2); +} + + + + /* Initialize the session * * This function needs to get called whenever the session changes from diff --git a/webcit/static/login.html b/webcit/static/login.html index ce26eafaf..2307562ff 100644 --- a/webcit/static/login.html +++ b/webcit/static/login.html @@ -17,6 +17,7 @@
+
diff --git a/webcit/static/openid-small.gif b/webcit/static/openid-small.gif new file mode 100644 index 000000000..cde836c89 Binary files /dev/null and b/webcit/static/openid-small.gif differ diff --git a/webcit/static/openid_login.html b/webcit/static/openid_login.html new file mode 100644 index 000000000..f28dfad66 --- /dev/null +++ b/webcit/static/openid_login.html @@ -0,0 +1,17 @@ + + +
+
+ +
+ +
+
+ + +
+
+
+
+
+ diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index 69f32a98f..8f07e72f7 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -1392,3 +1392,8 @@ li.event_unread span, a.event_read_title { width: 16px; height: 16px; } + +.openid_urlarea { + background: url('openid-small.gif') no-repeat scroll 0pt 50%; + padding-left: 18px; +} diff --git a/webcit/webcit.c b/webcit/webcit.c index d16258f74..0ff603070 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -1709,17 +1709,19 @@ void session_loop(struct httprequest *req) } else if (!strcasecmp(action, "display_mime_icon")) { display_mime_icon(); - /** - * All functions handled below this point ... make sure we log in - * before doing anything else! - */ + /* + * All functions handled below this point ... make sure we log in + * before doing anything else! + */ } else if ((!WC->logged_in) && (!strcasecmp(action, "login"))) { do_login(); + } else if ((!WC->logged_in) && (!strcasecmp(action, "display_openid_login"))) { + display_openid_login(NULL); } else if (!WC->logged_in) { display_login(NULL); } - /** + /* * Various commands... */ diff --git a/webcit/webcit.h b/webcit/webcit.h index 6f123d5a6..21cd14e35 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -485,6 +485,7 @@ void locate_host(char *, int); void become_logged_in(char *, char *, char *); void do_login(void); void display_login(char *mesg); +void display_openid_login(char *mesg); void do_welcome(void); void do_logout(void); void display_main_menu(void);