]> andersk Git - moira.git/commitdiff
allow users to set themselves to an IMAP box if the filesystem already
authorzacheiss <zacheiss>
Wed, 29 Mar 2000 20:07:17 +0000 (20:07 +0000)
committerzacheiss <zacheiss>
Wed, 29 Mar 2000 20:07:17 +0000 (20:07 +0000)
exists, is owned by them, and is the right type.

server/qaccess.pc

index a116d26d532dafea6b7c413c0bdb9401151b876d..56d28d54da238121ef29cddfdb1482b14bd5e1ad 100644 (file)
@@ -92,7 +92,19 @@ int access_login(struct query *q, char *argv[], client *cl)
 
 int access_spob(struct query *q, char *argv[], client *cl)
 {
-  if (cl->users_id != *(int *)argv[0] || !strcmp(argv[1], "IMAP"))
+  EXEC SQL BEGIN DECLARE SECTION;
+  int id;
+  EXEC SQL END DECLARE SECTION;
+
+  if (!strcmp(argv[1], "IMAP"))
+      {
+       EXEC SQL SELECT owner INTO :id FROM filesys f 
+         WHERE f.label = :argv[2] AND f.type = 'IMAP' AND
+         f.lockertype = 'USER';
+       if (cl->users_id != id)
+         return MR_PERM;
+      }
+  if (cl->users_id != *(int *)argv[0])
     return MR_PERM;
   else
     return MR_SUCCESS;
This page took 0.041289 seconds and 5 git commands to generate.