| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193 |
- <?xml version="1.0" encoding="utf-8"?>
- <!-- Reviewed: no -->
- <sect1 id="zend.ldap.api">
- <title>API overview</title>
- <sect2 id="zend.ldap.api.configuration">
- <title>Configuration / options</title>
- <para>
- The <code>Zend_Ldap</code> component accepts an array of options either supplied
- to the constructor or through the <code>setOptions()</code> method. The permitted
- options are as follows:
- </para>
- <table id="zend.ldap.api.configuration.table">
- <title>Zend_Ldap Options</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>host</entry>
- <entry>
- The default hostname of LDAP server if not supplied to
- <code>connect()</code> (also may be used when trying to canonicalize
- usernames in <code>bind()</code>).
- </entry>
- </row>
- <row>
- <entry>port</entry>
- <entry>
- Default port of LDAP server if not supplied to
- <code>connect()</code>.
- </entry>
- </row>
- <row>
- <entry>useStartTls</entry>
- <entry>
- Whether or not the LDAP client should use TLS (aka SSLv2)
- encrypted transport. A value of <code>true</code> is strongly favored
- in production environments to prevent passwords from be transmitted in
- clear text. The default value is <code>false</code>, as servers
- frequently require that a certificate be installed separately after
- installation. The <code>useSsl</code> and <code>useStartTls</code>
- options are mutually exclusive. The <code>useStartTls</code> option
- should be favored over <code>useSsl</code> but not all servers support
- this newer mechanism.
- </entry>
- </row>
- <row>
- <entry>useSsl</entry>
- <entry>
- Whether or not the LDAP client should use SSL encrypted
- transport. The <code>useSsl</code> and <code>useStartTls</code> options
- are mutually exclusive.
- </entry>
- </row>
- <row>
- <entry>username</entry>
- <entry>
- The default credentials username. Some servers require that this
- be in DN form. This must be given in DN form if the LDAP server
- requires a DN to bind and binding should be possible with simple
- usernames.
- </entry>
- </row>
- <row>
- <entry>password</entry>
- <entry>
- The default credentials password (used only with username
- above).
- </entry>
- </row>
- <row>
- <entry>bindRequiresDn</entry>
- <entry>
- If <code>true</code>, this instructs <code>Zend_Ldap</code> to
- retrieve the DN for the account used to bind if the username is not
- already in DN form. The default value is <code>false</code>.
- </entry>
- </row>
- <row>
- <entry>baseDn</entry>
- <entry>
- The default base DN used for searching (e.g., for accounts).
- This option is required for most account related operations and should
- indicate the DN under which accounts are located.
- </entry>
- </row>
- <row>
- <entry>accountCanonicalForm</entry>
- <entry>
- A small integer indicating the form to which account names
- should be canonicalized. See the <link
- linkend="zend.ldap.introduction.theory-of-operations.account-name-canonicalization"> <emphasis>Account Name Canonicalization</emphasis></link>
- section below.
- </entry>
- </row>
- <row>
- <entry>accountDomainName</entry>
- <entry>
- The FQDN domain for which the target LDAP server is an authority
- (e.g., example.com).
- </entry>
- </row>
- <row>
- <entry>accountDomainNameShort</entry>
- <entry>
- The 'short' domain for which the target LDAP server is an
- authority. This is usually used to specify the NetBIOS domain name for
- Windows networks but may also be used by non-AD servers.
- </entry>
- </row>
- <row>
- <entry>accountFilterFormat</entry>
- <entry>
- The LDAP search filter used to search for accounts. This string
- is a <ulink url="http://php.net/sprintf"><code>sprintf()</code></ulink>
- style expression that must contain one '<code>%s</code>' to accommodate
- the username. The default value is
- '<code>(&(objectClass=user)(sAMAccountName=%s))</code>' unless
- <code>bindRequiresDn</code> is set to <code>true</code>, in which case
- the default is
- '<code>(&(objectClass=posixAccount)(uid=%s))</code>'. Users of
- custom schemas may need to change this option.
- </entry>
- </row>
- <row>
- <entry>allowEmptyPassword</entry>
- <entry>
- Some LDAP servers can be configured to accept an empty string
- password as an anonymous bind. This behavior is almost always
- undesirable. For this reason, empty passwords are explicitly
- disallowed. Set this value to <code>true</code> to allow an empty
- string password to be submitted during the bind.
- </entry>
- </row>
- <row>
- <entry>optReferrals</entry>
- <entry>
- If set to <code>true</code>, this option indicates to the LDAP
- client that referrals should be followed. The default value is
- <code>false</code>.
- </entry>
- </row>
- <row>
- <entry>tryUsernameSplit</entry>
- <entry>
- If set to <code>false</code>, this option indicates that the
- given username should not be split at the first <code>@</code> or
- <code>\</code> character to seperate the username from the domain
- during the binding-procedure. This allows the user to use usernames
- that contain an <code>@</code> or <code>\</code> character that do not
- inherit some domain-information, e.g. using email-addresses for
- binding. The default value is <code>true</code>.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect2>
- <sect2 id="zend.ldap.api.reference">
- <title>API Reference</title>
- <note>
- <para>Method names in <emphasis>italics</emphasis> are static methods.</para>
- </note>
- <sect3 id="zend.ldap.api.reference.zend-ldap">
- <title>Zend_Ldap</title>
- <para>
- <code>Zend_Ldap</code> is the base interface into a LDAP server. It provides
- connection and binding methods as well as methods to operate on the LDAP
- tree.
- </para>
- <table id="zend.ldap.api.reference.zend-ldap.table">
- <title>Zend_Ldap API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <emphasis> <code>string filterEscape(string $str)</code>
- </emphasis>
- </entry>
- <entry>
- Escapes a value to be used in a LDAP filter according to RFC
- 2254. This method is <emphasis>deprecated</emphasis>, please use
- <code>Zend_Ldap_Filter_Abstract::escapeValue()</code>
- instead.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>boolean explodeDn($dn, array &$keys =
- null, array &$vals = null)</code> </emphasis>
- </entry>
- <entry>
- Checks if a given DN <code>$dn</code> is malformed. If
- <code>$keys</code> or <code>$keys</code> and <code>$vals</code> are
- given, these arrays will be filled with the appropriate DN keys and
- values. This method is <emphasis>deprecated</emphasis>, please use
- <code>Zend_Ldap_Dn::checkDn()</code> instead.
- </entry>
- </row>
- <row>
- <entry><code>__construct($options)</code></entry>
- <entry>
- Constructor. The <code>$options</code> parameter is optional
- and can be set to an array or a <code>Zend_Config</code> instance.
- If no options are provided at instantiation, the connection
- parameters must be passed to the instance using
- <code>Zend_Ldap::setOptions()</code>. The allowed options are
- specified in <link
- linkend="zend.ldap.using.theory-of-operation.options.table">Zend_Ldap
- Options</link>
- </entry>
- </row>
- <row>
- <entry><code>resource getResource()</code></entry>
- <entry>Returns the raw LDAP extension (ext/ldap) resource.</entry>
- </row>
- <row>
- <entry><code>integer getLastErrorCode()</code></entry>
- <entry>
- Returns the LDAP error number of the last LDAP
- command.
- </entry>
- </row>
- <row>
- <entry>
- <code>string getLastError(integer &$errorCode, array
- &$errorMessages)</code>
- </entry>
- <entry>
- Returns the LDAP error message of the last LDAP command. The
- optional <code>$errorCode</code> parameter is set to the LDAP error
- number when given. The optional <code>$errorMessages</code> array
- will be filled with the raw error messages when given. The various
- LDAP error retrieval functions can return different things, so they
- are all collected if <code>$errorMessages</code> is given.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap setOptions($options)</code></entry>
- <entry>
- Sets the LDAP connection and binding parameters.
- <code>$options</code> can be an array or an instance of
- <code>Zend_Config</code>. The allowed options are specified in
- <link
- linkend="zend.ldap.using.theory-of-operation.options.table">Zend_Ldap Options</link>
- </entry>
- </row>
- <row>
- <entry><code>array getOptions()</code></entry>
- <entry>
- Returns the current connection and binding
- parameters.
- </entry>
- </row>
- <row>
- <entry><code>string getBaseDn()</code></entry>
- <entry>
- Returns the base DN this LDAP connection is bound
- to.
- </entry>
- </row>
- <row>
- <entry>
- <code>string getCanonicalAccountName(string $acctname,
- integer $form)</code>
- </entry>
- <entry>
- Returns the canonical account name of the given account name
- <code>$acctname</code>. <code>$form</code> specifies the <link
- linkend="zend.ldap.using.theory-of-operation.account-name-canonicalization.table">format</link>
- into which the account name is canonicalized. See <link
- linkend="zend.ldap.introduction.theory-of-operations.account-name-canonicalization">Account Name Canonicalization</link>
- for more details.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap disconnect()</code></entry>
- <entry>
- Disconnects the Zend_Ldap instance from the LDAP
- server.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap connect(string $host, integer $port, boolean
- $useSsl, boolean $useStartTls)</code>
- </entry>
- <entry>
- Connects the Zend_Ldap instance to the given LDAP server.
- All parameters are optional and will be taken from the LDAP
- connection and binding parameters passed to the instance via the
- construtor or via <code>Zend_Ldap::setOptions()</code> when set to
- <code>null</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap bind(string $username, string
- $password)</code>
- </entry>
- <entry>
- Authenticates <code>$username</code> with
- <code>$password</code> at the LDAP server. If both paramaters are
- omitted the binding will be carried out with the credentials given
- in the connection and binding parameters. If no credentials are
- given in the connection and binding parameters an anonymous bind
- will be performed. Note that this requires anonymous binds to be
- allowed on the LDAP server. An empty string <code>''</code> can be
- passed as <code>$password</code> together with a username if, and
- only if, <code>allowEmptyPassword</code> is set to
- <code>true</code> in the connection and binding parameters.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Collection
- search(string|Zend_Ldap_Filter_Abstract $filter,
- string|Zend_Ldap_Dn $basedn, integer $scope, array $attributes,
- string $sort, string $collectionClass)</code>
- </entry>
- <entry>
- Searches the LDAP tree with the given <code>$filter</code>
- and the given search parameters.
- <variablelist>
- <varlistentry>
- <term><code>string|Zend_Ldap_Filter_Abstract
- $filter</code></term>
- <listitem>The filter string to be used in the search, e.g.
- <code>(objectClass=posixAccount)</code>.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>string|Zend_Ldap_Dn $basedn</code></term>
- <listitem>The search base for the search. If omitted or
- <code>null</code>, the <code>baseDn</code> from the
- connection and binding parameters is used.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>integer $scope</code></term>
- <listitem>The search scope.
- <code>Zend_Ldap::SEARCH_SCOPE_SUB</code> searches the
- complete subtree including the <code>$baseDn</code> node.
- <code>Zend_Ldap::SEARCH_SCOPE_ONE</code> restricts search
- to one level below <code>$baseDn</code>.
- <code>Zend_Ldap::SEARCH_SCOPE_BASE</code> restricts search
- to the <code>$baseDn</code> itself; this can be used to
- efficiently retrieve a single entry by its DN. The default
- value is
- <code>Zend_Ldap::SEARCH_SCOPE_SUB</code>.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>array $attributes</code></term>
- <listitem>Specifies the attributes contained in the
- returned entries. To include all possible attributes (ACL
- restrictions can disallow certain attribute to be retrieved
- by a given user) pass either an empty array
- <code>array()</code> or <code>array('*')</code> to the
- method. On some LDAP servers you can retrieve special
- internal attributes by passing <code>array('*', '+')</code>
- to the method.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>string $sort</code></term>
- <listitem>If given the result collection will be sorted
- after the attribute <code>$sort</code>. Results can only be
- sorted after one single attribute as this parameter uses
- the ext/ldap function <code>ldap_sort()</code>.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>string $collectionClass</code></term>
- <listitem>If given the result will be wrapped in an object
- of type <code>$collectionClass</code>. By default an object
- of type <code>Zend_Ldap_Collection</code> will be returned.
- The custom class must extend
- <code>Zend_Ldap_Collection</code> and will be passed a
- <code>Zend_Ldap_Collection_Iterator_Default</code> on
- instantiation.</listitem>
- </varlistentry>
- </variablelist>
- </entry>
- </row>
- <row>
- <entry>
- <code>integer count(string|Zend_Ldap_Filter_Abstract
- $filter, string|Zend_Ldap_Dn $basedn, integer
- $scope)</code>
- </entry>
- <entry>
- Counts the elements returned by the given search parameters.
- See <code>Zend_Ldap::search()</code> for a detailed description of
- the method parameters.
- </entry>
- </row>
- <row>
- <entry>
- <code>integer countChildren(string|Zend_Ldap_Dn
- $dn)</code>
- </entry>
- <entry>
- Counts the direct descendants (children) of the entry
- identified by the given <code>$dn</code>.
- </entry>
- </row>
- <row>
- <entry><code>boolean exists(string|Zend_Ldap_Dn $dn)</code></entry>
- <entry>
- Checks whether the entry identified by the given
- <code>$dn</code> exists.
- </entry>
- </row>
- <row>
- <entry>
- <code>array searchEntries(string|Zend_Ldap_Filter_Abstract
- $filter, string|Zend_Ldap_Dn $basedn, integer $scope, array
- $attributes, string $sort)</code>
- </entry>
- <entry>
- Performs a search operation and returns the result as an PHP
- array. This is essentially the same method as
- <code>Zend_Ldap::search()</code> except for the return type. See
- <code>Zend_Ldap::search()</code> for a detailed description of the
- method parameters.
- </entry>
- </row>
- <row>
- <entry>
- <code>array getEntry(string|Zend_Ldap_Dn $dn, array
- $attributes, boolean $throwOnNotFound)</code>
- </entry>
- <entry>
- Retrieves the LDAP entry identified by <code>$dn</code> with
- the attributes specified in <code>$attributes</code>. If
- <code>$attributes</code> is ommitted, all attributes
- (<code>array()</code>) are included in the result.
- <code>$throwOnNotFound</code> is <code>false</code> by default, so
- the method will return <code>null</code> if the specified entry
- cannot be found. If set to <code>true</code>, a
- <code>Zend_Ldap_Exception</code> will be thrown instead.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>void prepareLdapEntryArray(array
- &$entry)</code> </emphasis>
- </entry>
- <entry>
- Prepare an array for the use in LDAP modification
- operations. This method does not need to be called by the end-user
- as it's implicitly called on every data modification
- method.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap add(string|Zend_Ldap_Dn $dn, array
- $entry)</code>
- </entry>
- <entry>
- Adds the entry identified by <code>$dn</code> with its
- attributes <code>$entry</code> to the LDAP tree. Throws a
- <code>Zend_Ldap_Exception</code> if the entry could not be
- added.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap update(string|Zend_Ldap_Dn $dn, array
- $entry)</code>
- </entry>
- <entry>
- Updates the entry identified by <code>$dn</code> with its
- attributes <code>$entry</code> to the LDAP tree. Throws a
- <code>Zend_Ldap_Exception</code> if the entry could not be
- modified.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap save(string|Zend_Ldap_Dn $dn, array
- $entry)</code>
- </entry>
- <entry>
- Saves the entry identified by <code>$dn</code> with its
- attributes <code>$entry</code> to the LDAP tree. Throws a
- <code>Zend_Ldap_Exception</code> if the entry could not be saved.
- This method decides by querying the LDAP tree if the entry will be
- added or updated.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap delete(string|Zend_Ldap_Dn $dn, boolean
- $recursively)</code>
- </entry>
- <entry>
- Deletes the entry identified by <code>$dn</code> from the
- LDAP tree. Throws a <code>Zend_Ldap_Exception</code> if the entry
- could not be deleted. <code>$recursively</code> is
- <code>false</code> by default. If set to <code>true</code> the
- deletion will be carried out recursively and will effectively
- delete a complete subtree. Deletion will fail if
- <code>$recursively</code> is <code>false</code> and the entry
- <code>$dn</code> is not a leaf entry.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap moveToSubtree(string|Zend_Ldap_Dn $from,
- string|Zend_Ldap_Dn $to, boolean $recursively, boolean
- $alwaysEmulate)</code>
- </entry>
- <entry>
- Moves the entry identified by <code>$from</code> to a
- location below <code>$to</code> keeping its RDN unchanged.
- <code>$recursively</code> specifies if the operation will be
- carried out recursively (<code>false</code> by default) so that the
- entry <code>$from</code> and all its descendants will be moved.
- Moving will fail if <code>$recursively</code> is <code>false</code>
- and the entry <code>$from</code> is not a leaf entry.
- <code>$alwaysEmulate</code> controls whether the ext/ldap function
- <code>ldap_rename()</code> should be used if available. This can
- only work for leaf entries and for servers and for ext/ldap
- supporting this function. Set to <code>true</code> to always use an
- emulated rename operation.
- <note>
- <para>All move-operations are carried out by copying and then
- deleting the corresponding entries in the LDAP tree. These
- operations are not <emphasis>atomic</emphasis> so that failures
- during the operation will result in an
- <emphasis>inconsistent</emphasis> state on the LDAP server. The
- same is true for all recursive operations. They also are by no
- means atomic. Please keep this in mind.
- </para>
- </note></entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap move(string|Zend_Ldap_Dn $from,
- string|Zend_Ldap_Dn $to, boolean $recursively, boolean
- $alwaysEmulate)</code>
- </entry>
- <entry>
- This is an alias for
- <code>Zend_Ldap::rename()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap rename(string|Zend_Ldap_Dn $from,
- string|Zend_Ldap_Dn $to, boolean $recursively, boolean
- $alwaysEmulate)</code>
- </entry>
- <entry>
- Renames the entry identified by <code>$from</code> to
- <code>$to</code>. <code>$recursively</code> specifies if the
- operation will be carried out recursively (<code>false</code> by
- default) so that the entry <code>$from</code> and all its
- descendants will be moved. Moving will fail if
- <code>$recursively</code> is <code>false</code> and the entry
- <code>$from</code> is not a leaf entry. <code>$alwaysEmulate</code>
- controls whether the ext/ldap function <code>ldap_rename()</code>
- should be used if available. This can only work for leaf entries
- and for servers and for ext/ldap supporting this function. Set to
- <code>true</code> to always use an emulated rename
- operation.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap copyToSubtree(string|Zend_Ldap_Dn $from,
- string|Zend_Ldap_Dn $to, boolean $recursively)</code>
- </entry>
- <entry>
- Copies the entry identified by <code>$from</code> to a
- location below <code>$to</code> keeping its RDN unchanged.
- <code>$recursively</code> specifies if the operation will be
- carried out recursively (<code>false</code> by default) so that the
- entry <code>$from</code> and all its descendants will be copied.
- Copying will fail if <code>$recursively</code> is
- <code>false</code> and the entry <code>$from</code> is not a leaf
- entry.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap copy(string|Zend_Ldap_Dn $from,
- string|Zend_Ldap_Dn $to, boolean $recursively)</code>
- </entry>
- <entry>
- Copies the entry identified by <code>$from</code> to
- <code>$to</code>. <code>$recursively</code> specifies if the
- operation will be carried out recursively (<code>false</code> by
- default) so that the entry <code>$from</code> and all its
- descendants will be copied. Copying will fail if
- <code>$recursively</code> is <code>false</code> and the entry
- <code>$from</code> is not a leaf entry.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node getNode(string|Zend_Ldap_Dn
- $dn)</code>
- </entry>
- <entry>
- Returns the entry <code>$dn</code> wrapped in a
- <code>Zend_Ldap_Node</code>.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Node getBaseNode()</code></entry>
- <entry>
- Returns the entry for the base DN <code>$baseDn</code>
- wrapped in a <code>Zend_Ldap_Node</code>.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Node_RootDse getRootDse()</code></entry>
- <entry>Returns the RootDSE for the current server.</entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Node_Schema getSchema()</code></entry>
- <entry>Returns the LDAP schema for the current server.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <sect4 id="zend.ldap.api.reference.zend-ldap.zend-ldap-collection">
- <title>Zend_Ldap_Collection</title>
- <para>
- <code>Zend_Ldap_Collection</code> implements <code>Iterator</code> to
- allow for item traversal using <code>foreach()</code> and
- <code>Countable</code> to be able to respond to <code>count()</code>. With its
- protected <code>_createEntry()</code> method it provides a simple extension
- point for developers needing custom result objects.
- </para>
- <table id="zend.ldap.api.reference.zend-collection.table">
- <title>Zend_Ldap_Collection API</title>
- <tgroup cols="2">zend.ldap.api.reference.zend-ldap.zend-ldap-collection
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <code>__construct(Zend_Ldap_Collection_Iterator_Interface
- $iterator)</code>
- </entry>
- <entry>
- Constructor. The constrcutor must be provided by a
- <code>Zend_Ldap_Collection_Iterator_Interface</code> which does the
- real result iteration.
- <code>Zend_Ldap_Collection_Iterator_Default</code> is the default
- implementation for iterating ext/ldap results.
- </entry>
- </row>
- <row>
- <entry><code>boolean close()</code></entry>
- <entry>
- Closes the internal iterator. This is also called in the
- destructor.
- </entry>
- </row>
- <row>
- <entry><code>array toArray()</code></entry>
- <entry>Returns all entries as an array.</entry>
- </row>
- <row>
- <entry><code>array getFirst()</code></entry>
- <entry>
- Returns the first entry in the collection or
- <code>null</code> if the collection is empty.
- </entry>
- </row>
- </tbody></tgroup>
- </table>
- </sect4>
- </sect3>
- <sect3 id="zend.ldap.api.reference.zend-ldap-attribute">
- <title>Zend_Ldap_Attribute</title>
- <para>
- <code>Zend_Ldap_Attribute</code> is a helper class providing only static
- methods to manipulate arrays suitable to the structure used in
- <code>Zend_Ldap</code> data modification methods and to the data format required by
- the LDAP server. PHP data types are converted the following way:
- </para>
- <variablelist>
- <varlistentry>
- <term><code>string</code></term>
- <listitem>No conversion will be done.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>integer</code> and <code>float</code></term>
- <listitem>The value will be converted to a string.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>boolean</code></term>
- <listitem><code>true</code> will be converted to <code>'TRUE'</code> and
- <code>false</code> to <code>'FALSE'</code></listitem>
- </varlistentry>
- <varlistentry>
- <term><code>object</code> and <code>array</code></term>
- <listitem>The value will be converted to a string by using
- <code>serialize()</code>.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>resource</code></term>
- <listitem>If a <code>stream</code> resource is given, the data will be
- fetched by calling <code>stream_get_contents()</code>.</listitem>
- </varlistentry>
- <varlistentry>
- <term>others</term>
- <listitem>All other data types (namely non-stream resources) will be
- ommitted.</listitem>
- </varlistentry>
- </variablelist>
- <para>On reading attribute values the following conversion will take place:</para>
- <variablelist>
- <varlistentry>
- <term><code>'TRUE'</code></term>
- <listitem>Converted to <code>true</code>.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>'FALSE'</code></term>
- <listitem>Converted to <code>false</code>.</listitem>
- </varlistentry>
- <varlistentry>
- <term>others</term>
- <listitem>All other strings won't be automatically converted and are passed
- as they are.</listitem>
- </varlistentry>
- </variablelist>
- <table id="zend.ldap.api.reference.zend-ldap-attribute">
- <title>Zend_Ldap_Attribute API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <emphasis> <code>void setAttribute(array &$data, string
- $attribName, mixed $value, boolean $append)</code>
- </emphasis>
- </entry>
- <entry>
- Sets the attribute <code>$attribName</code> in
- <code>$data</code> to the value <code>$value</code>. If
- <code>$append</code> is <code>true</code> (<code>false</code> by
- default) <code>$value</code> will be appended to the attribute.
- <code>$value</code> can be a scalar value or an array of scalar
- values. Conversion will take place.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>array|mixed getAttribute(array $data,
- string $attribName, integer|null $index)</code> </emphasis>
- </entry>
- <entry>
- Returns the attribute <code>$attribName</code> from
- <code>$data</code>. If <code>$index</code> is <code>null</code>
- (default) an array will be returned containing all the values for
- the given attribute. An empty array will be returned if the
- attribute does not exist in the given array. If an integer index is
- specified the corresponding value at the given index will be
- returned. If the index is out of bounds, <code>null</code> will be
- returned. Conversion will take place.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>boolean attributeHasValue(array &$data,
- string $attribName, mixed|array $value)</code> </emphasis>
- </entry>
- <entry>
- Checks if the attribute <code>$attribName</code> in
- <code>$data</code> has the value(s) given in <code>$value</code>.
- The method returns <code>true</code> only if all values in
- <code>$value</code> are present in the attribute. Comparison is
- done strictly (respecting the data type).
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>void removeDuplicatesFromAttribute(array
- &$data, string $attribName)</code> </emphasis>
- </entry>
- <entry>
- Removes all duplicates from the attribute
- <code>$attribName</code> in <code>$data</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>void removeFromAttribute(array &$data,
- string $attribName, mixed|array $value)</code> </emphasis>
- </entry>
- <entry>
- Removes the the value(s) given in <code>$value</code> from
- the attribute <code>$attribName</code> in
- <code>$data</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string|null convertToLdapValue(mixed
- $value)</code> </emphasis>
- </entry>
- <entry>
- Converts a PHP data type into its LDAP representation. See
- introduction for details.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>mixed convertFromLdapValue(string
- $value)</code> </emphasis>
- </entry>
- <entry>
- Converts an LDAP value into its PHP data type. See
- introduction for details.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string|null
- convertToLdapDateTimeValue(integer $value, boolean $utc)</code>
- </emphasis>
- </entry>
- <entry>
- Converts a timestamp into its LDAP date/time representation.
- If <code>$utc</code> is <code>true</code> (<code>false</code> by
- default) the resulting LDAP date/time string will be in UTC,
- otherwise a local date/time string will be returned.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>integer|null
- convertFromLdapDateTimeValue(string $value)</code>
- </emphasis>
- </entry>
- <entry>
- Converts LDAP date/time representation into a timestamp. The
- method returns <code>null</code> if <code>$value</code> can not be
- converted back into a PHP timestamp.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>void setPassword(array &$data, string
- $password, string $hashType, string $attribName)</code>
- </emphasis>
- </entry>
- <entry>
- Sets a LDAP password for the the attribute
- <code>$attribName</code> in <code>$data</code>.
- <code>$attribName</code> defaults to <code>'userPassword'</code>
- which is the standard password attribute. The password hash can be
- specified with <code>$hashType</code>. The default value here is
- <code>Zend_Ldap_Attribute::PASSWORD_HASH_MD5</code> with
- <code>Zend_Ldap_Attribute::PASSWORD_HASH_SHA</code> as the other
- possibilty.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string createPassword(string $password,
- string $hashType)</code> </emphasis>
- </entry>
- <entry>
- Creates a LDAP password. The password hash can be specified
- with <code>$hashType</code>. The default value here is
- <code>Zend_Ldap_Attribute::PASSWORD_HASH_MD5</code> with
- <code>Zend_Ldap_Attribute::PASSWORD_HASH_SHA</code> as the other
- possibilty.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>void setDateTimeAttribute(array &$data,
- string $attribName, integer|array $value, boolean $utc, boolean
- $append)</code> </emphasis>
- </entry>
- <entry>
- Sets the attribute <code>$attribName</code> in
- <code>$data</code> to the date/time value <code>$value</code>. If
- <code>$append</code> is <code>true</code> (<code>false</code> by
- default) <code>$value</code> will be appended to the attribute.
- <code>$value</code> can be an integer value or an array of
- integers. Date-time-conversion according to
- <code>Zend_Ldap_Attribute::convertToLdapDateTimeValue()</code> will
- take place.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>array|integer getDateTimeAttribute(array
- $data, string $attribName, integer|null $index)</code>
- </emphasis>
- </entry>
- <entry>
- Returns the date/time attribute <code>$attribName</code>
- from <code>$data</code>. If <code>$index</code> is
- <code>null</code> (default) an array will be returned containing
- all the date/time values for the given attribute. An empty array
- will be returned if the attribute does not exist in the given
- array. If an integer index is specified the corresponding date/time
- value at the given index will be returned. If the index is out of
- bounds, <code>null</code> will be returned. Date-time-conversion
- according to
- <code>Zend_Ldap_Attribute::convertFromLdapDateTimeValue()</code>
- will take place.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect3>
- <sect3 id="zend.ldap.api.reference.zend-ldap-dn">
- <title>Zend_Ldap_Dn</title>
- <para>
- <code>Zend_Ldap_Dn</code> provides an object-oriented interface to
- manipulating LDAP distinguished names (DN). The parameter <code>$caseFold</code>
- that is used in several methods determines the way DN attributes are handled
- regarding their case. Allowed values for this paraneter are:
- </para>
- <variablelist>
- <varlistentry>
- <term><code>Zend_Ldap_Dn::ATTR_CASEFOLD_NONE</code></term>
- <listitem>No case-folding will be done.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>Zend_Ldap_Dn::ATTR_CASEFOLD_UPPER</code></term>
- <listitem>All attributes will be converted to upper-case.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER</code></term>
- <listitem>All attributes will be converted to lower-case.</listitem>
- </varlistentry>
- </variablelist>
- <para>
- The default case-folding is <code>Zend_Ldap_Dn::ATTR_CASEFOLD_NONE</code> and
- can be set with <code>Zend_Ldap_Dn::setDefaultCaseFold()</code>. Each instance of
- <code>Zend_Ldap_Dn</code> can have its own case-folding-setting. If the
- <code>$caseFold</code> parameter is ommitted in method-calls it defaults to the
- instance's case-folding setting.
- </para>
- <para>
- The class implements <code>ArrayAccess</code> to allow indexer-access to the
- different parts of the DN. The <code>ArrayAccess</code>-methods proxy to
- <code>Zend_Ldap_Dn::get($offset, 1, null)</code> for <code>offsetGet(integer
- $offset)</code>, to <code>Zend_Ldap_Dn::set($offset, $value)</code> for
- <code>offsetSet()</code> and to <code>Zend_Ldap_Dn::remove($offset, 1)</code> for
- <code>offsetUnset()</code>. <code>offsetExists()</code> simply checks if the index
- is within the bounds.
- </para>
- <table id="zend.ldap.api.reference.zend-ldap-dn">
- <title>Zend_Ldap_Dn API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Dn factory(string|array $dn,
- string|null $caseFold)</code> </emphasis>
- </entry>
- <entry>
- Creates a <code>Zend_Ldap_Dn</code> instance from an array
- or a string. The array must conform to the array structure detailed
- under <code>Zend_Ldap_Dn::implodeDn()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Dn fromString(string $dn,
- string|null $caseFold)</code> </emphasis>
- </entry>
- <entry>
- Creates a <code>Zend_Ldap_Dn</code> instance from a
- string.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Dn fromArray(array $dn,
- string|null $caseFold)</code> </emphasis>
- </entry>
- <entry>
- Creates a <code>Zend_Ldap_Dn</code> instance from an array.
- The array must conform to the array structure detailed under
- <code>Zend_Ldap_Dn::implodeDn()</code>.
- </entry>
- </row>
- <row>
- <entry><code>array getRdn(string|null $caseFold)</code></entry>
- <entry>
- Gets the RDN of the current DN. The return value is an array
- with the RDN attribute names its keys and the RDN attribute
- values.
- </entry>
- </row>
- <row>
- <entry>
- <code>string getRdnString(string|null
- $caseFold)</code>
- </entry>
- <entry>
- Gets the RDN of the current DN. The return value is a
- string.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Dn getParentDn(integer
- $levelUp)</code>
- </entry>
- <entry>
- Gets the DN of the current DN's ancestor
- <code>$levelUp</code> levels up the tree. <code>$levelUp</code>
- defaults to <code>1</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array get(integer $index, integer $length, string|null
- $caseFold)</code>
- </entry>
- <entry>
- Returns a slice of the current DN determined by
- <code>$index</code> and <code>$length</code>. <code>$index</code>
- starts with <code>0</code> on the DN part from the left.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Dn set(integer $index, array
- $value)</code>
- </entry>
- <entry>
- Replaces a DN part in the current DN. This operation
- manipulates the current instance.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Dn remove(integer $index, integer
- $length)</code>
- </entry>
- <entry>
- Removes a DN part from the current DN. This operation
- manipulates the current instance. <code>$length</code> defaults to
- <code>1</code>
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Dn append(array $value)</code></entry>
- <entry>
- Appends a DN part to the current DN. This operation
- manipulates the current instance.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Dn prepend(array $value)</code></entry>
- <entry>
- Prepends a DN part to the current DN. This operation
- manipulates the current instance.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Dn insert(integer $index, array
- $value)</code>
- </entry>
- <entry>
- Inserts a DN part after the index <code>$index</code> to the
- current DN. This operation manipulates the current
- instance.
- </entry>
- </row>
- <row>
- <entry><code>void setCaseFold(string|null $caseFold)</code></entry>
- <entry>
- Sets the case-folding option to the current DN instance. If
- <code>$caseFold</code> is null the default case-folding setting
- (<code>Zend_Ldap_Dn::ATTR_CASEFOLD_NONE</code> by default or set
- via <code>Zend_Ldap_Dn::setDefaultCaseFold()</code> will be set for
- the current instance.
- </entry>
- </row>
- <row>
- <entry><code>string toString(string|null $caseFold)</code></entry>
- <entry>Returns DN as a string.</entry>
- </row>
- <row>
- <entry><code>array toArray(string|null $caseFold)</code></entry>
- <entry>Returns DN as an array.</entry>
- </row>
- <row>
- <entry><code>string __toString()</code></entry>
- <entry>
- Returns DN as a string - proxies to
- <code>Zend_Ldap_Dn::toString(null)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>void setDefaultCaseFold(string
- $caseFold)</code> </emphasis>
- </entry>
- <entry>
- Sets the default case-folding option used by all instances
- on creation by default. Already existing instances are not affected
- by this setting.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>array escapeValue(string|array
- $values)</code> </emphasis>
- </entry>
- <entry>Escapes a DN value according to RFC 2253.</entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>array unescapeValue(string|array
- $values)</code> </emphasis>
- </entry>
- <entry>
- Undoes the conversion done by
- <code>Zend_Ldap_Dn::escapeValue()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>array explodeDn(string $dn, array
- &$keys, array &$vals, string|null $caseFold)</code>
- </emphasis>
- </entry>
- <entry>
- Explodes the DN <code>$dn</code> into an array containing
- all parts of the given DN. <code>$keys</code> optinally receive DN
- keys (e.g. CN, OU, DC, ...). <code>$vals</code> optionally receive
- DN values. The resulting array will be of type
- <programlisting role="php"><![CDATA[
- array(
- array("cn" => "name1", "uid" => "user"),
- array("cn" => "name2"),
- array("dc" => "example"),
- array("dc" => "org")
- )
- ]]></programlisting>for a DN of <code>cn=name1+uid=user,cn=name2,dc=example,dc=org</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>boolean checkDn(string $dn, array
- &$keys, array &$vals, string|null $caseFold)</code>
- </emphasis>
- </entry>
- <entry>
- Checks if a given DN <code>$dn</code> is malformed. If
- <code>$keys</code> or <code>$keys</code> and <code>$vals</code> are
- given, these arrays will be filled with the appropriate DN keys and
- values.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string implodeRdn(array $part, string|null
- $caseFold)</code> </emphasis>
- </entry>
- <entry>
- Returns a DN part in the form
- <code>$attribute=$value</code>
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string implodeDn(array $dnArray,
- string|null $caseFold, string $separator)</code>
- </emphasis>
- </entry>
- <entry>
- Implodes an array in the form delivered by
- <code>Zend_Ldap_Dn::explodeDn()</code> to a DN string.
- <code>$separator</code> defaults to <code>','</code> but some LDAP
- servers also understand <code>';'</code>. <code>$dnArray</code>
- must of type
- <programlisting role="php"><![CDATA[
- array(
- array("cn" => "name1", "uid" => "user"),
- array("cn" => "name2"),
- array("dc" => "example"),
- array("dc" => "org")
- )
- ]]></programlisting>
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>boolean isChildOf(string|Zend_Ldap_Dn
- $childDn, string|Zend_Ldap_Dn $parentDn)</code> </emphasis>
- </entry>
- <entry>
- Checks if given <code>$childDn</code> is beneath
- <code>$parentDn</code> subtree.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect3>
- <sect3 id="zend.ldap.api.reference.zend-ldap-filter">
- <title>Zend_Ldap_Filter</title>
- <table id="zend.ldap.api.reference.zend-filter.table">
- <title>Zend_Ldap_Filter API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter equals(string $attr,
- string $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'equals' filter:
- <code>(attr=value)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter begins(string $attr,
- string $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'begins with' filter:
- <code>(attr=value*)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter ends(string $attr, string
- $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'ends with' filter:
- <code>(attr=*value)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter contains(string $attr,
- string $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'contains' filter:
- <code>(attr=*value*)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter greater(string $attr,
- string $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'greater' filter:
- <code>(attr>value)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter greaterOrEqual(string
- $attr, string $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'greater or equal' filter:
- <code>(attr>=value)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter less(string $attr, string
- $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'less' filter:
- <code>(attr<value)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter lessOrEqual(string $attr,
- string $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'less or equal' filter:
- <code>(attr<=value)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter approx(string $attr,
- string $value)</code> </emphasis>
- </entry>
- <entry>
- Creates an 'approx' filter:
- <code>(attr~=value)</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter any(string $attr)</code>
- </emphasis>
- </entry>
- <entry>Creates an 'any' filter: <code>(attr=*)</code>.</entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter string(string
- $filter)</code> </emphasis>
- </entry>
- <entry>
- Creates a simple custom string filter. The user is
- responsible for all value-escaping as the filter is used as
- is.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter mask(string $mask, string
- $value,...)</code> </emphasis>
- </entry>
- <entry>
- Creates a filter from a string mask. All <code>$value</code>
- parameters will be escaped and substituted into <code>$mask</code>
- by using
- <ulink url="http://php.net/sprintf">
- <code>sprintf()</code></ulink>
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter
- andFilter(Zend_Ldap_Filter_Abstract $filter,...)</code>
- </emphasis>
- </entry>
- <entry>Creates an 'and' filter from all arguments given.</entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Filter
- orFilter(Zend_Ldap_Filter_Abstract $filter,...)</code>
- </emphasis>
- </entry>
- <entry>Creates an 'or' filter from all arguments given.</entry>
- </row>
- <row>
- <entry>
- <code>__construct(string $attr, string $value, string
- $filtertype, string|null $prepend, string|null
- $append)</code>
- </entry>
- <entry>
- Constructor. Creates an arbitrary filter according to the
- parameters supplied. The resulting filter will be a concatenation
- <code>$attr . $filtertype . $prepend . $value . $append</code>.
- Normally this constructor is not needed as all filters can be
- created by using the apprpriate factory methods.
- </entry>
- </row>
- <row>
- <entry><code>string toString()</code></entry>
- <entry>Returns a string representation of the filter.</entry>
- </row>
- <row>
- <entry><code>string __toString()</code></entry>
- <entry>
- Returns a string representation of the filter. Proxies to
- <code>Zend_Ldap_Filter::toString()</code>.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Filter_Abstract negate()</code></entry>
- <entry>Negates the current filter.</entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Filter_Abstract
- addAnd(Zend_Ldap_Filter_Abstract $filter,...)</code>
- </entry>
- <entry>
- Creates an 'and' filter from the current filter and all
- filters passed in as the arguments.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Filter_Abstract
- addOr(Zend_Ldap_Filter_Abstract $filter,...)</code>
- </entry>
- <entry>
- Creates an 'or' filter from the current filter and all
- filters passed in as the arguments.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string|array escapeValue(string|array
- $values)</code> </emphasis>
- </entry>
- <entry>
- Escapes the given <code>$values</code> according to RFC 2254
- so that they can be safely used in LDAP filters. If a single string
- is given, a string is returned - otherwise an array is returned.
- Any control characters with an ACII code < 32 as well as the
- characters with special meaning in LDAP filters "*", "(", ")", and
- "\" (the backslash) are converted into the representation of a
- backslash followed by two hex digits representing the hexadecimal
- value of the character.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string|array unescapeValue(string|array
- $values)</code> </emphasis>
- </entry>
- <entry>
- Undoes the conversion done by
- <code>Zend_Ldap_Filter::escapeValue()</code>. Converts any
- sequences of a backslash followed by two hex digits into the
- corresponding character.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect3>
- <sect3 id="zend.ldap.api.reference.zend-ldap-node">
- <title>Zend_Ldap_Node</title>
- <para>
- <code>Zend_Ldap_Node</code> includes the magic propery accessors
- <code>__set()</code>, <code>__get()</code>, <code>__unset()</code> and
- <code>__isset()</code> to access the attributes by their name. They proxy to
- <code>Zend_Ldap_Node::setAttribute()</code>,
- <code>Zend_Ldap_Node::getAttribute()</code>,
- <code>Zend_Ldap_Node::deleteAttribute()</code> and
- <code>Zend_Ldap_Node::existsAttribute()</code> respectively. Furthermore the class
- implements <code>ArrayAccess</code> for array-style-access to the attributes.
- <code>Zend_Ldap_Node</code> also implements <code>Iterator</code> and
- <code>RecursiveIterato</code> to allow for recursive tree-traversal.
- </para>
- <table id="zend.ldap.api.reference.zend-ldap-node.table">
- <title>Zend_Ldap_Node API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>Zend_Ldap getLdap()</code></entry>
- <entry>
- Returns the current LDAP connection. Throws
- <code>Zend_Ldap_Exception</code> if current node is in detached
- mode (not connected to a <code>Zend_Ldap</code> instance).
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node attachLdap(Zend_Ldap
- $ldap)</code>
- </entry>
- <entry>
- Attach the current node to the <code>$ldap</code>
- <code>Zend_Ldap</code> instance. Throws
- <code>Zend_Ldap_Exception</code> if <code>$ldap</code> is not
- responsible for the current node (node is not a child of the
- <code>$ldap</code> base DN).
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Node detachLdap()</code></entry>
- <entry>Detach node from LDAP connection.</entry>
- </row>
- <row>
- <entry><code>boolean isAttached()</code></entry>
- <entry>
- Checks if the current node is attached to a LDAP
- connection.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Node
- create(string|array|Zend_Ldap_Dn $dn, array $objectClass)</code>
- </emphasis>
- </entry>
- <entry>
- Factory method to create a new detached
- <code>Zend_Ldap_Node</code> for a given DN. Creates a new
- <code>Zend_Ldap_Node</code> with the DN <code>$dn</code> and the
- object-classes <code>$objectClass</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Node
- fromLdap(string|array|Zend_Ldap_Dn $dn, Zend_Ldap $ldap)</code>
- </emphasis>
- </entry>
- <entry>
- Factory method to create an attached
- <code>Zend_Ldap_Node</code> for a given DN. Loads an existing
- <code>Zend_Ldap_Node</code> with the DN <code>$dn</code> from the
- LDAP connection <code>$ldap</code>.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Node fromArray((array $data,
- boolean $fromDataSource)</code> </emphasis>
- </entry>
- <entry>
- Factory method to create a detached
- <code>Zend_Ldap_Node</code> from array data <code>$data</code>. If
- <code>$fromDataSource</code> is <code>true</code>
- (<code>false</code> by default), the data is treated as beeing
- present in a LDAP tree.
- </entry>
- </row>
- <row>
- <entry><code>boolean isNew()</code></entry>
- <entry>
- Tells if the node is consiedered as new (not present on the
- server). Please note, that this doesn't tell if the node is really
- present on the server. Use <code>Zend_Ldap_Node::exists()</code> to
- see if a node is already there.
- </entry>
- </row>
- <row>
- <entry><code>boolean willBeDeleted()</code></entry>
- <entry>
- Tells if this node is going to be deleted once
- <code>Zend_Ldap_Node::update()</code> is called.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Node delete()</code></entry>
- <entry>
- Marks this node as to be deleted. Node will be deleted on
- calling <code>Zend_Ldap_Node::update()</code> if
- <code>Zend_Ldap_Node::willBeDeleted()</code> is true.
- </entry>
- </row>
- <row>
- <entry><code>boolean willBeMoved()</code></entry>
- <entry>
- Tells if this node is going to be moved once
- <code>Zend_Ldap_Node::update()</code> is called.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Node update(Zend_Ldap $ldap)</code></entry>
- <entry>
- Sends all pending changes to the LDAP server. If
- <code>$ldap</code> is omitted the current LDAP connection is used.
- If the current node is detached from a LDAP connection a
- <code>Zend_Ldap_Exception</code> will be thrown. If
- <code>$ldap</code> is provided the current node will be attached to
- the given LDAP connection.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Dn getCurrentDn()</code></entry>
- <entry>
- Gets the current DN of the current node as a Zend_Ldap_Dn.
- This does not reflect possible rename-operations.
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Dn getDn()</code></entry>
- <entry>
- Gets the original DN of the current node as a Zend_Ldap_Dn.
- This reflects possible rename-operations.
- </entry>
- </row>
- <row>
- <entry><code>string getDnString(string $caseFold)</code></entry>
- <entry>
- Gets the original DN of the current node as a string. This
- reflects possible rename-operations.
- </entry>
- </row>
- <row>
- <entry><code>array getDnArray(string $caseFold)</code></entry>
- <entry>
- Gets the original DN of the current node as an array. This
- reflects possible rename-operations.
- </entry>
- </row>
- <row>
- <entry><code>string getRdnString(string $caseFold)</code></entry>
- <entry>
- Gets the RDN of the current node as a string. This reflects
- possible rename-operations.
- </entry>
- </row>
- <row>
- <entry><code>array getRdnArray(string $caseFold)</code></entry>
- <entry>
- Gets the RDN of the current node as an array. This reflects
- possible rename-operations.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node setDn(Zend_Ldap_Dn|string|array
- $newDn)</code>
- </entry>
- <entry>
- Sets the new DN for this node effectively moving the node
- once <code>Zend_Ldap_Node::update()</code> is called.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node move(Zend_Ldap_Dn|string|array
- $newDn)</code>
- </entry>
- <entry>
- This is an alias for
- <code>Zend_Ldap_Node::setDn()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node rename(Zend_Ldap_Dn|string|array
- $newDn)</code>
- </entry>
- <entry>
- This is an alias for
- <code>Zend_Ldap_Node::setDn()</code>.
- </entry>
- </row>
- <row>
- <entry><code>array getObjectClass()</code></entry>
- <entry>Returns the objectClass of the node.</entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node setObjectClass(array|string
- $value)</code>
- </entry>
- <entry>Sets the objectClass attribute.</entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node appendObjectClass(array|string
- $value)</code>
- </entry>
- <entry>Appends to the objectClass attribute.</entry>
- </row>
- <row>
- <entry><code>string toLdif(array $options)</code></entry>
- <entry>
- Returns a LDIF representation of the current node.
- <code>$options</code> will be passed to the
- <code>Zend_Ldap_Ldif_Encoder</code>.
- </entry>
- </row>
- <row>
- <entry><code>array getChangedData()</code></entry>
- <entry>
- Gets changed node data. The array contains all changed
- attributes. This format can be used in
- <code>Zend_Ldap::add()</code> and
- <code>Zend_Ldap::update()</code>.
- </entry>
- </row>
- <row>
- <entry><code>array getChanges()</code></entry>
- <entry>Returns all changes made.</entry>
- </row>
- <row>
- <entry><code>string toString()</code></entry>
- <entry>
- Returns the DN of the current node - proxies to
- <code>Zend_Ldap_Dn::getDnString()</code>.
- </entry>
- </row>
- <row>
- <entry><code>string __toString()</code></entry>
- <entry>
- Casts to string representation - proxies to
- <code>Zend_Ldap_Dn::toString()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array toArray(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns an array representation of the current node. If
- <code>$includeSystemAttributes</code> is <code>false</code>
- (defaults to <code>true</code>) the system specific attributes are
- stripped from the array. Unlike
- <code>Zend_Ldap_Node::getAttributes()</code> the resulting array
- contains the DN with key <code>'dn'</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>string toJson(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns a JSON representation of the current node using
- <code>Zend_Ldap_Node::toArray()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array getData(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns the node's attributes. The array contains all
- attributes in its internal format (no conversion).
- </entry>
- </row>
- <row>
- <entry>
- <code>boolean existsAttribute(string $name, boolean
- $emptyExists)</code>
- </entry>
- <entry>
- Checks whether a given attribute exists. If
- <code>$emptyExists</code> is <code>false</code> empty attributes
- (containing only array()) are treated as non-existent returning
- <code>false</code>. If <code>$emptyExists</code> is true empty
- attributes are treated as existent returning <code>true</code>. In
- this case teh method returns <code>false</code> only if the
- attribute name is missing in the key-collection.
- </entry>
- </row>
- <row>
- <entry>
- <code>boolean attributeHasValue(string $name, mixed|array
- $value)</code>
- </entry>
- <entry>
- Checks if the given value(s) exist in the attribute. The
- method returns <code>true</code> only if all values in
- <code>$value</code> are present in the attribute. Comparison is
- done strictly (respecting the data type).
- </entry>
- </row>
- <row>
- <entry><code>integer count()</code></entry>
- <entry>
- Returns the number of attributes in the node. Implements
- Countable.
- </entry>
- </row>
- <row>
- <entry>
- <code>mixed getAttribute(string $name, integer|null
- $index)</code>
- </entry>
- <entry>
- Gets a LDAP attribute. Data conversion is applied using
- <code>Zend_Ldap_Attribute::getAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array getAttributes(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Gets all attributes of node. If
- <code>$includeSystemAttributes</code> is <code>false</code>
- (defaults to <code>true</code>) the system specific attributes are
- stripped from the array.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node setAttribute(string $name, mixed
- $value)</code>
- </entry>
- <entry>
- Sets a LDAP attribute. Data conversion is applied using
- <code>Zend_Ldap_Attribute::setAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node appendToAttribute(string $name, mixed
- $value)</code>
- </entry>
- <entry>
- Appends to a LDAP attribute. Data conversion is applied
- using <code>Zend_Ldap_Attribute::setAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array|integer getDateTimeAttribute(string $name,
- integer|null $index)</code>
- </entry>
- <entry>
- Gets a LDAP date/time attribute. Data conversion is applied
- using
- <code>Zend_Ldap_Attribute::getDateTimeAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node setDateTimeAttribute(string $name,
- integer|array $value, boolean $utc)</code>
- </entry>
- <entry>
- Sets a LDAP date/time attribute. Data conversion is applied
- using
- <code>Zend_Ldap_Attribute::setDateTimeAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node appendToDateTimeAttribute(string $name,
- integer|array $value, boolean $utc)</code>
- </entry>
- <entry>
- Appends to a LDAP date/time attribute. Data conversion is
- applied using
- <code>Zend_Ldap_Attribute::setDateTimeAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node setPasswordAttribute(string $password,
- string $hashType, string $attribName)</code>
- </entry>
- <entry>
- Sets a LDAP password on <code>$attribName</code> (defaults
- to <code>'userPassword'</code>) to <code>$password</code> with the
- hash type <code>$hashType</code> (defaults to
- <code>Zend_Ldap_Attribute::PASSWORD_HASH_MD5</code>).
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node deleteAttribute(string
- $name)</code>
- </entry>
- <entry>Deletes a LDAP attribute.</entry>
- </row>
- <row>
- <entry>
- <code>void removeDuplicatesFromAttribute(string
- $name)</code>
- </entry>
- <entry>Removes duplicate values from a LDAP attribute.</entry>
- </row>
- <row>
- <entry>
- <code>void removeFromAttribute(string $attribName,
- mixed|array $value)</code>
- </entry>
- <entry>Removes the given values from a LDAP attribute.</entry>
- </row>
- <row>
- <entry><code>boolean exists(Zend_Ldap $ldap)</code></entry>
- <entry>
- Checks if the current node exists on the given LDAP server
- (current server is used if <code>null</code> is passed).
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Node reload(Zend_Ldap $ldap)</code></entry>
- <entry>
- Reloads the current node's attributes from the given LDAP
- server (current server is used if <code>null</code> is
- passed).
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node_Collection
- searchSubtree(string|Zend_Ldap_Filter_Abstract $filter, integer
- $scope, string $sort)</code>
- </entry>
- <entry>
- Searches the nodes's subtree with the given
- <code>$filter</code> and the given search parameters. See
- <code>Zend_Ldap::search()</code> for details on the parameters
- <code>$scope</code> and <code>$sort</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>integer countSubtree(string|Zend_Ldap_Filter_Abstract
- $filter, integer $scope)</code>
- </entry>
- <entry>
- Count the nodes's subtree items matching the the given
- <code>$filter</code> and the given search scope. See
- <code>Zend_Ldap::search()</code> for details on the
- <code>$scope</code> parameter.
- </entry>
- </row>
- <row>
- <entry><code>integer countChildren()</code></entry>
- <entry>Count the nodes's children.</entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node_Collection
- searchChildren(string|Zend_Ldap_Filter_Abstract $filter, string
- $sort)</code>
- </entry>
- <entry>
- Searches the nodes's children matching the given
- <code>$filter</code>. See <code>Zend_Ldap::search()</code> for
- details on the <code>$sort</code> parameter.
- </entry>
- </row>
- <row>
- <entry><code>boolean hasChildren()</code></entry>
- <entry>Returns whether the current node has children.</entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node_ChildrenIterator
- getChildren()</code>
- </entry>
- <entry>Returns all children of the current node.</entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node getParent(Zend_Ldap
- $ldap)</code>
- </entry>
- <entry>
- Returns the parent of the current node using the LDAP
- connection <code>$ldap</code> (uses the current LDAP connection if
- omitted).
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect3>
- <sect3 id="zend.ldap.api.reference.zend-ldap-node-rootdse">
- <title>Zend_Ldap_Node_RootDse</title>
- <para>The following methods are available on all vendor-specific subclasses.</para>
- <para>
- <code>Zend_Ldap_Node_RootDse</code> includes the magic propery accessors
- <code>__get()</code> and <code>__isset()</code> to access the attributes by their
- name. They proxy to <code>Zend_Ldap_Node_RootDse::getAttribute()</code> and
- <code>Zend_Ldap_Node_RootDse::existsAttribute()</code> respectively.
- <code>__set()</code> and <code>__unset()</code> are also implemented but they throw
- a <code>BadMethodCallException</code> as modifications are not allowed on RootDSE
- nodes. Furthermore the class implements <code>ArrayAccess</code> for
- array-style-access to the attributes. <code>offsetSet()</code> and
- <code>offsetUnset()</code> also throw a <code>BadMethodCallException</code> due ro
- obvious reasons.
- </para>
- <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.table">
- <title>Zend_Ldap_Node_RootDse API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>Zend_Ldap_Dn getDn()</code></entry>
- <entry>Gets the DN of the current node as a Zend_Ldap_Dn.</entry>
- </row>
- <row>
- <entry><code>string getDnString(string $caseFold)</code></entry>
- <entry>Gets the DN of the current node as a string.</entry>
- </row>
- <row>
- <entry><code>array getDnArray(string $caseFold)</code></entry>
- <entry>Gets the DN of the current node as an array.</entry>
- </row>
- <row>
- <entry><code>string getRdnString(string $caseFold)</code></entry>
- <entry>Gets the RDN of the current node as a string.</entry>
- </row>
- <row>
- <entry><code>array getRdnArray(string $caseFold)</code></entry>
- <entry>Gets the RDN of the current node as an array.</entry>
- </row>
- <row>
- <entry><code>array getObjectClass()</code></entry>
- <entry>Returns the objectClass of the node.</entry>
- </row>
- <row>
- <entry><code>string toString()</code></entry>
- <entry>
- Returns the DN of the current node - proxies to
- <code>Zend_Ldap_Dn::getDnString()</code>.
- </entry>
- </row>
- <row>
- <entry><code>string __toString()</code></entry>
- <entry>
- Casts to string representation - proxies to
- <code>Zend_Ldap_Dn::toString()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array toArray(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns an array representation of the current node. If
- <code>$includeSystemAttributes</code> is <code>false</code>
- (defaults to <code>true</code>) the system specific attributes are
- stripped from the array. Unlike
- <code>Zend_Ldap_Node_RootDse::getAttributes()</code> the resulting
- array contains the DN with key <code>'dn'</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>string toJson(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns a JSON representation of the current node using
- <code>Zend_Ldap_Node_RootDse::toArray()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array getData(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns the node's attributes. The array contains all
- attributes in its internal format (no conversion).
- </entry>
- </row>
- <row>
- <entry>
- <code>boolean existsAttribute(string $name, boolean
- $emptyExists)</code>
- </entry>
- <entry>
- Checks whether a given attribute exists. If
- <code>$emptyExists</code> is <code>false</code> empty attributes
- (containing only array()) are treated as non-existent returning
- <code>false</code>. If <code>$emptyExists</code> is true empty
- attributes are treated as existent returning <code>true</code>. In
- this case teh method returns <code>false</code> only if the
- attribute name is missing in the key-collection.
- </entry>
- </row>
- <row>
- <entry>
- <code>boolean attributeHasValue(string $name, mixed|array
- $value)</code>
- </entry>
- <entry>
- Checks if the given value(s) exist in the attribute. The
- method returns <code>true</code> only if all values in
- <code>$value</code> are present in the attribute. Comparison is
- done strictly (respecting the data type).
- </entry>
- </row>
- <row>
- <entry><code>integer count()</code></entry>
- <entry>
- Returns the number of attributes in the node. Implements
- Countable.
- </entry>
- </row>
- <row>
- <entry>
- <code>mixed getAttribute(string $name, integer|null
- $index)</code>
- </entry>
- <entry>
- Gets a LDAP attribute. Data conversion is applied using
- <code>Zend_Ldap_Attribute::getAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array getAttributes(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Gets all attributes of node. If
- <code>$includeSystemAttributes</code> is <code>false</code>
- (defaults to <code>true</code>) the system specific attributes are
- stripped from the array.
- </entry>
- </row>
- <row>
- <entry>
- <code>array|integer getDateTimeAttribute(string $name,
- integer|null $index)</code>
- </entry>
- <entry>
- Gets a LDAP date/time attribute. Data conversion is applied
- using
- <code>Zend_Ldap_Attribute::getDateTimeAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node_RootDse reload(Zend_Ldap
- $ldap)</code>
- </entry>
- <entry>
- Reloads the current node's attributes from the given LDAP
- server.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Node_RootDse create(Zend_Ldap
- $ldap)</code> </emphasis>
- </entry>
- <entry>Factory method to create the RootDSE.</entry>
- </row>
- <row>
- <entry><code>array getNamingContexts()</code></entry>
- <entry>Gets the namingContexts.</entry>
- </row>
- <row>
- <entry><code>string|null getSubschemaSubentry()</code></entry>
- <entry>Gets the subschemaSubentry.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsVersion(string|int|array
- $versions)</code>
- </entry>
- <entry>Determines if the LDAP version is supported.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsSaslMechanism(string|array
- $mechlist)</code>
- </entry>
- <entry>Determines if the sasl mechanism is supported.</entry>
- </row>
- <row>
- <entry><code>integer getServerType()</code></entry>
- <entry>
- Gets the server type. Returns
- <variablelist>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_GENERIC</code></term>
- <listitem>for unknown LDAP servers</listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP</code></term>
- <listitem>for OpenLDAP servers</listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY</code></term>
- <listitem>for Microsoft ActiveDirectory servers</listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY</code></term>
- <listitem>For Novell eDirectory servers</listitem>
- </varlistentry>
- </variablelist>
- </entry>
- </row>
- <row>
- <entry><code>Zend_Ldap_Dn getSchemaDn()</code></entry>
- <entry>Returns the schema DN.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <sect4 id="zend.ldap.api.reference.zend-ldap-node-rootdse.openldap">
- <title>OpenLDAP</title>
- <para>
- Additionally the common methods above apply to instances of
- <code>Zend_Ldap_Node_RootDse_OpenLdap</code>.
- </para>
- <note>
- <para>
- Refer to
- <ulink url="http://www.zytrax.com/books/ldap/ch3/#operational">LDAP
- Operational Attributes and Objects</ulink>for information on the attributes
- of OpenLDAP RootDSE.
- </para>
- </note>
- <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.openldap.table">
- <title>Zend_Ldap_Node_RootDse_OpenLdap API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>integer getServerType()</code></entry>
- <entry>
- Gets the server type. Returns
- <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP</code>
- </entry>
- </row>
- <row>
- <entry><code>string|null getConfigContext()</code></entry>
- <entry>Gets the configContext.</entry>
- </row>
- <row>
- <entry><code>string|null getMonitorContext()</code></entry>
- <entry>Gets the monitorContext.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsControl(string|array
- $oids)</code>
- </entry>
- <entry>Determines if the control is supported.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsExtension(string|array
- $oids)</code>
- </entry>
- <entry>Determines if the extension is supported.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsFeature(string|array
- $oids)</code>
- </entry>
- <entry>Determines if the feature is supported.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect4>
- <sect4 id="zend.ldap.api.reference.zend-ldap-node-rootdse.activedirectory">
- <title>ActiveDirectory</title>
- <para>
- Additionally the common methods above apply to instances of
- <code>Zend_Ldap_Node_RootDse_ActiveDirectory</code>.
- </para>
- <note>
- <para>
- Refer to
- <ulink url="http://msdn.microsoft.com/en-us/library/ms684291(VS.85).aspx">
- RootDSE</ulink>for information on the attributes of Microsoft
- ActiveDirectory RootDSE.
- </para>
- </note>
- <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.activedirectory.table">
- <title>Zend_Ldap_Node_RootDse_ActiveDirectory API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>integer getServerType()</code></entry>
- <entry>
- Gets the server type. Returns
- <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY</code>
- </entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getConfigurationNamingContext()</code>
- </entry>
- <entry>Gets the configurationNamingContext.</entry>
- </row>
- <row>
- <entry><code>string|null getCurrentTime()</code></entry>
- <entry>Gets the currentTime.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getDefaultNamingContext()</code>
- </entry>
- <entry>Gets the defaultNamingContext.</entry>
- </row>
- <row>
- <entry><code>string|null getDnsHostName()</code></entry>
- <entry>Gets the dnsHostName.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getDomainControllerFunctionality()</code>
- </entry>
- <entry>Gets the domainControllerFunctionality.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getDomainFunctionality()</code>
- </entry>
- <entry>Gets the domainFunctionality.</entry>
- </row>
- <row>
- <entry><code>string|null getDsServiceName()</code></entry>
- <entry>Gets the dsServiceName.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getForestFunctionality()</code>
- </entry>
- <entry>Gets the forestFunctionality.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getHighestCommittedUSN()</code>
- </entry>
- <entry>Gets the highestCommittedUSN.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getIsGlobalCatalogReady()</code>
- </entry>
- <entry>Gets the isGlobalCatalogReady.</entry>
- </row>
- <row>
- <entry><code>string|null getIsSynchronized()</code></entry>
- <entry>Gets the isSynchronized.</entry>
- </row>
- <row>
- <entry><code>string|null getLdapServiceName()</code></entry>
- <entry>Gets the ldapServiceName.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getRootDomainNamingContext()</code>
- </entry>
- <entry>Gets the rootDomainNamingContext.</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getSchemaNamingContext()</code>
- </entry>
- <entry>Gets the schemaNamingContext.</entry>
- </row>
- <row>
- <entry><code>string|null getServerName()</code></entry>
- <entry>Gets the serverName.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsCapability(string|array
- $oids)</code>
- </entry>
- <entry>Determines if the capability is supported.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsControl(string|array
- $oids)</code>
- </entry>
- <entry>Determines if the control is supported.</entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsPolicy(string|array
- $policies)</code>
- </entry>
- <entry>Determines if the version is supported.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect4>
- <sect4 id="zend.ldap.api.reference.zend-ldap-node-rootdse.edirectory">
- <title>eDirectory</title>
- <para>
- Additionally the common methods above apply to instances of
- <code>Zend_Ldap_Node_RootDse_eDirectory</code>.
- </para>
- <note>
- <para>
- Refer to
- <ulink url="http://www.novell.com/documentation/edir88/edir88/index.html?page=/documentation/edir88/edir88/data/ah59jqq.html">
- Getting Information about the LDAP Server</ulink>for information on the
- attributes of Novell eDirectory RootDSE.
- </para>
- </note>
- <table id="zend.ldap.api.reference.zend-ldap-node-rootdse.edirectory.table">
- <title>Zend_Ldap_Node_RootDse_eDirectory API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>integer getServerType()</code></entry>
- <entry>
- Gets the server type. Returns
- <code>Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY</code>
- </entry>
- </row>
- <row>
- <entry>
- <code>boolean supportsExtension(string|array
- $oids)</code>
- </entry>
- <entry>Determines if the extension is supported.</entry>
- </row>
- <row>
- <entry><code>string|null getVendorName()</code></entry>
- <entry>Gets the vendorName.</entry>
- </row>
- <row>
- <entry><code>string|null getVendorVersion()</code></entry>
- <entry>Gets the vendorVersion.</entry>
- </row>
- <row>
- <entry><code>string|null getDsaName()</code></entry>
- <entry>Gets the dsaName.</entry>
- </row>
- <row>
- <entry><code>string|null getStatisticsErrors()</code></entry>
- <entry>Gets the server statistics "errors".</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getStatisticsSecurityErrors()</code>
- </entry>
- <entry>Gets the server statistics "securityErrors".</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getStatisticsChainings()</code>
- </entry>
- <entry>Gets the server statistics "chainings".</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getStatisticsReferralsReturned()</code>
- </entry>
- <entry>Gets the server statistics "referralsReturned".</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getStatisticsExtendedOps()</code>
- </entry>
- <entry>Gets the server statistics "extendedOps".</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getStatisticsAbandonOps()</code>
- </entry>
- <entry>Gets the server statistics "abandonOps".</entry>
- </row>
- <row>
- <entry>
- <code>string|null
- getStatisticsWholeSubtreeSearchOps()</code>
- </entry>
- <entry>
- Gets the server statistics
- "wholeSubtreeSearchOps".
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect4>
- </sect3>
- <sect3 id="zend.ldap.api.reference.zend-ldap-node-schema">
- <title>Zend_Ldap_Node_Schema</title>
- <para>The following methods are available on all vendor-specific subclasses.</para>
- <para>
- <code>Zend_Ldap_Node_Schema</code> includes the magic propery accessors
- <code>__get()</code> and <code>__isset()</code> to access the attributes by their
- name. They proxy to <code>Zend_Ldap_Node_Schema::getAttribute()</code> and
- <code>Zend_Ldap_Node_Schema::existsAttribute()</code> respectively.
- <code>__set()</code> and <code>__unset()</code> are also implemented but they throw
- a <code>BadMethodCallException</code> as modifications are not allowed on RootDSE
- nodes. Furthermore the class implements <code>ArrayAccess</code> for
- array-style-access to the attributes. <code>offsetSet()</code> and
- <code>offsetUnset()</code> also throw a <code>BadMethodCallException</code> due ro
- obvious reasons.
- </para>
- <table id="zend.ldap.api.reference.zend-ldap-node-schema.table">
- <title>Zend_Ldap_Node_Schema API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>Zend_Ldap_Dn getDn()</code></entry>
- <entry>Gets the DN of the current node as a Zend_Ldap_Dn.</entry>
- </row>
- <row>
- <entry><code>string getDnString(string $caseFold)</code></entry>
- <entry>Gets the DN of the current node as a string.</entry>
- </row>
- <row>
- <entry><code>array getDnArray(string $caseFold)</code></entry>
- <entry>Gets the DN of the current node as an array.</entry>
- </row>
- <row>
- <entry><code>string getRdnString(string $caseFold)</code></entry>
- <entry>Gets the RDN of the current node as a string.</entry>
- </row>
- <row>
- <entry><code>array getRdnArray(string $caseFold)</code></entry>
- <entry>Gets the RDN of the current node as an array.</entry>
- </row>
- <row>
- <entry><code>array getObjectClass()</code></entry>
- <entry>Returns the objectClass of the node.</entry>
- </row>
- <row>
- <entry><code>string toString()</code></entry>
- <entry>
- Returns the DN of the current node - proxies to
- <code>Zend_Ldap_Dn::getDnString()</code>.
- </entry>
- </row>
- <row>
- <entry><code>string __toString()</code></entry>
- <entry>
- Casts to string representation - proxies to
- <code>Zend_Ldap_Dn::toString()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array toArray(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns an array representation of the current node. If
- <code>$includeSystemAttributes</code> is <code>false</code>
- (defaults to <code>true</code>) the system specific attributes are
- stripped from the array. Unlike
- <code>Zend_Ldap_Node_Schema::getAttributes()</code> the resulting
- array contains the DN with key <code>'dn'</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>string toJson(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns a JSON representation of the current node using
- <code>Zend_Ldap_Node_Schema::toArray()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array getData(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Returns the node's attributes. The array contains all
- attributes in its internal format (no conversion).
- </entry>
- </row>
- <row>
- <entry>
- <code>boolean existsAttribute(string $name, boolean
- $emptyExists)</code>
- </entry>
- <entry>
- Checks whether a given attribute exists. If
- <code>$emptyExists</code> is <code>false</code> empty attributes
- (containing only array()) are treated as non-existent returning
- <code>false</code>. If <code>$emptyExists</code> is true empty
- attributes are treated as existent returning <code>true</code>. In
- this case teh method returns <code>false</code> only if the
- attribute name is missing in the key-collection.
- </entry>
- </row>
- <row>
- <entry>
- <code>boolean attributeHasValue(string $name, mixed|array
- $value)</code>
- </entry>
- <entry>
- Checks if the given value(s) exist in the attribute. The
- method returns <code>true</code> only if all values in
- <code>$value</code> are present in the attribute. Comparison is
- done strictly (respecting the data type).
- </entry>
- </row>
- <row>
- <entry><code>integer count()</code></entry>
- <entry>
- Returns the number of attributes in the node. Implements
- Countable.
- </entry>
- </row>
- <row>
- <entry>
- <code>mixed getAttribute(string $name, integer|null
- $index)</code>
- </entry>
- <entry>
- Gets a LDAP attribute. Data conversion is applied using
- <code>Zend_Ldap_Attribute::getAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>array getAttributes(boolean
- $includeSystemAttributes)</code>
- </entry>
- <entry>
- Gets all attributes of node. If
- <code>$includeSystemAttributes</code> is <code>false</code>
- (defaults to <code>true</code>) the system specific attributes are
- stripped from the array.
- </entry>
- </row>
- <row>
- <entry>
- <code>array|integer getDateTimeAttribute(string $name,
- integer|null $index)</code>
- </entry>
- <entry>
- Gets a LDAP date/time attribute. Data conversion is applied
- using
- <code>Zend_Ldap_Attribute::getDateTimeAttribute()</code>.
- </entry>
- </row>
- <row>
- <entry>
- <code>Zend_Ldap_Node_Schema reload(Zend_Ldap
- $ldap)</code>
- </entry>
- <entry>
- Reloads the current node's attributes from the given LDAP
- server.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>Zend_Ldap_Node_Schema create(Zend_Ldap
- $ldap)</code> </emphasis>
- </entry>
- <entry>Factory method to create the Schema node.</entry>
- </row>
- <row>
- <entry><code>array getAttributeTypes()</code></entry>
- <entry>Gets the attribute types as an array of <code/>.</entry>
- </row>
- <row>
- <entry><code>array getObjectClasses()</code></entry>
- <entry>
- Gets the object classes as an array of
- <code>Zend_Ldap_Node_Schema_ObjectClass_Interface</code>.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table id="zend.ldap.api.reference.zend-ldap-node-schema.attributetype-interface.table">
- <title>Zend_Ldap_Node_Schema_AttributeType_Interface API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>string getName()</code></entry>
- <entry>Gets the attribute name.</entry>
- </row>
- <row>
- <entry><code>string getOid()</code></entry>
- <entry>Gets the attribute OID.</entry>
- </row>
- <row>
- <entry><code>string getSyntax()</code></entry>
- <entry>Gets the attribute syntax.</entry>
- </row>
- <row>
- <entry><code>int|null getMaxLength()</code></entry>
- <entry>Gets the attribute maximum length.</entry>
- </row>
- <row>
- <entry><code>boolean isSingleValued()</code></entry>
- <entry>Returns if the attribute is single-valued.</entry>
- </row>
- <row>
- <entry><code>string getDescription()</code></entry>
- <entry>Gets the attribute description</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table id="zend.ldap.api.reference.zend-ldap-node-schema.objectclass-interface.table">
- <title>Zend_Ldap_Node_Schema_ObjectClass_Interface API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>string getName()</code></entry>
- <entry>Returns the objectClass name.</entry>
- </row>
- <row>
- <entry><code>string getOid()</code></entry>
- <entry>Returns the objectClass OID.</entry>
- </row>
- <row>
- <entry><code>array getMustContain()</code></entry>
- <entry>
- Returns the attributes that this objectClass must
- contain.
- </entry>
- </row>
- <row>
- <entry><code>array getMayContain()</code></entry>
- <entry>
- Returns the attributes that this objectClass may
- contain.
- </entry>
- </row>
- <row>
- <entry><code>string getDescription()</code></entry>
- <entry>Returns the attribute description</entry>
- </row>
- <row>
- <entry><code>integer getType()</code></entry>
- <entry>
- Returns the objectClass type. The method returns one of the
- following values:
- <variablelist>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_UNKNOWN</code></term>
- <listitem>for unknown class types</listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_STRUCTURAL</code></term>
- <listitem>for structural classes</listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_ABSTRACT</code></term>
- <listitem>for abstract classes</listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <code>Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_AUXILIARY</code></term>
- <listitem>for auxiliary classes</listitem>
- </varlistentry>
- </variablelist>
- </entry>
- </row>
- <row>
- <entry><code>array getParentClasses()</code></entry>
- <entry>
- Returns the parent objectClasses of this class. This
- includes structural, abstract and auxiliary objectClasses.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>
- Classes representing attribute types and object classes extend
- <code>Zend_Ldap_Node_Schema_Item</code> which provides some core methods to access
- arbitrary attributes on the underlying LDAP node.
- <code>Zend_Ldap_Node_Schema_Item</code> includes the magic propery accessors
- <code>__get()</code> and <code>__isset()</code> to access the attributes by their
- name. Furthermore the class implements <code>ArrayAccess</code> for
- array-style-access to the attributes. <code>offsetSet()</code> and
- <code>offsetUnset()</code> throw a <code>BadMethodCallException</code> as
- modifications are not allowed on schema information nodes.
- </para>
- <table id="zend.ldap.api.reference.zend-ldap-node-schema.schema-item.table">
- <title>Zend_Ldap_Node_Schema_Item API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>array getData()</code></entry>
- <entry>
- Gets all the underlying data from the schema information
- node.
- </entry>
- </row>
- <row>
- <entry><code>integer count()</code></entry>
- <entry>
- Returns the number of attributes in this schema information
- node. Implements Countable.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <sect4 id="zend.ldap.api.reference.zend-ldap-node-schema.openldap">
- <title>OpenLDAP</title>
- <para>
- Additionally the common methods above apply to instances of
- <code>Zend_Ldap_Node_Schema_OpenLDAP</code>.
- </para>
- <table id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.table">
- <title>Zend_Ldap_Node_Schema_OpenLDAP API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>array getLdapSyntaxes()</code></entry>
- <entry>Gets the LDAP syntaxes.</entry>
- </row>
- <row>
- <entry><code>array getMatchingRules()</code></entry>
- <entry>Gets the matching rules.</entry>
- </row>
- <row>
- <entry><code>array getMatchingRuleUse()</code></entry>
- <entry>Gets the matching rule use.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table
- id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.attributetype-interface.table">
- <title>Zend_Ldap_Node_Schema_AttributeType_OpenLDAP API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <code>Zend_Ldap_Node_Schema_AttributeType_OpenLdap|null
- getParent()</code>
- </entry>
- <entry>
- Returns the parent attribute type in the inhertitance
- tree if one exists.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table
- id="zend.ldap.api.reference.zend-ldap-node-schema.openldap.objectclass-interface.table">
- <title>Zend_Ldap_Node_Schema_ObjectClass_OpenLDAP API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><code>array getParents()</code></entry>
- <entry>
- Returns the parent object classes in the inhertitance
- tree if one exists. The returned array is an array of
- <code>Zend_Ldap_Node_Schema_ObjectClass_OpenLdap</code>.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect4>
- <sect4 id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory">
- <title>ActiveDirectory</title>
- <note>
- <title>Schema browsing on ActiveDirectory servers</title>
- <para>
- Due to restrictions on Microsoft ActiveDirectory servers regarding
- the number of entries returned by generic search routines and due to the
- structure of the ActiveDirectory schema repository, schema browsing is
- currently <emphasis>not</emphasis> available for Microsoft ActiveDirectory
- servers.
- </para>
- </note>
- <para>
- <code>Zend_Ldap_Node_Schema_ActiveDirectory</code> does not provide any
- additional methods.
- </para>
- <table
- id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory.attributetype-interface.table">
- <title>Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory API</title>
- <tgroup cols="1">
- <tbody>
- <row>
- <entry>
-
- <code>Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory</code>
- does not provide any additional methods.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <table
- id="zend.ldap.api.reference.zend-ldap-node-schema.activedirectory.objectclass-interface.table">
- <title>Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory API</title>
- <tgroup cols="1">
- <tbody>
- <row>
- <entry>
-
- <code>Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory</code>
- does not provide any additional methods.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect4>
- </sect3>
- <sect3 id="zend.ldap.api.reference.zend-ldap-ldif-encoder">
- <title>Zend_Ldif_Encoder</title>
- <table id="zend.ldap.api.reference.zend-ldap-ldif-encoder.table">
- <title>Zend_Ldif_Encoder API</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Method</entry>
- <entry>Description</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>
- <emphasis> <code>array decode(string $string)</code>
- </emphasis>
- </entry>
- <entry>
- Decodes the string <code>$string</code> into an array of
- LDIF items.
- </entry>
- </row>
- <row>
- <entry>
- <emphasis> <code>string encode(scalar|array|Zend_Ldap_Node
- $value, array $options)</code> </emphasis>
- </entry>
- <entry>
- Encode <code>$value</code> into a LDIF representation.
- <code>$options</code> is an array that may contain the following
- keys:
- <variablelist>
- <varlistentry>
- <term><code>'sort'</code></term>
- <listitem>Sort the given attributes with <code>dn</code>
- following <code>objectClass</code> and following all other
- attributes sorted alphabetically. <code>true</code> by
- default.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>'version'</code></term>
- <listitem>The LDIF format version. <code>1</code> by
- default.</listitem>
- </varlistentry>
- <varlistentry>
- <term><code>'wrap'</code></term>
- <listitem>The line-length. <code>78</code> by default to
- conform to the LDIF specification.</listitem>
- </varlistentry>
- </variablelist>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </sect3>
- </sect2>
- </sect1>
|