summaryrefslogtreecommitdiff
path: root/php/patches/php-5.2.9/KOLAB_php-5.2.9_myrights.patch
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2009-05-18 08:45:59 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2009-05-18 08:45:59 (GMT)
commit2f1da3da4d4d18e59c80de94490da6f9e72bdf8d (patch)
tree462821f9495ad253b761f7b8b19240ec7d157ad4 /php/patches/php-5.2.9/KOLAB_php-5.2.9_myrights.patch
parent9e5908e4e6887534b0be96f246ed46fb49af5837 (diff)
downloadserver-2f1da3da4d4d18e59c80de94490da6f9e72bdf8d.tar.gz
Moved php patches from the server/patches dir into server/php.
Diffstat (limited to 'php/patches/php-5.2.9/KOLAB_php-5.2.9_myrights.patch')
-rw-r--r--php/patches/php-5.2.9/KOLAB_php-5.2.9_myrights.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/php/patches/php-5.2.9/KOLAB_php-5.2.9_myrights.patch b/php/patches/php-5.2.9/KOLAB_php-5.2.9_myrights.patch
new file mode 100644
index 0000000..2bb91b3
--- /dev/null
+++ b/php/patches/php-5.2.9/KOLAB_php-5.2.9_myrights.patch
@@ -0,0 +1,79 @@
+diff -r 591dd6329e97 ext/imap/php_imap.c
+--- a/ext/imap/php_imap.c Mon Dec 22 06:35:22 2008 +0100
++++ b/ext/imap/php_imap.c Mon Dec 22 06:35:27 2008 +0100
+@@ -157,6 +157,7 @@
+ PHP_FE(imap_set_quota, NULL)
+ PHP_FE(imap_setacl, NULL)
+ PHP_FE(imap_getacl, NULL)
++ PHP_FE(imap_myrights, NULL)
+ #endif
+ #if defined(HAVE_IMAP2005)
+ PHP_FE(imap_setannotation, NULL)
+@@ -417,6 +418,20 @@
+ for(; alist; alist = alist->next) {
+ add_assoc_stringl(IMAPG(imap_acl_list), alist->identifier, alist->rights, strlen(alist->rights), 1);
+ }
++}
++/* }}} */
++
++/* {{{ 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)
++
+ }
+ /* }}} */
+
+@@ -1130,6 +1145,35 @@
+ }
+ /* }}} */
+
++/* {{{ proto string imap_myrights(resource stream_id, string mailbox)
++ Gets my rights (ACL) for a given mailbox */
++PHP_FUNCTION(imap_myrights)
++{
++ zval **streamind, **mailbox;
++ pils *imap_le_struct;
++
++ if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &mailbox) == FAILURE) {
++ ZEND_WRONG_PARAM_COUNT();
++ }
++
++ ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
++
++ convert_to_string_ex(mailbox);
++
++ IMAPG(imap_acl_list) = return_value;
++
++ /* set the callback for the GET_ACL function */
++ mail_parameters(NIL, SET_MYRIGHTS, (void *) mail_myrights);
++ if(!imap_myrights(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox))) {
++ php_error(E_WARNING, "c-client imap_myrights failed");
++ zval_dtor(return_value);
++ RETURN_FALSE;
++ }
++
++ IMAPG(imap_acl_list) = NIL;
++}
++/* }}} */
++
+ #endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
+
+ #if defined(HAVE_IMAP2005)
+diff -r 591dd6329e97 ext/imap/php_imap.h
+--- a/ext/imap/php_imap.h Mon Dec 22 06:35:22 2008 +0100
++++ b/ext/imap/php_imap.h Mon Dec 22 06:35:27 2008 +0100
+@@ -178,6 +178,7 @@
+ PHP_FUNCTION(imap_set_quota);
+ PHP_FUNCTION(imap_setacl);
+ PHP_FUNCTION(imap_getacl);
++PHP_FUNCTION(imap_myrights);
+ #endif
+ #if defined(HAVE_IMAP2005)
+ PHP_FUNCTION(imap_setannotation);