diff options
author | Chuck Hagenbuch <chagenbu@php.net> | 2001-08-10 18:32:56 +0000 |
---|---|---|
committer | Chuck Hagenbuch <chagenbu@php.net> | 2001-08-10 18:32:56 +0000 |
commit | a2b297bdf0e3d76b254aed76e55fb8d4dc28ad33 (patch) | |
tree | 954476b6234c1a846aede507d874a9e0c70279c9 | |
parent | 831f05b0fbd13c2eefa58ec62b5ea6e1ab4c5a16 (diff) | |
download | php-git-a2b297bdf0e3d76b254aed76e55fb8d4dc28ad33.tar.gz |
Add imap_setacl() function (Brian Masney <masneyb@seul.org>).
-rw-r--r-- | ext/imap/php_imap.c | 31 | ||||
-rw-r--r-- | ext/imap/php_imap.h | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index f94438ff7f..2d23ff90d6 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -132,6 +132,7 @@ function_entry imap_functions[] = { #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) PHP_FE(imap_get_quota, NULL) PHP_FE(imap_set_quota, NULL) + PHP_FE(imap_setacl, NULL) #endif #ifndef PHP_WIN32 @@ -1058,6 +1059,36 @@ PHP_FUNCTION(imap_set_quota) RETURN_LONG(imap_setquota(imap_le_struct->imap_stream, Z_STRVAL_PP(qroot), &limits)); } /* }}} */ + + +/* {{{ proto int imap_setacl(int stream_id, string mailbox, string id, string rights) + Sets the ACL for a giving mailbox */ +PHP_FUNCTION(imap_setacl) +{ + zval **streamind, **mailbox, **id, **rights; + int ind, ind_type; + pils *imap_le_struct; + + if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &streamind, &mailbox, &id, &rights) == FAILURE) { + ZEND_WRONG_PARAM_COUNT(); + } + + convert_to_long_ex(streamind); + convert_to_string_ex(mailbox); + convert_to_string_ex(id); + convert_to_string_ex(rights); + + ind = Z_LVAL_PP(streamind); + imap_le_struct = (pils *) zend_list_find(ind, &ind_type); + if (!imap_le_struct || !IS_STREAM(ind_type)) { + php_error(E_WARNING, "Unable to find stream pointer"); + RETURN_FALSE; + } + + RETURN_LONG(imap_setacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), Z_STRVAL_PP(id), Z_STRVAL_PP(rights))); +} +/* }}} */ + #endif diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h index 16485537e2..cd33a518fb 100644 --- a/ext/imap/php_imap.h +++ b/ext/imap/php_imap.h @@ -178,6 +178,7 @@ PHP_FUNCTION(imap_thread); #if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) PHP_FUNCTION(imap_get_quota); PHP_FUNCTION(imap_set_quota); +PHP_FUNCTION(imap_setacl); #endif |