PHP.mk документација

ldap_mod_del

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

function.ldap-mod-del.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека function.ldap-mod-del.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
ldap_mod_del

Референца за `function.ldap-mod-del.php` со подобрена типографија и навигација.

function.ldap-mod-del.php

ldap_mod_del

(PHP 4, PHP 5, PHP 7, PHP 8)

ldap_mod_delИзбриши вредности на атрибути од тековните атрибути

= NULL

ldap_mod_del(
         LDAP\Connection $ldap,
         string $dn,
         array $entry,
         ?array $controls = null
): bool

Отстранува една или повеќе вредности на атрибути од наведените dn. Бришењето на објекти се врши со ldap_delete() function.

Параметри

ldap

Еден LDAP\Connection инстанца, вратена од ldap_connect().

dn

. Може исто така да додава или отстранува атрибути.

entry

controls

Низа од LDAP контроли сега е nullable; претходно, стандардно беше

Вратени вредности

Патеката до PHP скриптата што треба да се провери. true на успех или false при неуспех.

Дневник на промени

Верзија = NULL
8.1.0 На ldap параметарот очекува LDAP\Connection инстанца сега; претходно, валидна ldap link resource се очекуваше.
8.0.0 controls Пример #1 LDAP пребарување [].
7.3.0 Поддршка за controls added

Види Исто така

  • ldap_mod_del_ext() - Замени ги вредностите на атрибутите со нови
  • ldap_mod_add() - Избриши ги вредностите на атрибутите од тековните атрибути
  • ldap_mod_replace() Асоцијативен список што ги наведува атрибутите што треба да се заменат. Испраќањето празен список како вредност ќе го отстрани атрибутот, додека испраќањето атрибут што сè уште не постои на овој запис ќе го додаде.
  • ldap_modify_batch() - Додај вредности на атрибути на тековните атрибути

Белешки од корисници 13 белешки

Анонимен
19 години пред
For anyone interested in removing a user from a group, you can use ldap_mod_del() as follows:

$group = 'CN=mygroup,OU=myOU,DC=mydomain,DC=com';

$group_info['member'] = 'CN=User\, Test,CN=Users,DC=mydomain,DC=com';

ldap_mod_del($ldap, $group, $group_info);

I have tested this using Active Directory on a Win 2K3 server.
gsgleason на gmail точка com
пред 11 години
To remove all of a particular attribute, feed it an empty array.

For example, to remove all members from a group:

<?php
ldap_mod_del($ldapconn,$groupDN,array("member" => array()));
?>
bart-holland на wedefo точка nl
12 години пред
Te remove a user from a group in Apple's Open Directory, you need to also remove the members generated uid from the group.

Removing the users is as follows:

<?php

//setting variables
$ldapDN = "uid=myadmin,cn=users,dc=myserver,dc=com';
$ldapPass = "somepass";

$groupDn = 'cn=mygroup,cn=groups,dc=myserver,dc=com'
$removal = array(
    "memberuid"=>"username",
    "apple-group-memberguid"=>"846DE847-D73D-428D-83A8-B95B606C511B"
);

//connect and bind
$ldapconnect = ldap_connect("myserver.com",389);
ldap_bind($ldapconnect, $ldapDN, $ldapPass);

//removing member from group
ldap_mod_del($ldapconnect, $groupDn, $removal);

//unbind
ldap_unbind($ldapconnect);

?>
mark на cushman точка net
yasuo_ohgaki at hotmail dot com
I have found that the syntax:

$entry["mail"] = ""; 

Will NOT delete the mail attribute using the OpenLDAP server.  You must specify the attribute value to delete it successfully, otherwise you will recieve an "Invalid Syntax" error from the server.

The error: "Inappropriate Matching" will be displayed if the attribute you are trying to delete has no equality rule in the schema.  I had a problem deleting the attribute facsimilieTelephoneNumber, and it was because my core.schema file did not have an EQUALITY definition for that attribute.  I copied the telephoneNumber EQUALITY rule and it worked perfectly.
jonatam.ribeiro на hotmail точка com
12 години пред
We often need to delete "objectclass" below follows a simple code to make this successful removal.

