I have enclosed a patch that adds support for the IMAP setacl command that is found in the Cyrus IMAP package (and probably others). If anyone has any problems with this, please let me know. Brian
diff -ru php-4.0.6-orig/ext/imap/php_imap.c php-4.0.6/ext/imap/php_imap.c --- php-4.0.6-orig/ext/imap/php_imap.c Wed May 30 13:27:49 2001 +++ php-4.0.6/ext/imap/php_imap.c Tue Aug 7 10:48:29 2001 @@ -108,6 +108,7 @@ #ifdef HAVE_IMAP2000 PHP_FE(imap_get_quota, NULL) PHP_FE(imap_set_quota, NULL) + PHP_FE(imap_setacl, NULL) #endif PHP_FALIAS(imap_listmailbox, imap_list, NULL) PHP_FALIAS(imap_getmailboxes, imap_list_full, NULL) @@ -1094,6 +1095,36 @@ 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 -ru php-4.0.6-orig/ext/imap/php_imap.h php-4.0.6/ext/imap/php_imap.h --- php-4.0.6-orig/ext/imap/php_imap.h Mon Feb 26 13:14:28 2001 +++ php-4.0.6/ext/imap/php_imap.h Tue Aug 7 10:48:33 2001 @@ -110,6 +110,7 @@ #ifdef HAVE_IMAP2000 PHP_FUNCTION(imap_get_quota); PHP_FUNCTION(imap_set_quota); +PHP_FUNCTION(imap_setacl); #endif PHP_FUNCTION(imap_subscribe); PHP_FUNCTION(imap_unsubscribe);
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]