]> andersk Git - moira.git/blobdiff - server/qsupport.dc
Set search fields, et al.
[moira.git] / server / qsupport.dc
index 90d9aba4981415172019201ef6a353b7aa00d788..20d9355ebee4aca3d86c6fc452c23f901edd5f2d 100644 (file)
@@ -72,7 +72,8 @@ access_login(q, argv, cl)
     EXEC SQL END DECLARE SECTION;
 
     build_qual(q->qual, q->argc, argv, qual);
-    if(!strcmp(q->shortname,"guau")) {
+    if(!strcmp(q->shortname,"guau") ||
+       !strcmp(q->shortname,"gual")) {
       EXEC SQL SELECT users_id INTO :id FROM users u, strings str WHERE :qual;
     } else {
       EXEC SQL SELECT users_id INTO :id FROM users WHERE :qual;
@@ -1019,9 +1020,11 @@ setup_sshi(q, argv, cl)
     char **argv;
     client *cl;
 {
+#ifdef notdef
 #ifsql INGRES
     EXEC SQL set lockmode session where readlock = system;
 #endsql
+#endif
 }
 
 
@@ -1513,11 +1516,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 +1530,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 +1608,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);
@@ -2461,12 +2468,12 @@ int delete_member_from_list(q, argv, cl)
                incremental_clear_after();
            } else if (a == 0 && d == 0) {
                EXEC SQL UPDATE imembers
-                 SET ref_count = refcount - :ref, direct = 0
+                 SET ref_count = ref_count - :ref, direct = 0
                  WHERE list_id = :lid AND member_id = :mid
                    AND member_type = :mtype;
            } else {
                EXEC SQL UPDATE imembers
-                 SET ref_count = refcount - :ref
+                 SET ref_count = ref_count - :ref
                  WHERE list_id = :lid AND member_id = :mid
                    AND member_type = :mtype;
            }
@@ -2669,7 +2676,8 @@ get_ace_internal(atype, aid, action, actarg)
     rargv[0] = "HOSTACCESS";
     EXEC SQL DECLARE csr115 CURSOR FOR
       SELECT name FROM machine, hostaccess
-       WHERE mach_id = hostaccess.mach_id AND hostaccess.acl_type = :atype
+       WHERE machine.mach_id = hostaccess.mach_id 
+         AND hostaccess.acl_type = :atype
          AND hostaccess.acl_id = :aid;
     EXEC SQL OPEN csr115;
     while(1) {
@@ -2795,7 +2803,7 @@ int get_lists_of_member(q, argv, cl, action, actarg)
  * where clause based on the arguments, then doing a retrieve.
  */
 
-static char *lflags[5] = { "active", "publicflg", "hidden", "maillist", "group" };
+static char *lflags[5] = { "active", "publicflg", "hidden", "maillist", "grouplist" };
 
 int qualified_get_lists(q, argv, cl, action, actarg)
     struct query *q;
@@ -3066,7 +3074,7 @@ int qualified_get(q, argv, action, actarg, start, range, field, flags)
     }
 
     rargv[0] = SQLDA->sqlvar[0].sqldata;
-    sprintf(stmt_buf,"SELECT %s.%s FROM %s %s WHERE %s",q->rtable,field,q->rtable,q->rvar,qual);
+    sprintf(stmt_buf,"SELECT %s.%s FROM %s %s WHERE %s",range,field,q->rtable,range,qual);
     EXEC SQL PREPARE stmt INTO :SQLDA USING NAMES FROM :stmt_buf;
     if(sqlca.sqlcode)
       return(MR_INTERNAL);
@@ -3322,7 +3330,7 @@ register_user(q, argv, cl)
     aargv[0] = login;
     aargv[1] = "ANY";
     aargv[2] = login;
-    sprintf(buffer, "q.entity_id = 0 and q.filsys_id = %d and q.type = 'ANY'", fsidval);
+    sprintf(buffer, "quota.entity_id = 0 and quota.filsys_id = %d and quota.type = 'ANY'", fsidval);
     incremental_after("quota", buffer, aargv);
     com_err(whoami, 0, "quota of %d assigned", def_quota);
     if (ingres_errno) return(mr_errcode);
This page took 0.058968 seconds and 4 git commands to generate.