Re: [PATCH] add imap_myrights
| From: | Jani Taskinen | Date: | Tue, 26 Aug 2008 14:12:32 +0000 |
| Subject: | Re: [PATCH] add imap_myrights | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-40092@lists.php.net to get a copy of this message | ||
Diego Woitasen wrote:
On Wed, August 20, 2008 10:55 pm, Jani Taskinen wrote:So you don't use imap_setacl/imap_getacl ?? Or care if someone else does? I'm not sure how this really works, but it doesn't sound quite right.. --JaniDiego Woitasen kirjoitti:Yes, it works. I use the imap_getacl() function as example to write imap_myrights(). What's the problem with overwriting acl global?Hi, I attach the patch that adds imap_myrights function to IMAP module. MYRIGHTS is a standard IMAP command defined in RFC 2086. diff -u -r php-5.2.6/ext/imap/php_imap.c php-myrights/ext/imap/php_imap.c --- php-5.2.6/ext/imap/php_imap.c Thu Apr 17 13:04:49 2008 +++ php-myrights/ext/imap/php_imap.c Tue Jun 3 18:06:37 2008 @@ -154,6 +154,7 @@ PHP_FE(imap_set_quota, NULL) PHP_FE(imap_setacl, NULL) PHP_FE(imap_getacl, NULL) + PHP_FE(imap_myrights, NULL) #endif PHP_FE(imap_mail, NULL) @@ -413,6 +414,20 @@ } /* }}} */ +/* {{{ mail_myrights + * + * Mail MYRIGHTS callback + * Called via the mail_parameter function in c-client:src/c-client/mail.c + */ +void mail_myrights(MAILSTREAM *stream, char *mailbox, char *rights) +{ + TSRMLS_FETCH(); + + ZVAL_STRING(IMAPG(imap_acl_list), rights, 1) + +} +/* }}} */ + #endifDoes this really work? You're blindly overwriting the acl global, AFAICT..? Or is that intentional?