]> andersk Git - moira.git/blobdiff - server/queries2.c
improved DEC version of message about delete key;
[moira.git] / server / queries2.c
index 06aaee725ac59c8b0ad6106e78d6c65064e6392d..9b96d9523382e0b32acbc233017920722cfd96f5 100644 (file)
@@ -41,13 +41,13 @@ int setup_dfil();
 int setup_dnfp();
 int setup_dnfq();
 int setup_sshi();
+int setup_akum();
 
 /* Query Followup Routines */
 int followup_fix_modby();
 int followup_ausr();
 int followup_gpob();
 int followup_glin();
-int followup_amtl();
 int followup_anfq();
 int followup_gzcl();
 int followup_gsha();
@@ -68,6 +68,8 @@ int set_zephyr_modtime();
 /* Special Queries */
 int set_pobox();
 int get_list_info();
+int add_member_to_list();
+int delete_member_from_list();
 int get_ace_use();
 int qualified_get_lists();
 int get_members_of_list();
@@ -392,6 +394,43 @@ static struct validate dubu_validate = {
   0,
 };
 
+static char *gkum_fields[] = { LOGIN, "kerberos",
+                              LOGIN, "kerberos" };
+
+static char *akum_fields[] = { LOGIN, "kerberos" };
+
+static struct valobj akum_valobj[] =
+{
+    {V_ID, 0, USERS, LOGIN, USERS_ID, SMS_USER},
+    {V_ID, 1, "strings", "string", "string_id", SMS_NO_MATCH},
+};
+
+static struct validate akum_validate =
+{
+    akum_valobj,
+    1,
+    USERS_ID,
+    "k.users_id = %d or k.string_id = %d",
+    2,
+    USERS_ID,
+    access_user,
+    setup_akum,
+    0
+};
+
+static struct validate dkum_validate =
+{
+    akum_valobj,
+    2,
+    USERS_ID,
+    "k.users_id = %d and k.string_id = %d",
+    2,
+    USERS_ID,
+    access_user,
+    0,
+    0
+};
+
 static char *gfbl_fields[] = {
   LOGIN,
   LOGIN, "fullname", "nickname", "home_addr",
@@ -1232,7 +1271,7 @@ static struct validate gnfq_validate = {
   0,
   access_filesys,
   0,
-  followup_fix_modby,
+  followup_gnfq,
 };
 
 static char *gnqp_fields[] = {
@@ -1375,17 +1414,30 @@ static struct valobj amtl_valobj[] = {
   {V_TYPEDATA, 2, 0, 0, 0, SMS_NO_MATCH},
 };
 
-static struct validate amtl_validate = /* for amtl and dmfl */
+static struct validate amtl_validate =
 {
   amtl_valobj,
   4,
-  "member_id",
-  "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d",
-  3,
+  0,
+  0,
+  0,
   0,
   access_list,
   0,
-  followup_amtl,
+  add_member_to_list,
+};
+
+static struct validate dmfl_validate =
+{
+  amtl_valobj,
+  4,
+  0,
+  0,
+  0,
+  0,
+  access_list,
+  0,
+  delete_member_from_list,
 };
 
 static char *gaus_fields[] = {
@@ -1624,6 +1676,44 @@ static struct validate dpcp_validate = {
   0,
 };
 
+static char *gpdm_fields[] = {
+    NAME,
+    NAME, "rpcnum", "host", MOD1, MOD2, MOD3,
+};
+
+static char *apdm_fields[] = {
+    NAME, "rpcnum", "host"
+};
+
+static struct valobj apdm_valobj[] = {
+    {V_CHAR, 0},
+    {V_ID, 2, MACHINE, NAME, MACH_ID, SMS_MACHINE},
+};
+
+static struct validate apdm_validate = {
+  apdm_valobj,
+  2,
+  NAME,
+  "p.name = \"%s\"",
+  1,
+  0,
+  0,
+  0,
+  set_modtime,
+};
+
+static struct validate dpdm_validate = {
+  0,
+  0,
+  NAME,
+  "p.name = \"%s\"",
+  1,
+  0,
+  0,
+  0,
+  0,
+};
+
 static char *gali_fields[] = {
   NAME, TYPE, "trans",
   NAME, TYPE, "trans",
@@ -1924,6 +2014,51 @@ struct query Queries2[] = {
     &dubu_validate,
   },
 
+  {
+    /* Q_GKUM - GET_KERBEROS_USER_MAP */
+    "get_kerberos_user_map",
+    "gkum",
+    RETRIEVE,
+    "k",
+    "krbmap",
+    "%c = users.login, %c = strings.string",
+    gkum_fields,
+    2,
+    "users.login = \"%s\" and strings.string = \"%s\" and k.users_id = users.users_id and k.string_id = strings.string_id",
+    2,
+    &VDsort2,
+  },
+
+  {
+    /* Q_AKUM - ADD_KERBEROS_USER_MAP */
+    "add_kerberos_user_map",
+    "akum",
+    APPEND,
+    "k",
+    "krbmap",
+    "users_id = %i4, string_id = %i4",
+    akum_fields,
+    2,
+    0,
+    0,
+    &akum_validate,
+  },
+
+  {
+    /* Q_DKUM - DELETE_KERBEROS_USER_MAP */
+    "delete_kerberos_user_map",
+    "dkum",
+    DELETE,
+    "k",
+    "krbmap",
+    0,
+    akum_fields,
+    0,
+    "k.users_id = %d and k.string_id = %d",
+    2,
+    &dkum_validate,
+  },
+
   {
     /* Q_GFBL - GET_FINGER_BY_LOGIN */
     "get_finger_by_login",
@@ -2816,10 +2951,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "nq",
     "nfsquota",
-    "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name, %c = nq.modtime, %c = text(nq.modby), %c = nq.modwith",
+    "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = text(nq.phys_id), %c = machine.name, %c = nq.modtime, %c = text(nq.modby), %c = nq.modwith",
     gnfq_fields,
     8,
-    "filesys.label = \"%s\" and nq.users_id = %d and filesys.filsys_id = nq.filsys_id and nfsphys.nfsphys_id = nq.phys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id",
+    "filesys.label = \"%s\" and nq.users_id = %d and filesys.filsys_id = nq.filsys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id",
     2,
     &gnfq_validate,
   },
@@ -2964,9 +3099,9 @@ struct query Queries2[] = {
     "add_member_to_list",
     "amtl",
     APPEND,
-    "m",
-    "members",
-    "list_id=%i4, member_type=%c, member_id=%i4",
+    0,
+    "imembers",
+    0,
     amtl_fields,
     3,
     (char *)0,
@@ -2979,14 +3114,14 @@ struct query Queries2[] = {
     "delete_member_from_list",
     "dmfl",
     DELETE,
-    "m",
-    "members",
+    0,
+    "imembers",
     (char *)0,
     amtl_fields,
     0,
-    "m.list_id = %d and m.member_type = \"%s\" and m.member_id = %d",
+    0,
     3,
-    &amtl_validate,
+    &dmfl_validate,
   },
 
   {
@@ -3025,7 +3160,7 @@ struct query Queries2[] = {
     "gmol",
     RETRIEVE,
     (char *)0,
-    "members",
+    "imembers",
     (char *)0,
     gmol_fields,
     0,
@@ -3040,7 +3175,7 @@ struct query Queries2[] = {
     "glom",
     RETRIEVE,
     0,
-    "members",
+    "imembers",
     0,
     glom_fields,
     6,
@@ -3055,7 +3190,7 @@ struct query Queries2[] = {
     "cmol",
     RETRIEVE,
     0,
-    "members",
+    "imembers",
     0,
     cmol_fields,
     1,
@@ -3214,6 +3349,51 @@ struct query Queries2[] = {
     &dpcp_validate,
   },
 
+  {
+    /* Q_GPDM - GET_PALLADIUM */
+    "get_palladium",
+    "gpdm",
+    RETRIEVE,
+    "p",
+    "palladium",
+    "%c = p.name, %c = text(p.ident), %c = machine.name, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
+    gpdm_fields,
+    6,
+    "p.name = \"%s\" and machine.mach_id = p.mach_id",
+    1,
+    &VDsortf,
+  },
+
+  {
+    /* Q_APDM - ADD_PALLADIUM */
+    "add_palladium",
+    "apdm",
+    APPEND,
+    "p",
+    "palladium",
+    "name = %c, ident = int4(%c), mach_id = %i4",
+    apdm_fields,
+    3,
+    0,
+    0,
+    &apdm_validate,
+  },
+
+  {
+    /* Q_DPDM - DELETE_PALLADIUM */
+    "delete_palladium",
+    "dpdm",
+    DELETE,
+    "p",
+    "palladium",
+    0,
+    apdm_fields,
+    0,
+    "p.name = \"%s\"",
+    1,
+    &dpdm_validate,
+  },
+
   {
     /* Q_GALI - GET_ALIAS */
     "get_alias",
This page took 0.123873 seconds and 4 git commands to generate.