johannes                                 Wed, 27 Jan 2010 17:36:46 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=294109

Log:
merge r293126 - [doc] add support for DISABLE_AUTHENTICATOR in imap_open (fix
#33500) (pajoye)

Bug: http://bugs.php.net/33500 (Closed) imap_open() fails when the server 
advertises GSSAPI
      
Changed paths:
    _U  php/php-src/branches/PHP_5_3_2/
    U   php/php-src/branches/PHP_5_3_2/NEWS
    U   php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c


Property changes on: php/php-src/branches/PHP_5_3_2
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292719,292762,292765,292771,292777,292823,293051,293075,293114,293974
/php/php-src/trunk:284726
   + 
/php/php-src/branches/PHP_5_3:292504,292574,292594-292595,292611,292624,292630,292632-292635,292654,292677,292682-292683,292693,292719,292762,292765,292771,292777,292823,293051,293075,293114,293126,293974
/php/php-src/trunk:284726

Modified: php/php-src/branches/PHP_5_3_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3_2/NEWS 2010-01-27 17:29:38 UTC (rev 294108)
+++ php/php-src/branches/PHP_5_3_2/NEWS 2010-01-27 17:36:46 UTC (rev 294109)
@@ -3,6 +3,7 @@
 ?? ??? 20??, PHP 5.3.2 RC 2
 - Upgraded bundled libmagic to version 5.03. (Mikko)

+- Added support for DISABLE_AUTHENTICATOR for imap_open. (Pierre)
 - Added missing host validation for HTTP urls inside FILTER_VALIDATE_URL.
   (Ilia)
 - Added stream_resolve_include_path(). (Mikko)

Modified: php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c  2010-01-27 17:29:38 UTC 
(rev 294108)
+++ php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c  2010-01-27 17:36:46 UTC 
(rev 294109)
@@ -105,6 +105,7 @@
        ZEND_ARG_INFO(0, password)
        ZEND_ARG_INFO(0, options)
        ZEND_ARG_INFO(0, n_retries)
+       ZEND_ARG_INFO(0, params)
 ZEND_END_ARG_INFO()

 ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_reopen, 0, 0, 2)
@@ -1148,10 +1149,11 @@
        long retries = 0, flags = NIL, cl_flags = NIL;
        MAILSTREAM *imap_stream;
        pils *imap_le_struct;
+       zval *params = NULL;
        int argc = ZEND_NUM_ARGS();

-       if (zend_parse_parameters(argc TSRMLS_CC, "sss|ll", &mailbox, 
&mailbox_len, &user, &user_len,
-               &passwd, &passwd_len, &flags, &retries) == FAILURE) {
+       if (zend_parse_parameters(argc TSRMLS_CC, "sss|lla", &mailbox, 
&mailbox_len, &user, &user_len,
+               &passwd, &passwd_len, &flags, &retries, &params) == FAILURE) {
                return;
        }

@@ -1165,6 +1167,46 @@
                }
        }

+       if (params) {
+               zval **disabled_auth_method;
+
+               if (zend_hash_find(HASH_OF(params), "DISABLE_AUTHENTICATOR", 
sizeof("DISABLE_AUTHENTICATOR"), (void **)&disabled_auth_method) == SUCCESS) {
+                       switch (Z_TYPE_PP(disabled_auth_method)) {
+                               case IS_STRING:
+                                       if (Z_STRLEN_PP(disabled_auth_method) > 
1) {
+                                               mail_parameters (NIL, 
DISABLE_AUTHENTICATOR, (void *)Z_STRVAL_PP(disabled_auth_method));
+                                       }
+                                       break;
+                               case IS_ARRAY:
+                                       {
+                                               zval **z_auth_method;
+                                               int i;
+                                               int nelems = 
zend_hash_num_elements(Z_ARRVAL_PP(disabled_auth_method));
+
+                                               if (nelems == 0 ) {
+                                                       break;
+                                               }
+                                               for (i = 0; i < nelems; i++) {
+                                                       if 
(zend_hash_index_find(Z_ARRVAL_PP(disabled_auth_method), i, (void **) 
&z_auth_method) == SUCCESS) {
+                                                               if 
(Z_TYPE_PP(z_auth_method) == IS_STRING) {
+                                                                       if 
(Z_STRLEN_PP(z_auth_method) > 1) {
+                                                                               
mail_parameters (NIL, DISABLE_AUTHENTICATOR, (void 
*)Z_STRVAL_PP(disabled_auth_method));
+                                                                       }
+                                                               } else {
+                                                                       
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid argument, expect string or 
array of strings");
+                                                               }
+                                                       }
+                                               }
+                                       }
+                                       break;
+                               case IS_LONG:
+                               default:
+                                       php_error_docref(NULL TSRMLS_CC, 
E_WARNING, "Invalid argument, expect string or array of strings");
+                                       break;
+                       }
+               }
+       }
+
        if (IMAPG(imap_user)) {
                efree(IMAPG(imap_user));
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to