]> andersk Git - moira.git/blobdiff - server/qsupport.qc
add missing range declaration in get_lists_of_member
[moira.git] / server / qsupport.qc
index 87e99a8bea43a5547b7986e6539334cb3c8348cf..e8e905902764c019a9871c903157829da8b077af 100644 (file)
@@ -1377,53 +1377,6 @@ followup_glin(q, sq, v, action, actarg, cl)
 ##}
 
 
-/** followup_amtl - followup for amtl and dmfl; when adding a list 
- **                 member to a maillist, make member list a maillist also
- **                 unless list is a user-group.
- **                 Then set_list_modtime_by_id.
- **
- ** Inputs:
- **   argv[0] - list_id
- **   argv[1] - member_type
- **   argv[2] - member_id
- **
- **/
-
-followup_amtl(q, argv, cl)
-    struct query *q;
-    char *argv[];
-    client *cl;
-##{
-##  int list_id;
-##  int member_id;
-##  int exists, who;
-##  char *entity;
-
-    list_id = *(int *)argv[0];
-    entity = cl->entity;
-    who = cl->client_id;
-
-##  range of l is list
-##  repeat replace l (modtime = "now", modby = @who, modwith = @entity)
-##      where l.#list_id = @list_id
-
-    /* if query is not amtl or if member_type is not LIST then return */
-    if (bcmp(q->shortname, "amtl", 4) || bcmp(argv[1], "LIST", 4)) 
-       return(SMS_SUCCESS);
-
-    member_id = *(int *)argv[2];
-
-    /* is parent list a mailing list? */
-##  repeat retrieve (exists = l.maillist) where l.#list_id=@list_id
-    if (!exists)
-       return(SMS_SUCCESS);
-
-    /* list is not a user-group; add list to maillist table */
-##  repeat replace l (maillist = 1) where l.#list_id = @member_id
-    return(SMS_SUCCESS);
-##}
-
-
 /* followup_gnfq: Fix the directory name & modby fields
  *   argv[0] = filsys_id
  *   argv[2] = ascii(quota)
@@ -1691,6 +1644,8 @@ int set_pobox(q, argv, cl)
 ##             where users.users_id = @user
        set_pop_usage(id, 1);
     } else if (!strcmp(argv[1], "SMTP")) {
+       if (index(box, '/') || index(box, '|'))
+         return(SMS_BAD_CHAR);
 ##      range of s is strings
 ##      repeat retrieve (id = s.string_id) where s.string = @box
 ##      inquire_equel (rowcount = "rowcount")
@@ -1830,8 +1785,8 @@ int add_member_to_list(q, argv, cl)
     char **argv;
     client *cl;
 ##{
-##  int id, lid, mid, exists, error;
-##  char *mtype, dtype[9];
+##  int id, lid, mid, exists, error, who;
+##  char *mtype, dtype[9], buf[256], *entity;
     int ancestors[MAXLISTDEPTH], acount, a;
     int descendants[MAXLISTDEPTH], dcount, d;
     char *dtypes[MAXLISTDEPTH];
@@ -1846,6 +1801,12 @@ int add_member_to_list(q, argv, cl)
 ##                        and m.direct = 1))
     if (exists)
       return(SMS_EXISTS);
+    if (!strcasecmp(mtype, "STRING")) {
+##     repeat retrieve (buf = strings.string) where strings.string_id = @mid
+       if (index(buf, '/') || index(buf, '|'))
+         return(SMS_BAD_CHAR);
+    }
+
     ancestors[0] = lid;
     acount = 1;
 ##  repeat retrieve (id = m.list_id)
@@ -1928,6 +1889,11 @@ int add_member_to_list(q, argv, cl)
            }
        }
     }
+    lid = *(int *)argv[0];
+    entity = cl->entity;
+    who = cl->client_id;
+##  repeat replace list (modtime = "now", modby = @who, modwith = @entity)
+##      where list.#list_id = @lid
     if (ingres_errno) return(sms_errcode);
     return(SMS_SUCCESS);
 ##}
@@ -1941,8 +1907,8 @@ int delete_member_from_list(q, argv, cl)
     char **argv;
     client *cl;
 ##{
-##  int id, lid, mid, cnt, exists, error;
-##  char *mtype, dtype[9];
+##  int id, lid, mid, cnt, exists, error, who;
+##  char *mtype, dtype[9], *entity;
     int ancestors[MAXLISTDEPTH], acount, a;
     int descendants[MAXLISTDEPTH], dcount, d;
     char *dtypes[MAXLISTDEPTH];
@@ -2026,11 +1992,16 @@ int delete_member_from_list(q, argv, cl)
 ##                 m.member_type = mtype
            } else {
 ##             replace m (ref_count = m.ref_count-1)
-##                 where m.list_id = lid and m.member_idn = mid and
+##                 where m.list_id = lid and m.member_id = mid and
 ##                 m.member_type = mtype
            }
        }
     }
+    lid = *(int *)argv[0];
+    entity = cl->entity;
+    who = cl->client_id;
+##  repeat replace list (modtime = "now", modby = @who, modwith = @entity)
+##      where list.#list_id = @lid
     if (ingres_errno) return(sms_errcode);
     return(SMS_SUCCESS);
 ##}
@@ -2236,6 +2207,7 @@ int get_lists_of_member(q, argv, cl, action, actarg)
     rargv[3] = hidden;
     rargv[4] = maillist;
     rargv[5] = group;
+##  range of m is imembers
     if (direct) {
 ##    repeat retrieve (name = list.#name, active = text(list.#active), 
 ##                  public = text(list.#public), hidden = text(list.#hidden),
This page took 0.03474 seconds and 4 git commands to generate.