* simple here to have the same
* symbols in the client.
*/
-enum LogLevel {CTDL_EMERG};
void CtdlLogPrintf(enum LogLevel loglevel, const char *format, ...) {
va_list arg_ptr;
#endif
+#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#include <string.h>
#include <strings.h>
#include <ical.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#ifndef CTDL_MODULE_H
#define CTDL_MODULE_H
+#include <libcitadel.h>
#include "server.h"
#include "sysdep_decls.h"
#include "msgbase.h"
#include "sysdep.h"
#include <stdlib.h>
+#include <unistd.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "modules_init.h"
#include "sysdep_decls.h"
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "modules_init.h"
#include "sysdep_decls.h"
#error Citadel requires Berkeley DB v4.1 or newer. Please upgrade.
#endif
+#include <libcitadel.h>
+
#include "citadel.h"
#include "server.h"
#include "citserver.h"
#endif
#include <stdio.h>
+#include <libcitadel.h>
#include "server.h"
#include "serv_crypto.h"
#include "sysdep_decls.h"
#define SIZE_T_FMT "%ld"
#endif
-
-/* Logging levels - correspond to syslog(3) */
-enum LogLevel {
- /* When about to exit the server for an unrecoverable error */
- CTDL_EMERG, /* system is unusable */
- /* Manual intervention is required to avoid an abnormal exit */
- CTDL_ALERT, /* action must be taken immediately */
- /* The server can continue to run with degraded functionality */
- CTDL_CRIT, /* critical conditions */
- /* An error occurs but the server continues to run normally */
- CTDL_ERR, /* error conditions */
- /* An abnormal condition was detected; server will continue normally */
- CTDL_WARNING, /* warning conditions */
- /* Normal messages (login/out, activity, etc.) */
- CTDL_NOTICE, /* normal but significant condition */
- /* Unimportant progress messages, etc. */
- CTDL_INFO, /* informational */
- /* Debugging messages */
- CTDL_DEBUG /* debug-level messages */
-};
-
#ifdef __GNUC__
void cprintf (const char *format, ...) __attribute__((__format__(__printf__,1,2)));
#else
*
*/
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
#include <sys/socket.h>
# endif
#endif
+#include <libcitadel.h>
+
#include "threads.h"
#include "ctdl_module.h"
#include "modules_init.h"
*/
+/* protect against double includes */
+#ifndef LIBCITADEL_H
+#define LIBCITADEL_H
+
+
/*
* since we reference time_t...
*/
#endif
+/* Logging levels - correspond to syslog(3) */
+enum LogLevel {
+ /* When about to exit the server for an unrecoverable error */
+ CTDL_EMERG, /* system is unusable */
+ /* Manual intervention is required to avoid an abnormal exit */
+ CTDL_ALERT, /* action must be taken immediately */
+ /* The server can continue to run with degraded functionality */
+ CTDL_CRIT, /* critical conditions */
+ /* An error occurs but the server continues to run normally */
+ CTDL_ERR, /* error conditions */
+ /* An abnormal condition was detected; server will continue normally */
+ CTDL_WARNING, /* warning conditions */
+ /* Normal messages (login/out, activity, etc.) */
+ CTDL_NOTICE, /* normal but significant condition */
+ /* Unimportant progress messages, etc. */
+ CTDL_INFO, /* informational */
+ /* Debugging messages */
+ CTDL_DEBUG /* debug-level messages */
+};
+
+
/*
* View definitions.
* Note that not all views are implemented in all clients.
void vnote_free(struct vnote *v);
char *vnote_serialize(struct vnote *v);
void vnote_serialize_output_field(char *append_to, char *field, char *label);
+
+
+#endif // LIBCITADEL_H
groupdav_main.o groupdav_get.o groupdav_propfind.o fmt_date.o \
groupdav_options.o autocompletion.o gettext.o tabs.o sieve.o \
groupdav_delete.o groupdav_put.o http_datestring.o setup_wizard.o \
- downloads.o addressbook_popup.o pushemail.o sysdep.o \
+ downloads.o addressbook_popup.o pushemail.o sysdep.o httpfetch.o \
$(LIBOBJS)
$(CC) webserver.o context_loop.o cookie_conversion.o \
webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o listsub.o \
groupdav_main.o groupdav_get.o groupdav_propfind.o groupdav_delete.o \
groupdav_options.o autocompletion.o tabs.o smtpqueue.o sieve.o \
groupdav_put.o http_datestring.o setup_wizard.o fmt_date.o \
- gettext.o downloads.o addressbook_popup.o pushemail.o sysdep.o \
+ gettext.o downloads.o addressbook_popup.o pushemail.o sysdep.o httpfetch.o \
$(LIBOBJS) $(LIBS) $(LDFLAGS) -o webcit
.c.o:
}
#ifdef TECH_PREVIEW
- svprintf(HKEY("OFFER_OPENID_LOGIN"), WCS_STRING, "<a href=\"display_openid_login\">%s</a>",
- "Click here to login with OpenID" // FIXME localize when ready
+ svprintf(HKEY("OFFER_OPENID_LOGIN"), WCS_STRING,
+ "<div align=center>"
+ "<a href=\"display_openid_login\">"
+ "<img src=\"static/openid-small.gif\" border=0 valign=middle>"
+ "%s</a>"
+ "</div>"
+ ,
+ "Log in using OpenID"
);
#else
svput("OFFER_OPENID_LOGIN", WCS_STRING, "");
serv_info.serv_humannode);
svcallback("DO_LANGUAGE_BOX", offer_languages);
+ svprintf(HKEY("OFFER_CONVENTIONAL_LOGIN"), WCS_STRING,
+ "<div align=center>"
+ "<a href=\"display_login\">"
+ "%s</a>"
+ "</div>"
+ ,
+ "Log in using a user name and password"
+ );
+
do_template("openid_login");
wDumpContent(2);
}
/*
- * Login Checks
- * the logic to detect invalid passwords not to get on citservers nerves
+ * Perform authentication using a user name and password
*/
void do_login(void)
{
}
+
+
+
+/*
+ * Perform authentication using OpenID
+ */
+void do_openid_login(void)
+{
+ if (havebstr("language")) {
+ set_selected_language(bstr("language"));
+ go_selected_language();
+ }
+
+ if (havebstr("exit_action")) {
+ do_logout();
+ return;
+ }
+ if (havebstr("login_action")) {
+
+ fetch_http(bstr("openid_url")); // FIXME
+
+ }
+ if (WC->logged_in) {
+ if (WC->need_regi) {
+ display_reg(1);
+ } else {
+ do_welcome();
+ }
+ } else {
+ display_openid_login(_("Your password was not accepted."));
+ }
+
+}
+
+
+
+
+
+
+
+
/*
* display the user a welcome screen.
*
<br>
</div>
</form>
+<?OFFER_CONVENTIONAL_LOGIN>
<div class="login_image"><img src="image&name=hello"></div>
<div class="login_infos"><?LOGIN_INSTRUCTIONS></div>
<?=endbox>
*/
} else if ((!WC->logged_in) && (!strcasecmp(action, "login"))) {
do_login();
+ } else if ((!WC->logged_in) && (!strcasecmp(action, "openid_login"))) {
+ do_openid_login();
} else if ((!WC->logged_in) && (!strcasecmp(action, "display_openid_login"))) {
display_openid_login(NULL);
} else if (!WC->logged_in) {
void locate_host(char *, int);
void become_logged_in(char *, char *, char *);
void do_login(void);
+void do_openid_login(void);
void display_login(char *mesg);
void display_openid_login(char *mesg);
void do_welcome(void);
int get_time_format_cached (void);
int xtoi(char *in, size_t len);
void webcit_fmt_date(char *buf, time_t thetime, int brief);
+void fetch_http(char *url);
#ifdef HAVE_ICONV