From 110d19a7389607e9a336456c79c20ba8b916d888 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 5 Nov 2017 21:00:47 -0500 Subject: [PATCH] Index by UID --- citadel/modules/upgrade/serv_upgrade.c | 15 +++++++++++---- citadel/sysconfig.h | 2 +- citadel/user_ops.c | 8 ++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/citadel/modules/upgrade/serv_upgrade.c b/citadel/modules/upgrade/serv_upgrade.c index 9ab953a23..365147e58 100644 --- a/citadel/modules/upgrade/serv_upgrade.c +++ b/citadel/modules/upgrade/serv_upgrade.c @@ -135,6 +135,12 @@ void reindex_uids_backend(struct ctdluser *usbuf, void *data) { us.uid = NATIVE_AUTH_UID; } CtdlPutUserLock(&us); + if (us.uid > 0) { // if non-native auth , index by uid + StrBuf *claimed_id = NewStrBuf(); + StrBufPrintf(claimed_id, "uid:%d", us.uid); + attach_extauth(&us, claimed_id); + FreeStrBuf(&claimed_id); + } } ptr = uplist; @@ -520,6 +526,11 @@ void check_server_upgrades(void) { syslog(LOG_INFO, "Existing database version on disk is %d", CtdlGetConfigInt("MM_hosted_upgrade_level")); + + + reindex_uids(); // FIXME FIXME FIXME remove this line after testing + + if (CtdlGetConfigInt("MM_hosted_upgrade_level") < REV_LEVEL) { syslog(LOG_WARNING, "Server hosted updates need to be processed at this time. Please wait..."); } @@ -554,10 +565,6 @@ void check_server_upgrades(void) { QRoom.QRdefaultview = VIEW_QUEUE; CtdlPutRoom(&QRoom); } - if (!CtdlGetRoom(&QRoom, FNBL_QUEUE_ROOM)) { - QRoom.QRdefaultview = VIEW_QUEUE; - CtdlPutRoom(&QRoom); - } } if ((CtdlGetConfigInt("MM_hosted_upgrade_level") > 000) && (CtdlGetConfigInt("MM_hosted_upgrade_level") < 902)) { diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 0afc3a7f4..de9c6aa8a 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -81,7 +81,7 @@ #define PAGELOGROOM "Sent/Received Pages" #define SYSCONFIGROOM "Local System Configuration" #define SMTP_SPOOLOUT_ROOM "__CitadelSMTPspoolout__" -#define FNBL_QUEUE_ROOM "__CitadelFNBLqueue__" + /* * Where we keep messages containing the vCards that source our directory. It * makes no sense to change this, because you'd have to change it on every diff --git a/citadel/user_ops.c b/citadel/user_ops.c index bfd2660b6..7e82d3188 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -1027,6 +1027,14 @@ int internal_create_user(char *username, struct ctdluser *usbuf, uid_t uid) CtdlPutUser(usbuf); cdb_store(CDB_USERSBYNUMBER, &usbuf->usernum, sizeof(long), usbuf->fullname, strlen(usbuf->fullname)+1); + /* If non-native auth, index by uid */ + if (usbuf->uid > 0) { + StrBuf *claimed_id = NewStrBuf(); + StrBufPrintf(claimed_id, "uid:%d", usbuf->uid); + attach_extauth(usbuf, claimed_id); + FreeStrBuf(&claimed_id); + } + return 0; } -- 2.30.2