]> andersk Git - moira.git/blobdiff - server/qvalidate.pc
Remove `delete_user_by_uid' since it's never been used in any logs we have,
[moira.git] / server / qvalidate.pc
index 3372e5d736ff0fa3e9756a29e55fe6a8d5d2d8e5..70309450b89e20c66e8a590aca3f99b79babfb56 100644 (file)
@@ -206,7 +206,7 @@ int validate_id(q, argv, vo)
     register struct valobj *vo;
 {
     EXEC SQL BEGIN DECLARE SECTION;
-    char *name, *namefield, *idfield;
+    char *name;
     int id, rowcount, tbl;
     EXEC SQL END DECLARE SECTION;
     int status;
@@ -214,39 +214,23 @@ int validate_id(q, argv, vo)
 
     name = argv[vo->index];
     tbl = vo->table;
-    namefield = vo->namefield;
-    idfield = vo->idfield;
 
-    if ((tbl==USERS_TABLE && !strcmp(namefield, "login")) ||
-       tbl==MACHINE_TABLE || tbl==SUBNET_TABLE || tbl==FILESYS_TABLE ||
-       tbl==LIST_TABLE || tbl==CLUSTER_TABLE || tbl==STRINGS_TABLE) {
-      if (tbl==MACHINE_TABLE || tbl==SUBNET_TABLE)
+    if (tbl==MACHINE_TABLE || tbl==SUBNET_TABLE)
        for (c = name; *c; c++) if (islower(*c)) *c = toupper(*c);
-      status = name_to_id(name, tbl, &id);
-      if (status == 0) {
+    status = name_to_id(name, tbl, &id);
+    if (status == 0) {
        *(int *)argv[vo->index] = id;
        return(MR_EXISTS);
-      } else if (status == MR_NO_MATCH && tbl==STRINGS_TABLE &&
-                (q->type == APPEND || q->type == UPDATE)) {
+    } else if (status == MR_NO_MATCH && tbl==STRINGS_TABLE &&
+              (q->type == APPEND || q->type == UPDATE)) {
        id=add_string(name);
        cache_entry(name, STRINGS_TABLE, id);
        *(int *)argv[vo->index] = id;
        return(MR_EXISTS);
-      } else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)
+    } else if (status == MR_NO_MATCH || status == MR_NOT_UNIQUE)
        return(vo->error);
-      else
+    else
        return(status);
-    } else {
-      /* else, it's `dubu', which uses unix_uid from users */
-      EXEC SQL SELECT COUNT(*) INTO :rowcount FROM users
-       WHERE unix_uid = :name;
-      if (dbms_errno) return(mr_errcode);
-      if (rowcount != 1) return(vo->error);
-      EXEC SQL SELECT users_id INTO :id FROM users
-       WHERE unix_uid = :name;
-      *(int *)argv[vo->index] = id;
-      return(MR_EXISTS);
-    }
 }
 
 int validate_name(argv, vo)
This page took 0.738718 seconds and 4 git commands to generate.