1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 02:52:48 +02:00

added vpopmail_alias_get covering valias_select/valias_select_next

This commit is contained in:
Boian Bonev
2001-05-24 10:33:32 +00:00
parent 1beda9ee1e
commit 312290a2c4
2 changed files with 36 additions and 3 deletions

View File

@@ -80,6 +80,7 @@ function_entry vpopmail_functions[] = {
PHP_FE(vpopmail_alias_add, NULL)
PHP_FE(vpopmail_alias_del, NULL)
PHP_FE(vpopmail_alias_del_domain, NULL)
PHP_FE(vpopmail_alias_get, NULL)
#endif
/* error handling */
PHP_FE(vpopmail_error, NULL)
@@ -761,7 +762,6 @@ PHP_FUNCTION(vpopmail_alias_add)
|| zend_get_parameters_ex(ZEND_NUM_ARGS(), &user, &domain, &alias) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_string_ex(user);
convert_to_string_ex(domain);
convert_to_string_ex(alias);
@@ -796,7 +796,6 @@ PHP_FUNCTION(vpopmail_alias_del)
|| zend_get_parameters_ex(ZEND_NUM_ARGS(), &user, &domain) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_string_ex(user);
convert_to_string_ex(domain);
@@ -827,7 +826,6 @@ PHP_FUNCTION(vpopmail_alias_del_domain)
|| zend_get_parameters_ex(ZEND_NUM_ARGS(), &domain) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_string_ex(domain);
VPOPMAILLS_FETCH();
@@ -845,6 +843,40 @@ PHP_FUNCTION(vpopmail_alias_del_domain)
}
}
/* }}} */
/* {{{ proto bool vpopmail_alias_get(string alias, string domain)
get all lines of an alias for a domain */
PHP_FUNCTION(vpopmail_alias_get)
{
zval **alias;
zval **domain;
int retval;
char *talias;
uint index=0;
if (ZEND_NUM_ARGS() != 2
|| zend_get_parameters_ex(ZEND_NUM_ARGS(), &alias, &domain) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_string_ex(alias);
convert_to_string_ex(domain);
VPOPMAILLS_FETCH();
VPOPMAILG(vpopmail_open) = 1;
if (array_init(return_value)!=SUCCESS) {
zend_error(E_ERROR,"unable to create array");
RETURN_FALSE;
}
talias=valias_select(Z_STRVAL_PP(alias), Z_STRVAL_PP(domain));
while (talias) {
add_index_string(return_value,index++,talias,1);
talias=valias_select_next();
}
}
/* }}} */
#endif
/*

View File

@@ -57,6 +57,7 @@ PHP_FUNCTION(vpopmail_auth_user);
PHP_FUNCTION(vpopmail_alias_add);
PHP_FUNCTION(vpopmail_alias_del);
PHP_FUNCTION(vpopmail_alias_del_domain);
PHP_FUNCTION(vpopmail_alias_get);
/* error handling */
PHP_FUNCTION(vpopmail_error);