]> git.pld-linux.org Git - packages/php.git/blob - php-imap-myrights.patch
move php.1 manual to -program (link to actual php-cli)
[packages/php.git] / php-imap-myrights.patch
1 diff -r 591dd6329e97 ext/imap/php_imap.c
2 --- a/ext/imap/php_imap.c       Mon Dec 22 06:35:22 2008 +0100
3 +++ b/ext/imap/php_imap.c       Mon Dec 22 06:35:27 2008 +0100
4 @@ -157,6 +157,7 @@
5         PHP_FE(imap_set_quota,                                                  NULL)
6         PHP_FE(imap_setacl,                                                             NULL)
7         PHP_FE(imap_getacl,                                                             NULL)
8 +       PHP_FE(imap_myrights,                                                   NULL)
9  #endif
10  #if defined(HAVE_IMAP2005)
11         PHP_FE(imap_setannotation,                                                      NULL)
12 @@ -417,6 +418,20 @@
13         for(; alist; alist = alist->next) {
14                 add_assoc_stringl(IMAPG(imap_acl_list), alist->identifier, alist->rights, strlen(alist->rights), 1);
15         }
16 +}
17 +/* }}} */
18 +
19 +/* {{{ mail_myrights
20 + *
21 + * Mail MYRIGHTS callback
22 + * Called via the mail_parameter function in c-client:src/c-client/mail.c
23 + */
24 +void mail_myrights(MAILSTREAM *stream, char *mailbox, char *rights)
25 +{
26 +       TSRMLS_FETCH();
27 +
28 +       ZVAL_STRING(IMAPG(imap_acl_list), rights, 1)
29 +
30  }
31  /* }}} */
32  
33 @@ -1130,6 +1145,35 @@
34  }
35  /* }}} */
36  
37 +/* {{{ proto string imap_myrights(resource stream_id, string mailbox)
38 +       Gets my rights (ACL) for a given mailbox */
39 +PHP_FUNCTION(imap_myrights)
40 +{
41 +       zval **streamind, **mailbox;
42 +       pils *imap_le_struct;
43 +
44 +       if(ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &mailbox) == FAILURE) {
45 +               ZEND_WRONG_PARAM_COUNT();
46 +       }
47 +
48 +       ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
49 +
50 +       convert_to_string_ex(mailbox);
51 +
52 +       IMAPG(imap_acl_list) = return_value;
53 +
54 +       /* set the callback for the GET_ACL function */
55 +       mail_parameters(NIL, SET_MYRIGHTS, (void *) mail_myrights);
56 +       if(!imap_myrights(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox))) {
57 +               php_error(E_WARNING, "c-client imap_myrights failed");
58 +               zval_dtor(return_value);
59 +               RETURN_FALSE;
60 +       }
61 +
62 +       IMAPG(imap_acl_list) = NIL;
63 +}
64 +/* }}} */
65 +
66  #endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */
67  
68  #if defined(HAVE_IMAP2005)
69 diff -r 591dd6329e97 ext/imap/php_imap.h
70 --- a/ext/imap/php_imap.h       Mon Dec 22 06:35:22 2008 +0100
71 +++ b/ext/imap/php_imap.h       Mon Dec 22 06:35:27 2008 +0100
72 @@ -178,6 +178,7 @@
73  PHP_FUNCTION(imap_set_quota);
74  PHP_FUNCTION(imap_setacl);
75  PHP_FUNCTION(imap_getacl);
76 +PHP_FUNCTION(imap_myrights);
77  #endif
78  #if defined(HAVE_IMAP2005)
79  PHP_FUNCTION(imap_setannotation);
This page took 0.027851 seconds and 3 git commands to generate.