$userdataModifydelSamba = array();
$userdataModifydelSamba['objectClass'] = array();
$userdataModifydelSamba['objectClass'][0] = 'sambaSamAccount';

$userdataModifydelSamba['sambasid'] = array();
$userdataModifydelSamba['sambantpassword'] = array();
$userdataModifydelSamba['sambahomedrive'] = array();
$userdataModifydelSamba['sambadomainname'] = array();
$userdataModifydelSamba['sambaacctflags'] = array();
$userdataModifydelSamba['sambaprimarygroupsid'] = array();
$userdataModifydelSamba['sambapwdlastset'] = array();

$sucess = @ldap_mod_del($connection, $dn, $result);
if(!$sucess)
{
   throw new Exception("error " . ldap_err2str(ldap_errno($connection)));
}
thomas.thiel на tapgmbh точка com
пред 23 години
and please don't forget:
you can't delete all attributes, when at least one is required.
chris at mr2madness dot com
пред 23 години
The above example has also been proven to work in the iPlanet / Sun One Directory Server 5.0/5.1. As an example:

$attrs["mail"] = array();
ldap_mod_del($ldapConnID,$dn,$attrs);

or

$attrs["mail"] = array();
$attrs["telephonenumber"] = array();
ldap_mod_del($ldapConnID,$dn,$attrs);

This will remove all occurences of attributes in the entry specified by the dn.
ral на royal точка net
figroc at gmail dot com
At least with OpenLDAP 1.2.x
to remove an attribute regardless of it's value you have to assign:

$attrs["AttributeName"]=array();

after ldap_mod_del($ds,$dn,$attrs)
all occurences of AttributeName will be removed
ral на royal точка net
figroc at gmail dot com
To remove all instances of an attribute:

$entry["attrname"][]="value1";
$entry["attrname"][]="value2";
...
$entry["attrname"][]="valueN";

ldap_mod_del($ds, $dn, $entry);
twopairs на solfy точка com
figroc at gmail dot com
<pre> 
uid: testuser 
mail: [email protected] 
mail: [email protected] 
</pre> 

How to remove the values of mail so that only the second value for mail exists:

<pre> 
$entry["mail"] = "[email protected]"; 
$result = ldap_mod_del($connID, $dn, $entry); 
</pre> 

if you want to remove all instances of an attribute.....
==> 
<pre> 
$entry["mail"][0] = "[email protected]"; 
$entry["mail"][1] = "[email protected]"; 
$result = ldap_mod_del($connID, $dn, $entry); 
</pre> 

are not?
sam_freund на yahoo точка com
yasuo_ohgaki at hotmail dot com
Using ldap_modify with a blank string works if you aren't propagating your LDAP database, even though it returns the error. Still, I'd say don't do it, as it smacks of something that will be fixed in a future version.
arimus на apu точка edu
yasuo_ohgaki at hotmail dot com
After a couple hours of searching and not finding anything on the ldap_mod_del function worth anything, I started trying to figure out myself what format the "array entry" parameter needed to be in.  Here is what I found:

The entry array is a hash with the attribute name as the hash key and the specific value you want deleted for that attribute as the corresponding hash value.

-- Example

Current values for the attributes of of a particular entry:

     uid: testuser
     mail: [email protected]
     mail: [email protected]

How to remove the first value of mail so that only the second value for mail exists:

     $entry["mail"] = "[email protected]";
     $result = ldap_mod_del($connID, $dn, $entry);

So if you want to remove all instances of an attribute, you have to do it one by one.
arjanw на bigfoot точка com
yasuo_ohgaki at hotmail dot com
To remove all instances of an attribute you can use ldap_modify with an empty value for that attribute.

$entry["mail"] = ""; 
$result = ldap_modify($connID, $dn, $entry);
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.