cvs: php4 /ext/imap php_imap.c php_imap.h
| From: | Chuck Hagenbuch | Date: | Fri, 10 Aug 2001 18:32:56 +0000 |
| Subject: | cvs: php4 /ext/imap php_imap.c php_imap.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6715@lists.php.net to get a copy of this message | ||
chagenbu Fri Aug 10 14:32:56 2001 EDT
Modified files:
/php4/ext/imap php_imap.c php_imap.h
Log:
Add imap_setacl() function (Brian Masney <masneyb@seul.org>).
Index: php4/ext/imap/php_imap.c
diff -u php4/ext/imap/php_imap.c:1.96 php4/ext/imap/php_imap.c:1.97
--- php4/ext/imap/php_imap.c:1.96 Tue Aug 7 22:55:07 2001
+++ php4/ext/imap/php_imap.c Fri Aug 10 14:32:56 2001
@@ -25,7 +25,7 @@
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.c,v 1.96 2001/08/08 02:55:07 sniper Exp $ */
+/* $Id: php_imap.c,v 1.97 2001/08/10 18:32:56 chagenbu Exp $ */
#define IMAP41
@@ -132,6 +132,7 @@
#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 @@
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
Index: php4/ext/imap/php_imap.h
diff -u php4/ext/imap/php_imap.h:1.13 php4/ext/imap/php_imap.h:1.14
--- php4/ext/imap/php_imap.h:1.13 Tue Aug 7 22:55:07 2001
+++ php4/ext/imap/php_imap.h Fri Aug 10 14:32:56 2001
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_imap.h,v 1.13 2001/08/08 02:55:07 sniper Exp $ */
+/* $Id: php_imap.h,v 1.14 2001/08/10 18:32:56 chagenbu Exp $ */
#ifndef PHP_IMAP_H
#define PHP_IMAP_H
@@ -178,6 +178,7 @@
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001)
PHP_FUNCTION(imap_get_quota);
PHP_FUNCTION(imap_set_quota);
+PHP_FUNCTION(imap_setacl);
#endif