Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36648 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98093 invoked from network); 28 Mar 2008 13:47:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Mar 2008 13:47:24 -0000 Authentication-Results: pb1.pair.com header.from=thomas.jarosch@intra2net.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=thomas.jarosch@intra2net.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain intra2net.com from 81.169.173.116 cause and error) X-PHP-List-Original-Sender: thomas.jarosch@intra2net.com X-Host-Fingerprint: 81.169.173.116 rs02.intra2net.com Received: from [81.169.173.116] ([81.169.173.116:43725] helo=rs02.intra2net.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/ED-25926-9E6FCE74 for ; Fri, 28 Mar 2008 08:47:22 -0500 Received: from intranator.m.i2n (unknown [172.16.1.99]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rs02.intra2net.com (Postfix) with ESMTP id CFDD94E43 for ; Fri, 28 Mar 2008 14:47:17 +0100 (CET) Received: from localhost (intranator.m.i2n [127.0.0.1]) by localhost (Postfix) with ESMTP id 439761B36 for ; Fri, 28 Mar 2008 14:47:17 +0100 (CET) Received: from storm.m.i2n (storm.m.i2n [172.16.1.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intranator.m.i2n (Postfix) with ESMTP id 83C821198 for ; Fri, 28 Mar 2008 14:47:13 +0100 (CET) Organization: Intra2net AG To: internals@lists.php.net Date: Fri, 28 Mar 2008 14:47:12 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_gbP7HN3my5EhqTZ" Message-ID: <200803281447.12432.thomas.jarosch@intra2net.com> X-Virus-Scanned: by Intranator (www.intranator.com) with AMaViS and F-Secure AntiVirus (fsavdb 2008-03-28_05) X-Spam-Status: hits=-2.5 tests=[ALL_TRUSTED=-1.8,BAYES_20=-0.74] X-Spam-Level: 975 Subject: [patch] Implement IMAP DELETEACL command From: thomas.jarosch@intra2net.com (Thomas Jarosch) --Boundary-00=_gbP7HN3my5EhqTZ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --Boundary-00=_gbP7HN3my5EhqTZ Content-Type: text/x-diff; charset="us-ascii"; name="php-5.2.5-imap-deleteacl.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="php-5.2.5-imap-deleteacl.patch" --- 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 --Boundary-00=_gbP7HN3my5EhqTZ--