Back to index

citadel  8.12
Functions
imap_acl.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void imap_setacl (int num_parms, ConstStr *Params)
void imap_deleteacl (int num_parms, ConstStr *Params)
void imap_getacl (int num_parms, ConstStr *Params)
void imap_listrights (int num_parms, ConstStr *Params)
void imap_myrights (int num_parms, ConstStr *Params)

Function Documentation

void imap_deleteacl ( int  num_parms,
ConstStr *  Params 
)

Definition at line 79 of file imap_acl.c.

                                                     {

       IReply("BAD not yet implemented FIXME");
       return;
}

Here is the caller graph for this function:

void imap_getacl ( int  num_parms,
ConstStr *  Params 
)

Definition at line 143 of file imap_acl.c.

                                                  {
       char roomname[ROOMNAMELEN];
       char savedroom[ROOMNAMELEN];
       int msgs, new;
       int ret;
       struct ctdluser temp;
       struct cdbdata *cdbus;
       int ra;
       StrBuf *rights;

       if (num_parms != 3) {
              IReply("BAD usage error");
              return;
       }

       /*
        * Search for the specified room or folder
        */
       ret = imap_grabroom(roomname, Params[2].Key, 1);
       if (ret != 0) {
              IReply("NO Invalid mailbox name or access denied");
              return;
       }

       /*
        * CtdlUserGoto() formally takes us to the desired room.  (If another
        * folder is selected, save its name so we can return there!!!!!)
        */
       if (IMAP->selected) {
              strcpy(savedroom, CC->room.QRname);
       }
       CtdlUserGoto(roomname, 0, 0, &msgs, &new);

       IAPuts("* ACL ");
       IPutCParamStr(2);

       /*
        * Traverse the userlist
        */
       rights = NewStrBuf();
       cdb_rewind(CDB_USERS);
       while (cdbus = cdb_next_item(CDB_USERS), cdbus != NULL) 
       {
              memset(&temp, 0, sizeof temp);
              memcpy(&temp, cdbus->ptr, sizeof temp);
              cdb_free(cdbus);

              CtdlRoomAccess(&CC->room, &temp, &ra, NULL);
              if (!IsEmptyStr(temp.fullname)) {
                     imap_acl_flags(rights, ra);
                     if (StrLength(rights) > 0) {
                            IAPuts(" ");
                            plain_imap_strout(temp.fullname);
                            IAPuts(" ");
                            iaputs(SKEY( rights));
                     }
              }
       }
       FreeStrBuf(&rights);
       IAPuts("\r\n");

       /*
        * If another folder is selected, go back to that room so we can resume
        * our happy day without violent explosions.
        */
       if (IMAP->selected) {
              CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
       }

       IReply("OK GETACL completed");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void imap_listrights ( int  num_parms,
ConstStr *  Params 
)

Definition at line 219 of file imap_acl.c.

                                                      {
       char roomname[ROOMNAMELEN];
       char savedroom[ROOMNAMELEN];
       int msgs, new;
       int ret;
       struct recptypes *valid;
       struct ctdluser temp;

       if (num_parms != 4) {
              IReply("BAD usage error");
              return;
       }

       /*
        * Search for the specified room/folder
        */
       ret = imap_grabroom(roomname, Params[2].Key, 1);
       if (ret != 0) {
              IReply("NO Invalid mailbox name or access denied");
              return;
       }

       /*
        * Search for the specified user
        */
       ret = (-1);
       valid = validate_recipients(Params[3].Key, NULL, 0);
       if (valid != NULL) {
              if (valid->num_local == 1) {
                     ret = CtdlGetUser(&temp, valid->recp_local);
              }
              free_recipients(valid);
       }
       if (ret != 0) {
              IReply("NO Invalid user name or access denied");
              return;
       }

       /*
        * CtdlUserGoto() formally takes us to the desired room.  (If another
        * folder is selected, save its name so we can return there!!!!!)
        */
       if (IMAP->selected) {
              strcpy(savedroom, CC->room.QRname);
       }
       CtdlUserGoto(roomname, 0, 0, &msgs, &new);

       /*
        * Now output the list of rights
        */
       IAPuts("* LISTRIGHTS ");
       IPutCParamStr(2);
       IAPuts(" ");
       IPutCParamStr(3);
       IAPuts(" ");
       IPutStr(HKEY(""));          /* FIXME ... do something here */
       IAPuts("\r\n");

       /*
        * If another folder is selected, go back to that room so we can resume
        * our happy day without violent explosions.
        */
       if (IMAP->selected) {
              CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
       }

       IReply("OK LISTRIGHTS completed");
       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void imap_myrights ( int  num_parms,
ConstStr *  Params 
)

Definition at line 293 of file imap_acl.c.

                                                    {
       char roomname[ROOMNAMELEN];
       char savedroom[ROOMNAMELEN];
       int msgs, new;
       int ret;
       int ra;
       StrBuf *rights;

       if (num_parms != 3) {
              IReply("BAD usage error");
              return;
       }

       ret = imap_grabroom(roomname, Params[2].Key, 1);
       if (ret != 0) {
              IReply("NO Invalid mailbox name or access denied");
              return;
       }

       /*
        * CtdlUserGoto() formally takes us to the desired room.  (If another
        * folder is selected, save its name so we can return there!!!!!)
        */
       if (IMAP->selected) {
              strcpy(savedroom, CC->room.QRname);
       }
       CtdlUserGoto(roomname, 0, 0, &msgs, &new);

       CtdlRoomAccess(&CC->room, &CC->user, &ra, NULL);
       rights = NewStrBuf();
       imap_acl_flags(rights, ra);

       IAPuts("* MYRIGHTS ");
       IPutCParamStr(2);
       IAPuts(" ");
       IPutStr(SKEY(rights));
       IAPuts("\r\n");

       FreeStrBuf(&rights);

       /*
        * If a different folder was previously selected, return there now.
        */
       if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
              CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
       }

       IReply("OK MYRIGHTS completed");
       return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void imap_setacl ( int  num_parms,
ConstStr *  Params 
)

Definition at line 69 of file imap_acl.c.

                                                  {

       IReply("BAD not yet implemented FIXME");
       return;
}

Here is the caller graph for this function: