Hello together,

PHP already features imap_getacl() and imap_setacl().
imap_deleteacl() was somehow missing. Attached patch
implements it (it's a stripped-down copy of imap_setacl).

imap_deleteacl() already contains the fix from here:
http://bugs.php.net/?id=44557

Please CC: comments, I'm not on the list.

Cheers,
Thomas
--- php-5.2.5/ext/imap/php_imap.c	Fri Mar 28 13:28:28 2008
+++ php-5.2.5.new/ext/imap/php_imap.c	Fri Mar 28 13:58:18 2008
@@ -153,6 +153,7 @@
 	PHP_FE(imap_get_quota,							NULL)
 	PHP_FE(imap_get_quotaroot,						NULL)
 	PHP_FE(imap_set_quota,							NULL)
+	PHP_FE(imap_deleteacl,								NULL)
 	PHP_FE(imap_setacl,								NULL)
 	PHP_FE(imap_getacl,								NULL)
 #endif
@@ -1066,6 +1067,26 @@
 }
 /* }}} */
 
+/* {{{ proto bool imap_deleteacl(resource stream_id, string mailbox, string id)
+	Delete the ACL for a given mailbox */
+PHP_FUNCTION(imap_deleteacl)
+{
+	zval **streamind, **mailbox, **id;
+	pils *imap_le_struct;
+	
+	if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &streamind, &mailbox, &id) == FAILURE) {
+		ZEND_WRONG_PARAM_COUNT();
+	}
+
+	ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap);
+
+	convert_to_string_ex(mailbox);
+	convert_to_string_ex(id);
+
+	RETURN_BOOL(imap_deleteacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), Z_STRVAL_PP(id)));
+}
+
+/* }}} */
 /* {{{ proto bool imap_setacl(resource stream_id, string mailbox, string id, string rights)
 	Sets the ACL for a given mailbox */
 PHP_FUNCTION(imap_setacl)
--- php-5.2.5/ext/imap/php_imap.h	Fri Mar 28 13:28:28 2008
+++ php-5.2.5.new/ext/imap/php_imap.h	Fri Mar 28 13:51:50 2008
@@ -176,6 +176,7 @@
 PHP_FUNCTION(imap_get_quota);
 PHP_FUNCTION(imap_get_quotaroot);
 PHP_FUNCTION(imap_set_quota);
+PHP_FUNCTION(imap_deleteacl);
 PHP_FUNCTION(imap_setacl);
 PHP_FUNCTION(imap_getacl);
 #endif

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to