]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-quota: Allow GETQUOTAROOT for public namespaces.
authorTimo Sirainen <tss@iki.fi>
Fri, 17 Apr 2009 01:58:20 +0000 (21:58 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 17 Apr 2009 01:58:20 +0000 (21:58 -0400)
--HG--
branch : HEAD

src/plugins/imap-quota/imap-quota-plugin.c

index 5cd57691945e4e34e858bccd1136a9f64bcaf2f6..c5e1c280f2287625fb896c29774659a217627905 100644 (file)
@@ -23,7 +23,7 @@ imap_quota_root_get_name(struct mail_user *user, struct mail_user *owner,
        const char *name;
 
        name = quota_root_get_name(root);
-       if (user == owner)
+       if (user == owner || owner == NULL)
                return name;
        return t_strdup_printf("%s%c%s", owner->username,
                               QUOTA_USER_SEPARATOR, name);
@@ -94,12 +94,13 @@ static bool cmd_getquotaroot(struct client_command_context *cmd)
        }
 
        ns = mail_storage_get_namespace(storage);
-       if (quser == NULL || ns->owner == NULL) {
+       if (quser == NULL) {
                mailbox_close(&box);
                client_send_tagline(cmd, "OK No quota.");
                return TRUE;
        }
-       if (ns->owner != client->user && !client->user->admin) {
+       if (ns->owner != NULL && ns->owner != client->user &&
+           !client->user->admin) {
                mailbox_close(&box);
                client_send_tagline(cmd, "NO Not showing other users' quota.");
                return TRUE;