Lines 133-142
Link Here
|
133 |
|
133 |
|
134 |
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) |
134 |
#if defined(HAVE_IMAP2000) || defined(HAVE_IMAP2001) |
135 |
PHP_FE(imap_get_quota, NULL) |
135 |
PHP_FE(imap_get_quota, NULL) |
136 |
PHP_FE(imap_set_quota, NULL) |
136 |
PHP_FE(imap_set_quota, NULL) |
137 |
PHP_FE(imap_setacl, NULL) |
137 |
PHP_FE(imap_setacl, NULL) |
|
|
138 |
PHP_FE(imap_getacl, NULL) |
138 |
#endif |
139 |
#endif |
139 |
|
140 |
|
140 |
PHP_FE(imap_mail, NULL) |
141 |
PHP_FE(imap_mail, NULL) |
141 |
|
142 |
|
142 |
PHP_FALIAS(imap_header, imap_headerinfo, NULL) |
143 |
PHP_FALIAS(imap_header, imap_headerinfo, NULL) |
Lines 384-393
Link Here
|
384 |
IMAPG(quota_usage) = qlist->usage; |
385 |
IMAPG(quota_usage) = qlist->usage; |
385 |
IMAPG(quota_limit) = qlist->limit; |
386 |
IMAPG(quota_limit) = qlist->limit; |
386 |
} |
387 |
} |
387 |
} |
388 |
} |
388 |
/* }}} */ |
389 |
/* }}} */ |
|
|
390 |
|
391 |
|
392 |
/* {{{ mail_getquota |
393 |
* |
394 |
* Mail GET_ACL callback |
395 |
* Called via the mail_parameter function in c-client:src/c-client/mail.c |
396 |
*/ |
397 |
void mail_getacl(MAILSTREAM *stream, char *mailbox, ACLLIST *alist) |
398 |
{ |
399 |
TSRMLS_FETCH(); |
400 |
|
401 |
/* walk through the ACLLIST */ |
402 |
for (; alist; alist = alist->next) |
403 |
{ |
404 |
add_assoc_stringl(IMAPG(imap_acl_list), alist->identifier, alist->rights, strlen(alist->rights), 1); |
405 |
} |
406 |
|
407 |
} |
408 |
/* }}} */ |
389 |
#endif |
409 |
#endif |
390 |
|
410 |
|
391 |
/* {{{ php_imap_init_globals |
411 |
/* {{{ php_imap_init_globals |
392 |
*/ |
412 |
*/ |
393 |
static void php_imap_init_globals(zend_imap_globals *imap_globals) |
413 |
static void php_imap_init_globals(zend_imap_globals *imap_globals) |
Lines 406-415
Link Here
|
406 |
imap_globals->imap_messages_tail = NIL; |
426 |
imap_globals->imap_messages_tail = NIL; |
407 |
imap_globals->imap_folder_objects = NIL; |
427 |
imap_globals->imap_folder_objects = NIL; |
408 |
imap_globals->imap_folder_objects_tail = NIL; |
428 |
imap_globals->imap_folder_objects_tail = NIL; |
409 |
imap_globals->imap_sfolder_objects = NIL; |
429 |
imap_globals->imap_sfolder_objects = NIL; |
410 |
imap_globals->imap_sfolder_objects_tail = NIL; |
430 |
imap_globals->imap_sfolder_objects_tail = NIL; |
|
|
431 |
imap_globals->imap_acl_list = NIL; |
411 |
|
432 |
|
412 |
imap_globals->folderlist_style = FLIST_ARRAY; |
433 |
imap_globals->folderlist_style = FLIST_ARRAY; |
413 |
} |
434 |
} |
414 |
/* }}} */ |
435 |
/* }}} */ |
415 |
|
436 |
|
Lines 1105-1114
Link Here
|
1105 |
|
1126 |
|
1106 |
RETURN_LONG(imap_setacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), Z_STRVAL_PP(id), Z_STRVAL_PP(rights))); |
1127 |
RETURN_LONG(imap_setacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox), Z_STRVAL_PP(id), Z_STRVAL_PP(rights))); |
1107 |
} |
1128 |
} |
1108 |
/* }}} */ |
1129 |
/* }}} */ |
1109 |
|
1130 |
|
|
|
1131 |
|
1132 |
/* {{{ proto array imap_get_quota(int stream_id, string mailbox) |
1133 |
Gets the ACL for a given mailbox */ |
1134 |
PHP_FUNCTION(imap_getacl) |
1135 |
{ |
1136 |
zval **streamind, **mailbox; |
1137 |
pils *imap_le_struct; |
1138 |
|
1139 |
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &streamind, &mailbox) == FAILURE) { |
1140 |
ZEND_WRONG_PARAM_COUNT(); |
1141 |
} |
1142 |
|
1143 |
ZEND_FETCH_RESOURCE(imap_le_struct, pils *, streamind, -1, "imap", le_imap); |
1144 |
|
1145 |
convert_to_string_ex(mailbox); |
1146 |
|
1147 |
/* initializing the special array for the return values */ |
1148 |
array_init(return_value); |
1149 |
|
1150 |
IMAPG(imap_acl_list) = return_value; |
1151 |
|
1152 |
/* set the callback for the GET_ACL function */ |
1153 |
mail_parameters(NIL, SET_ACL, (void *) mail_getacl); |
1154 |
if(!imap_getacl(imap_le_struct->imap_stream, Z_STRVAL_PP(mailbox))) { |
1155 |
php_error(E_WARNING, "c-client imap_getacl failed"); |
1156 |
RETURN_FALSE; |
1157 |
} |
1158 |
|
1159 |
IMAPG(imap_acl_list) = NIL; |
1160 |
} |
1161 |
/* }}} */ |
1110 |
#endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */ |
1162 |
#endif /* HAVE_IMAP2000 || HAVE_IMAP2001 */ |
1111 |
|
1163 |
|
1112 |
|
1164 |
|
1113 |
/* {{{ proto int imap_expunge(int stream_id) |
1165 |
/* {{{ proto int imap_expunge(int stream_id) |
1114 |
Permanently delete all messages marked for deletion */ |
1166 |
Permanently delete all messages marked for deletion */ |