/*
* This is an implementation of OpenID 2.0 relying party support in stateless mode.
*
- * Copyright (c) 2007-2011 by the citadel.org team
+ * Copyright (c) 2007-2012 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
struct cdbdata *cdboi;
long usernum = 0L;
+ if (config.c_disable_newu)
+ {
+ cprintf("%d this system does not support openid.\n",
+ ERROR + CMD_NOT_SUPPORTED);
+ return;
+ }
if (CtdlAccessCheck(ac_logged_in)) return;
+
cdb_rewind(CDB_OPENID);
cprintf("%d Associated OpenIDs:\n", LISTING_FOLLOWS);
long usernum;
struct ctdluser usbuf;
+ if (config.c_disable_newu)
+ {
+ cprintf("%d this system does not support openid.\n",
+ ERROR + CMD_NOT_SUPPORTED);
+ return;
+ }
if (CtdlAccessCheck(ac_aide)) return;
cdb_rewind(CDB_OPENID);
cprintf("%d List of all OpenIDs in the database:\n", LISTING_FOLLOWS);
void cmd_oidc(char *argbuf) {
ctdl_openid *oiddata = (ctdl_openid *) CC->openid_data;
+ if (config.c_disable_newu)
+ {
+ cprintf("%d this system does not support openid.\n",
+ ERROR + CMD_NOT_SUPPORTED);
+ return;
+ }
if ( (!oiddata) || (!oiddata->verified) ) {
cprintf("%d You have not verified an OpenID yet.\n", ERROR);
return;
int this_is_mine = 0;
long usernum = 0L;
+ if (config.c_disable_newu)
+ {
+ cprintf("%d this system does not support openid.\n",
+ ERROR + CMD_NOT_SUPPORTED);
+ return;
+ }
if (CtdlAccessCheck(ac_logged_in)) return;
extract_token(id_to_detach, argbuf, 0, '|', sizeof id_to_detach);
if (IsEmptyStr(id_to_detach)) {
ctdl_openid *oiddata;
int discovery_succeeded = 0;
+ if (config.c_disable_newu)
+ {
+ cprintf("%d this system does not support openid.\n",
+ ERROR + CMD_NOT_SUPPORTED);
+ return;
+ }
Free_ctdl_openid ((ctdl_openid**)&CCC->openid_data);
CCC->openid_data = oiddata = malloc(sizeof(ctdl_openid));
return;
}
memset(oiddata, 0, sizeof(ctdl_openid));
- CCC->openid_data = (void *) oiddata;
ArgBuf = NewStrBufPlain(argbuf, -1);
void *Value;
ctdl_openid *oiddata = (ctdl_openid *) CC->openid_data;
+ if (config.c_disable_newu)
+ {
+ cprintf("%d this system does not support openid.\n",
+ ERROR + CMD_NOT_SUPPORTED);
+ return;
+ }
if (oiddata == NULL) {
cprintf("%d run OIDS first.\n", ERROR + INTERNAL_ERROR);
return;
CTDL_MODULE_INIT(openid_rp)
{
if (!threading) {
- curl_global_init(CURL_GLOBAL_ALL);
+// evcurl call this for us. curl_global_init(CURL_GLOBAL_ALL);
/* Only enable the OpenID command set when native mode authentication is in use. */
if (config.c_auth_mode == AUTHMODE_NATIVE) {
CtdlRegisterProtoHook(cmd_oidc, "OIDC", "Create new user after validating OpenID");
CtdlRegisterProtoHook(cmd_oida, "OIDA", "List all OpenIDs in the database");
}
- CtdlRegisterSessionHook(openid_cleanup_function, EVT_LOGOUT);
+ CtdlRegisterSessionHook(openid_cleanup_function, EVT_LOGOUT, PRIO_LOGOUT + 10);
CtdlRegisterUserHook(openid_purge, EVT_PURGEUSER);
openid_level_supported = 1; /* This module supports OpenID 1.0 only */
}