라이브러리

[PHP] ldap_exop - 확장된 작업을 수행합니다.




LDAP Exop (LDAP 확장 연산)

LDAP (Lightweight Directory Access Protocol) Exop은 LDAP의 확장 연산입니다. LDAP Exop은 LDAP의 기본 연산 외에 추가적인 연산을 제공하여 LDAP의 기능을 확장합니다.

LDAP Exop의 종류

LDAP Exop에는 다음과 같은 종류가 있습니다.

* Search: LDAP Exop의 Search 연산은 LDAP의 기본 Search 연산 외에 추가적인 검색 옵션을 제공합니다.
* Compare: LDAP Exop의 Compare 연산은 LDAP의 기본 Compare 연산 외에 추가적인 비교 옵션을 제공합니다.
* Modify: LDAP Exop의 Modify 연산은 LDAP의 기본 Modify 연산 외에 추가적인 수정 옵션을 제공합니다.
* Add: LDAP Exop의 Add 연산은 LDAP의 기본 Add 연산 외에 추가적인 추가 옵션을 제공합니다.
* Delete: LDAP Exop의 Delete 연산은 LDAP의 기본 Delete 연산 외에 추가적인 삭제 옵션을 제공합니다.

PHP에서 LDAP Exop 사용하기

PHP에서 LDAP Exop을 사용하려면 `ldap_exop` 함수를 사용합니다. 이 함수는 LDAP Exop의 연산을 수행하는 데 사용됩니다.

#hostingforum.kr
php

// LDAP 서버의 호스트 이름과 포트 번호를 설정합니다.

$host = 'ldap.example.com';

$port = 389;



// LDAP 서버에 연결합니다.

$ldap = ldap_connect($host, $port);



// LDAP Exop의 Search 연산을 수행합니다.

$search = ldap_exop($ldap, LDAP_EXOP_SEARCH, array(

    'base' => 'dc=example,dc=com',

    'filter' => '(objectClass=*)',

    'attributes' => array('cn', 'sn')

));



// LDAP Exop의 Search 연산의 결과를 출력합니다.

print_r($search);



// LDAP Exop의 Compare 연산을 수행합니다.

$compare = ldap_exop($ldap, LDAP_EXOP_COMPARE, array(

    'base' => 'dc=example,dc=com',

    'filter' => '(cn=John Doe)',

    'attribute' => 'sn'

));



// LDAP Exop의 Compare 연산의 결과를 출력합니다.

print_r($compare);



// LDAP Exop의 Modify 연산을 수행합니다.

$modify = ldap_exop($ldap, LDAP_EXOP_MODIFY, array(

    'base' => 'dc=example,dc=com',

    'filter' => '(cn=John Doe)',

    'attributes' => array('sn' => 'Doe')

));



// LDAP Exop의 Modify 연산의 결과를 출력합니다.

print_r($modify);



LDAP Exop의 예제

LDAP Exop의 예제는 다음과 같습니다.

* Search 연산: LDAP Exop의 Search 연산을 사용하여 LDAP 서버의 특정 항목을 검색할 수 있습니다.
#hostingforum.kr
php

$ldap = ldap_connect('ldap.example.com', 389);

$search = ldap_exop($ldap, LDAP_EXOP_SEARCH, array(

    'base' => 'dc=example,dc=com',

    'filter' => '(objectClass=*)',

    'attributes' => array('cn', 'sn')

));

print_r($search);



* Compare 연산: LDAP Exop의 Compare 연산을 사용하여 LDAP 서버의 특정 항목의 특성을 비교할 수 있습니다.
#hostingforum.kr
php

$ldap = ldap_connect('ldap.example.com', 389);

$compare = ldap_exop($ldap, LDAP_EXOP_COMPARE, array(

    'base' => 'dc=example,dc=com',

    'filter' => '(cn=John Doe)',

    'attribute' => 'sn'

));

print_r($compare);



* Modify 연산: LDAP Exop의 Modify 연산을 사용하여 LDAP 서버의 특정 항목의 특성을 수정할 수 있습니다.
#hostingforum.kr
php

$ldap = ldap_connect('ldap.example.com', 389);

$modify = ldap_exop($ldap, LDAP_EXOP_MODIFY, array(

    'base' => 'dc=example,dc=com',

    'filter' => '(cn=John Doe)',

    'attributes' => array('sn' => 'Doe')

));

print_r($modify);



LDAP Exop의 참고 자료

LDAP Exop에 대한 더 많은 정보는 다음 참고 자료를 참조하십시오.

* [LDAP Exop](https://www.openldap.org/doc/admin24/ldapexop.html)
* [LDAP Exop in PHP](https://www.php.net/manual/en/function.ldap-exop.php)

이 문서는 LDAP Exop의 기본적인 개념과 PHP에서 LDAP Exop을 사용하는 방법을 설명합니다. LDAP Exop은 LDAP의 기능을 확장하는 데 사용할 수 있는 유용한 도구입니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 10,077건 / 432 페이지

검색

게시물 검색