From da583afd72aaaa20000dad08ef3bdcec7d84918f Mon Sep 17 00:00:00 2001 From: genoa Date: Wed, 26 Aug 1992 01:21:15 +0000 Subject: [PATCH] First and last name in the users table now act case insensitive. --- server/qsupport.dc | 12 ++++++++---- server/queries2.c | 33 ++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/server/qsupport.dc b/server/qsupport.dc index 90d9aba4..9a1263e9 100644 --- a/server/qsupport.dc +++ b/server/qsupport.dc @@ -1513,11 +1513,12 @@ followup_ausr(q, argv, cl) who = cl->client_id; entity = cl->entity; - /* create finger entry, pobox & set modtime on user */ + /* create finger entry & pobox, set modtime on user, and update search fields */ #ifdef GDSS EXEC SQL REPEATED UPDATE users SET modtime='now', modby=:who, modwith = :entity, fullname = :fullname, affiliation = type, + searchfirst = UPPERCASE(first), searchlast = UPPERCASE(last), signature = :rawsig, sigdate = :timestamp, sigwho = :sigwho, fmodtime='now', fmodby = :who, fmodwith = :entity, potype='NONE', pmodtime='now', pmodby = :who, pmodwith = :entity @@ -1526,6 +1527,7 @@ followup_ausr(q, argv, cl) EXEC SQL REPEATED UPDATE users SET modtime='now', modby=:who, modwith = :entity, fullname = :fullname, affiliation = type, + searchfirst = UPPERCASE(first), searchlast = UPPERCASE(last), fmodtime='now', fmodby = :who, fmodwith = :entity, potype='NONE', pmodtime='now', pmodby = :who, pmodwith = :entity WHERE login = :login; @@ -1603,14 +1605,16 @@ followup_uuac(q, argv, cl) } #endif /* GDSS */ - /* create finger entry, pobox & set modtime on user */ + /* set modtime on user and update search fields */ #ifdef GDSS EXEC SQL REPEATED UPDATE users SET modtime='now', modby = :who, modwith = :entity, - signature = :rawsig, sigdate = :timestamp, sigwho = :sigwho + signature = :rawsig, sigdate = :timestamp, sigwho = :sigwho, + searchfirst = UPPERCASE(first), searchlast = UPPERCASE(last) WHERE users_id = :id; #else /* GDSS */ - EXEC SQL REPEATED UPDATE users SET modtime='now', modby = :who, modwith = :entity + EXEC SQL REPEATED UPDATE users SET modtime='now', modby = :who, modwith = :entity, + searchfirst = UPPERCASE(first), searchlast = UPPERCASE(last) WHERE users_id = :id; #endif /* GDSS */ return(MR_SUCCESS); diff --git a/server/queries2.c b/server/queries2.c index 5aee1b5a..05fb50d9 100644 --- a/server/queries2.c +++ b/server/queries2.c @@ -174,6 +174,13 @@ static struct valobj VOwild01sort01[] = { {V_SORT, 1}, }; +static struct valobj VOupwild01sort01[] = { + {V_UPWILD, 0}, + {V_UPWILD, 1}, + {V_SORT, 0}, + {V_SORT, 1}, +}; + static struct valobj VOwild012sort0[] = { /* get_alias */ {V_WILD, 0}, {V_WILD, 1}, @@ -291,6 +298,18 @@ static struct validate VDupwildsortf = { followup_fix_modby, }; +static struct validate VDupwild2sortf = { + VOupwild01sort01, + 4, + 0, + 0, + 0, + 0, + 0, + 0, + followup_fix_modby, +}; + /* Query data */ @@ -373,10 +392,10 @@ static char *gubn_fields[] = { MIT_ID, CLASS, MOD1, MOD2, MOD3, }; -static struct validate gubn_validate = +static struct validate gubn_validate = /* Q_GUBN, Q_GUAN */ { - VOwild01sort0, - 3, + VOupwild01sort01, + 4, 0, 0, 0, @@ -500,7 +519,7 @@ static struct validate uusr_validate = { USERS_ID, 0, setup_ausr, - set_modtime_by_id, + followup_uuac, }; static char *uush_fields[] = { @@ -2288,9 +2307,9 @@ struct query Queries2[] = { "CHAR(u.login), CHAR(u.uid), u.shell, CHAR(u.last), CHAR(u.first), u.middle, CHAR(u.status), CHAR(u.clearid), u.type, str.string, CHAR(u.signature), CHAR(u.secure), CHAR(u.modtime), CHAR(u.modby), u.modwith FROM users u, strings str", guan_fields, 15, - "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0 and u.comment = str.string_id", + "u.searchfirst LIKE '%s' ESCAPE '*' AND u.searchlast LIKE '%s' ESCAPE '*' AND u.users_id != 0 and u.comment = str.string_id", 2, - &VDwild2sortf, + &gubn_validate, }, { @@ -2363,7 +2382,7 @@ struct query Queries2[] = { "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle, CHAR(status), CHAR(clearid), type, CHAR(modtime), CHAR(modby), modwith FROM users", gubn_fields, 12, - "first LIKE '%s' ESCAPE '*' AND last LIKE '%s' ESCAPE '*' AND users_id != 0", + "searchfirst LIKE '%s' ESCAPE '*' AND searchlast LIKE '%s' ESCAPE '*' AND users_id != 0", 2, &gubn_validate, }, -- 2.45.2