KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/21572/root/usr/lib64/python2.4/site-packages/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/21572/root/usr/lib64/python2.4/site-packages/ldapurl.pyc
mò
®¸Bc	@sdZdZdddddddd	d
g	ZdkZdklZlZd
ZdZdZ	hdd<d
d<dd<dd<Zhdd<de<de<de	<Ze
dƒZe
fƒZd„Zd„Zdfd„ƒYZd	eifd„ƒYZd
fd„ƒYZdS(s
ldapurl - handling of LDAP URLs as described in RFC 2255
written by Michael Stroeder <michael@stroeder.com>

See http://python-ldap.sourceforge.net for details.

\$Id: ldapurl.py,v 1.33 2005/06/01 22:11:20 stroeder Exp $

Python compability note:
This module only works with Python 2.0+ since
1. string methods are used instead of module string and
2. list comprehensions are used.
s0.5.2tSEARCH_SCOPEtSEARCH_SCOPE_STRtLDAP_SCOPE_BASEtLDAP_SCOPE_ONELEVELtLDAP_SCOPE_SUBTREEt	isLDAPUrltLDAPUrlExtensiontLDAPUrlExtensionstLDAPUrlN(squotesunquoteiiittbasetonetsubcCs9|iƒ}|idƒp|idƒp
|idƒS(s*
  Returns 1 if s is a LDAP URL, 0 else
  sldap://sldaps://sldapi://N(tstlowerts_lowert
startswith(R
R((t-/usr/lib64/python2.4/site-packages/ldapurl.pyR2scCs"t|ƒiddƒiddƒS(s Returns URL encoding of string st,s%2Ct/s%2FN(tquoteR
treplace(R
((Rt
ldapUrlEscape=scBsYtZdZedeed„Zd„Zd„Zd„Zd„Zd„Z	d„Z
RS(	s?
  Class for parsing and unparsing LDAP URL extensions
  as described in RFC 2255.

  BNF definition of LDAP URL extensions:

       extensions = extension *("," extension)
       extension  = ["!"] extype ["=" exvalue]
       extype     = token / xtoken
       exvalue    = LDAPString from section 4.1.2 of [2]
       token      = oid from section 4.1 of [3]
       xtoken     = ("X-" / "x-") token

  Usable class attributes:
  critical
        Boolean integer marking the extension as critical
  extype    
        Type of extension
  exvalue
        Value of extension
  icCs7||_||_||_|o|i|ƒndS(N(tcriticaltselftextypetexvaluetextensionStrt_parse(RRRRR((Rt__init__Ys
			cCs±|iƒ}|pd\|_|_dSn|ddj|_|ddjo|diƒ}n|iddƒ\|_|_|iiƒ|_t|iiƒƒ|_dS(Nit!it=(NN(	t	extensiontstriptNoneRRRRtsplittunquote(RR ((RR`scCs7dd|idj|i|ipdiddƒfS(Ns%s%s=%sRiR	Rs%2C(RRRRR(R((RtunparsemscCs
|iƒS(N(RR%(R((Rt__str__sscCs/d|ii|iitt|ƒƒ|ifS(Ns<%s.%s instance at %s: %s>(Rt	__class__t
__module__t__name__thextidt__dict__(R((Rt__repr__vscCs6|i|ijo#|i|ijo|i|ijS(N(RRtotherRR(RR.((Rt__eq__~scCs|i|ƒS(N(RR/R.(RR.((Rt__ne__„s(R)R(t__doc__R"RRR%R&R-R/R0(((RRBs	
				cBsYtZdZed„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d„ZRS(	sE
  Models a collection of LDAP URL extensions as
  dictionary type
  cCsBtii|ƒx+|phiƒD]\}}|||<q$WdS(N(tUserDictRRtdefaulttitemstktv(RR3R5R6((RRŽscCs?t|tƒpt‚||ijpt‚||i|<dS(si
    value
        Either LDAPUrlExtension instance, (critical,exvalue)
        or string'ed exvalue
    N(t
isinstancetvalueRtAssertionErrortnameRRtdata(RR:R8((Rt__setitem__“scCs)g}|iƒD]}|||q~S(N(t_[1]RtkeysR5(RR=R5((RtvaluesscCsditt|iƒƒƒS(NR(tjointmaptstrRR?(R((RR&£scCs/d|ii|iitt|ƒƒ|ifS(Ns<%s.%s instance at %s: %s>(RR'R(R)R*R+R;(R((RR-¦scCs:t||iƒpttd|iƒ‚|i|ijS(Nsother has to be instance of %s(R7R.RR'R9t	TypeErrorR;(RR.((RR/®s*cCs=x6|iƒidƒD]}t|ƒ}|||i<qWdS(NR(t
extListStrR!R#t
extension_strRteRR(RRDRFRE((Rtparse´scCs4dig}|iƒD]}||iƒq~ƒS(NR(R@R=RR?R6R%(RR=R6((RR%¹s(R)R(R1R"RR<R?R&R-R/RGR%(((RRˆs	
					cBsÂtZdZhdd<dd<Zedddeeeeeed„
Zd„Zd	„Zd
„Zd„Z	d„Z
d
„Zdeed„Zd„Z
d„Zd„Zd„Zd„ZRS(s
  Class for parsing and unparsing LDAP URLs
  as described in RFC 2255.

  BNF definition of LDAP URL:

    hostport     host:port
    dn           distinguished name
    attributes   list with attributes
    scope        search scope string
    filter       LDAP search filter
    ldapurl    = scheme "://" [hostport] ["/"
                     [dn ["?" [attrs] ["?" [scope]
                     ["?" [filter] ["?" extensions]]]]]]

  Usable class attributes:
    urlscheme
        URL scheme (either ldap, ldaps or ldapi)
    hostport
        LDAP host (default '')
    dn
        String holding distinguished name (default '')
    attrs
        list of attribute types (default None)
    scope
        integer search scope for ldap-module
    filterstr
        String representation of LDAP Search Filters
        (see RFC 2254)
    extensions
        Dictionary used as extensions store
    who
        Maps automagically to bindname LDAP URL extension
    cred
        Maps automagically to X-BINDPW LDAP URL extension
  twhotbindnametcredsX-BINDPWtldapR	cCs¢||_||_||_||_||_||_|p
thƒ|_|djo|i|ƒn|	djo
|	|_n|
djo
|
|_
ndS(N(t	urlschemeRthostporttdntattrstscopet	filterstrt
extensionsRtldapUrlR"RRHRJ(RRSRLRMRNRORPRQRRRHRJ((RRås						



cCs‚|i|ijoo|i|ijo\|i|ijoI|i|ijo6|i|ijo#|i|ijo|i|ijS(N(	RRLR.RMRNRORPRQRR(RR.((RR/ûscCs|i|ƒS(N(RR/R.(RR.((RR0sc
Csºt|ƒp
td‚n|iddƒ\}}|iƒ|_|idddgjotd|i‚n|i	dƒ}|i	d	ƒ}|d
jo-|d
jo t|ƒ|_
d|_dSnž|d
jo?|d
jp
||jo%t|| ƒ|_
||d}nR|djo;|d
jp
||jo!t|| ƒ|_
||}n
td
‚|id	ƒ}t|ƒ}|djot|dƒiƒ|_n|djo1|do&t|diƒƒidƒ|_n|djoN|diƒ}yt||_WqAtj
otdt|ƒ‚qAXn|djo7|diƒ}	|	p
d|_q…t|	ƒ|_n|djo$tƒ|_|ii|dƒndS(sn
    parse a LDAP URL and set the class attributes
    urlscheme,host,dn,attrs,scope,filterstr,extensions
    s2Parameter ldap_url does not seem to be a LDAP URL.s://iRKtldapstldapis,LDAP URL contains unsupported URL scheme %s.Rt?iÿÿÿÿR	Ns$Something completely weird happened!iiRisJSearch scope must be either one of base, one or sub. LDAP URL contained %sii(Rtldap_urlt
ValueErrorR#tschemetrestR!RRLtfindt	slash_post
qemark_posR$RMRNt	paramlisttlent
paramlist_lenRORPRtKeyErrortreprRQR"RRRRG(
RRWR\R]RZR`R^RPRYRQ((RRsR

	''	
&



cCsIxB|iƒD]4}t||ƒdjot||||ƒq
q
WdS(s¦
    Apply defaults to all class attributes which are None.

    defaults
        Dictionary containing a mapping from class attributes
        to default values
    N(tdefaultsR>R5tgetattrRR"tsetattr(RRcR5((Rt
applyDefaults>s

cCs=|idjot|iƒ}n
|i}d|i|fS(sE
    Returns LDAP URL suitable to be passed to ldap.initialize()
    RUs%s://%sN(RRLRRM(RRM((Rt
initializeUrlJs
	cCså|idjo
d}ndi|iƒ}t|i}|idjo
d}nt	|iƒ}t	|i
ƒ}|idjot	|iƒ}n
|i}d|i|||||f}|io|d|iiƒ}n|S(s=
    Returns LDAP URL depending on class attributes set.
    R	RRUs%s://%s/%s?%s?%s?%sRVN(RROR"t	attrs_strR@RRPt	scope_strRQRRNRLRMRWRRR%(RRNRWRQRhRMRi((RR%Us 


	
cCs¯t|ƒtjp
td‚|djo|iƒ}nt|ƒtjp
td‚|djo
d}n(t|ƒtjp
td‚d|}d|||iƒ|fS(s	Complete surlPrefix must be StringTypeshrefText must be StringTypeR	shrefTarget must be StringTypes target="%s"s<a%s href="%s%s">%s</a>N(
ttypet	urlPrefixt
StringTypeR9threfTextR"RR%t
hrefTargetttarget(RRkRmRnRo((RthtmlHREFps



cCs
|iƒS(N(RR%(R((RR&scCs/d|ii|iitt|ƒƒ|ifS(Ns<%s.%s instance at %s: %s>(RR'R(R)R*R+R,(R((RR-‚scCsr|ii|ƒoB|i|}|ii|ƒot|i|iƒ}qndSnt
d|ii|f‚|S(Ns%s has no attribute %s(
Rtattr2extypethas_keyR:RRRR$RtresultR"tAttributeErrorR'R)(RR:RRs((Rt__getattr__Šs
cCs†|ii|ƒob|i|}|djot||ƒq‚|djo&td|dt	|ƒƒ|i
|<q‚n||i|<dS(NRR(RRqRrR:RR8R"tdelattrRR$RRR,(RR:R8R((Rt__setattr__—s


*cCsV|ii|ƒo5|i|}y|i|=WqRtj
oqRXn|i|=dS(N(RRqRrR:RRRRaR,(RR:R((Rt__delattr__¥s
	(R)R(R1RqR"RR/R0RRfRgR%RpR&R-RuRwRx(((RR½s$'	
		6						
	(R1t__version__t__all__R2turllibRR$RRRR"RRRjRlt	TupleTypeRRRRR(R$RR|RzRlR2RRRRRRRRRRRy((RRV
s !
	**			F5

Anon7 - 2021