diff --git a/xcache.c b/xcache.c index f37aa29..8af66e1 100644 --- a/xcache.c +++ b/xcache.c @@ -2530,6 +2530,11 @@ static int xcache_admin_auth_check(TSRMLS_D) /* {{{ */ char *admin_pass = NULL; HashTable *ht; + /* auth disabled, nothing to do.. */ + if (!XG(auth_enabled)) { + return 1; + } + if (cfg_get_string("xcache.admin.user", &admin_user) == FAILURE || !admin_user[0]) { admin_user = NULL; } @@ -3435,6 +3440,7 @@ PHP_INI_BEGIN() STD_PHP_INI_BOOLEAN("xcache.cacher", "1", PHP_INI_ALL, OnUpdateBool, cacher, zend_xcache_globals, xcache_globals) STD_PHP_INI_BOOLEAN("xcache.stat", "1", PHP_INI_ALL, OnUpdateBool, stat, zend_xcache_globals, xcache_globals) + STD_PHP_INI_BOOLEAN("xcache.admin.enable_auth", "1", PHP_INI_SYSTEM, OnUpdateBool, auth_enabled, zend_xcache_globals, xcache_globals) STD_PHP_INI_BOOLEAN("xcache.experimental", "0", PHP_INI_ALL, OnUpdateBool, experimental, zend_xcache_globals, xcache_globals) #ifdef HAVE_XCACHE_OPTIMIZER STD_PHP_INI_BOOLEAN("xcache.optimizer", "0", PHP_INI_ALL, OnUpdateBool, optimizer, zend_xcache_globals, xcache_globals) diff --git a/xcache_globals.h b/xcache_globals.h index b4d5043..312a9ea 100644 --- a/xcache_globals.h +++ b/xcache_globals.h @@ -16,6 +16,7 @@ ZEND_BEGIN_MODULE_GLOBALS(xcache) xc_stack_t *var_holds; time_t request_time; long var_ttl; + zend_bool auth_enabled; zend_llist gc_op_arrays;