Skip to content

Commit 2d7c267

Browse files
committed
Add methods for ldap_mod_* function replacements
Signed-off-by: Côme Chilliet <mcmic@php.net>
1 parent 22d1d82 commit 2d7c267

3 files changed

Lines changed: 34 additions & 6 deletions

File tree

‎ext/ldap/ldap.c‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,9 +2595,7 @@ PHP_METHOD(LDAP_Connection, add)
25952595
{
25962596
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_LD_FULL_ADD, true);
25972597
}
2598-
/* }}} */
25992598

2600-
/* {{{ Add entries to LDAP directory */
26012599
PHP_FUNCTION(ldap_add_ext)
26022600
{
26032601
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_LD_FULL_ADD, true);
@@ -2614,6 +2612,11 @@ PHP_FUNCTION(ldap_mod_replace)
26142612
/* }}} */
26152613

26162614
/* {{{ Replace attribute values with new ones */
2615+
PHP_METHOD(LDAP_Connection, mod_replace)
2616+
{
2617+
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE, true);
2618+
}
2619+
26172620
PHP_FUNCTION(ldap_mod_replace_ext)
26182621
{
26192622
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE, true);
@@ -2628,6 +2631,11 @@ PHP_FUNCTION(ldap_mod_add)
26282631
/* }}} */
26292632

26302633
/* {{{ Add attribute values to current */
2634+
PHP_METHOD(LDAP_Connection, mod_add)
2635+
{
2636+
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD, true);
2637+
}
2638+
26312639
PHP_FUNCTION(ldap_mod_add_ext)
26322640
{
26332641
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD, true);
@@ -2642,6 +2650,11 @@ PHP_FUNCTION(ldap_mod_del)
26422650
/* }}} */
26432651

26442652
/* {{{ Delete attribute values */
2653+
PHP_METHOD(LDAP_Connection, mod_del)
2654+
{
2655+
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_DELETE, true);
2656+
}
2657+
26452658
PHP_FUNCTION(ldap_mod_del_ext)
26462659
{
26472660
php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_DELETE, true);

‎ext/ldap/ldap.stub.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,10 +844,13 @@ public function __construct(?string $uri = null);
844844
public function bind(
845845
?string $dn = null,
846846
#[\SensitiveParameter] ?string $password = null,
847-
?array $controls = null
847+
?array $controls = null,
848848
): Result;
849849
public function unbind(): bool;
850-
public function add(string $dn, array $entry, ?array $controls = null): Result {}
850+
public function add(string $dn, array $entry, ?array $controls = null): Result;
851+
public function mod_add(string $dn, array $entry, ?array $controls = null): Result;
852+
public function mod_del(string $dn, array $entry, ?array $controls = null): Result;
853+
public function mod_replace(string $dn, array $entry, ?array $controls = null): Result;
851854
}
852855

853856
/**

‎ext/ldap/ldap_arginfo.h‎

Lines changed: 14 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)