/*
- * $Id$
- *
* This is an implementation of OpenID 1.1 Relying Party support, in stateless mode.
*
- * Copyright (c) 2007-2009 by the citadel.org team
+ * Copyright (c) 2007-2010 by the citadel.org team
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
cdb_free(cdboi);
if (fetched_usernum == who->usernum) {
- CtdlLogPrintf(CTDL_INFO, "%s already associated; no action is taken\n", claimed_id);
+ CtdlLogPrintf(CTDL_INFO, "%s already associated; no action is taken\n", ChrPtr(claimed_id));
return(0);
}
else {
- CtdlLogPrintf(CTDL_INFO, "%s already belongs to another user\n", claimed_id);
+ CtdlLogPrintf(CTDL_INFO, "%s already belongs to another user\n", ChrPtr(claimed_id));
return(3);
}
}
HashPos = GetNewHashPos(keys, 0);
while (GetNextHashPos(keys, HashPos, &len, &Key, &Value)!=0)
{
- CtdlLogPrintf(CTDL_DEBUG, "Deleting associated OpenID <%s>\n", Value);
+ CtdlLogPrintf(CTDL_DEBUG, "Deleting associated OpenID <%s>\n", (char*)Value);
cdb_delete(CDB_OPENID, Value, strlen(Value));
/* note: don't free(Value) -- deleting the hash list will handle this for us */
}
ptr = ChrPtr(source_buf);
FlushStrBuf(target_buf);
- while (ptr = bmstrcasestr(ptr, "<link"), ptr != NULL) {
+ while (ptr = cbmstrcasestr(ptr, "<link"), ptr != NULL) {
link_tag_start = ptr;
link_tag_end = strchr(ptr, '>');
for (i=0; i < 1; i++ ){
len = link_tag_end - link_tag_start;
- rel_start = bmstrcasestr(link_tag_start, "rel=");
+ rel_start = cbmstrcasestr(link_tag_start, "rel=");
if ((rel_start == NULL) ||
(rel_start > link_tag_end))
continue;
if (strncasecmp(rel, rel_start, repllen)!= 0)
continue; /* didn't match? never mind... */
- href_start = bmstrcasestr(link_tag_start, "href=");
+ href_start = cbmstrcasestr(link_tag_start, "href=");
if ((href_start == NULL) ||
(href_start >= link_tag_end))
continue;
#endif
curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */
- if (!IsEmptyStr(config.c_ip_addr)) {
+ if (
+ (!IsEmptyStr(config.c_ip_addr))
+ && (strcmp(config.c_ip_addr, "*"))
+ && (strcmp(config.c_ip_addr, "::"))
+ && (strcmp(config.c_ip_addr, "0.0.0.0"))
+ ) {
curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr);
}
res = curl_easy_perform(curl);
#endif
curl_easy_setopt(curl, CURLOPT_USERAGENT, CITADEL);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 180); /* die after 180 seconds */
- if (!IsEmptyStr(config.c_ip_addr)) {
+ if (
+ (!IsEmptyStr(config.c_ip_addr))
+ && (strcmp(config.c_ip_addr, "*"))
+ && (strcmp(config.c_ip_addr, "::"))
+ && (strcmp(config.c_ip_addr, "0.0.0.0"))
+ ) {
curl_easy_setopt(curl, CURLOPT_INTERFACE, config.c_ip_addr);
}
curl_easy_cleanup(curl);
curl_formfree(formpost);
- if (bmstrcasestr(ChrPtr(ReplyBuf), "is_valid:true")) {
+ if (cbmstrcasestr(ChrPtr(ReplyBuf), "is_valid:true")) {
oiddata->verified = 1;
}
FreeStrBuf(&ReplyBuf);
}
/* return our Subversion id for the Log */
- return "$Id$";
+ return "openid_rp";
}