
    =OOf                      >    d Z ddlmZ ddlmZmZmZmZ ddlm	Z	 d Z
y)
   )LDAPInvalidDnError)SEQUENCE_TYPES
MODIFY_ADDBASEDEREF_NEVER)safe_dnc           	      F
   t        |t              s|g}t        |t              s|g}d}d}| j                  rJg }g }|D ]  }	|j                  t	        |	              |D ]  }
|j                  t	        |
              |}|}|r$| j
                  j                  j                         }|s|D ]  }|r | j                  |dt        t        ddg      }| j                  j                  s| j                  |      \  }}n6| j                  j                  r|\  }}}}n| j                  }| j                   }|d   dk(  st#        |d	z         d|d
   d   v r|d
   d   d   ng }d|d
   d   v r|d
   d   d   ng }|D cg c]  }|j%                          }}|D cg c]  }|j%                          }}ng }g }t'               }|D cg c]  }|j%                         |vs| }}|D cg c]  }|j%                         |vs| }}|rt(        |f|d<   |rt(        |f|d<   |sw| j+                  |||r|gnd      }| j                  j                  s| j                  |      \  }}n*| j                  j                  r|\  }}}}n| j                  }|d   dk7  sd} n |s|D ]  }|r | j                  |dt        t        ddg      }| j                  j                  s| j                  |      \  }}n6| j                  j                  r|\  }}}}n| j                  }| j                   }|d   dk(  st#        |d	z         d|d
   d   v r|d
   d   d   ng }d|d
   d   v r|d
   d   d   ng }|D cg c]  }|j%                          }}|D cg c]  }|j%                          }}ng }g }t'               }|D cg c]  }|j%                         |vs| }}|D cg c]  }|j%                         |vs| }}|rt(        |f|d<   |rt(        |f|d<   |sw| j+                  |||r|gnd      }| j                  j                  s| j                  |      \  }}n*| j                  j                  r|\  }}}}n| j                  }|d   dk7  sd} n |r]|r)| j
                  j                  j-                  d|g      }n(| j
                  j                  j-                  d|g      }|d   dk7  rd}| S c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w )a  
    :param connection: a bound Connection object
    :param members_dn: the list of members to add to groups
    :param groups_dn: the list of groups where members are to be added
    :param fix: checks for inconsistences in the users-groups relation and fixes them
    :param transaction: activates an LDAP transaction
    :return: a boolean where True means that the operation was successful and False means an error has happened
    Establishes users-groups relations following the eDirectory rules: groups are added to securityEquals and groupMembership
    attributes in the member object while members are added to member and equivalentToMe attributes in the group object.
    Raises LDAPInvalidDnError if members or groups are not found in the DIT.
    NFz(objectclass=*)securityEqualsgroupMembership)dereference_aliases
attributesdescriptionsuccessz
 not found    r   )controlsTmemberequivalentToMe)commitr   )
isinstancer   check_namesappendr	   extendnovellstart_transactionsearchr   r   strategysyncget_responsethread_saferesultresponser   lowerdictr   modifyend_transaction)
connection
members_dn	groups_dnfixtransactiontransaction_controlerrorsafe_members_dnsafe_groups_dn	member_dngroup_dnr   r!   r"   _existing_security_equalsexisting_group_membershipelementchangessecurity_equals_to_addgroup_membership_to_addgroupexisting_membersexisting_equivalent_to_memember_to_addequivalent_to_me_to_adds                             g/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/ldap3/extend/novell/addMembersToGroups.pyedir_add_members_to_groupsr?      s
     j.1 \
i0K	E# 	7I""79#56	7! 	5H!!'("34	5 %
"	(//66HHJ  )	F#**63Dd`k  zJ  L]  y^*  _!**//'1'>'>v'F$Hf!**6617.68Q!+!2!2#-#6#6m,	9,Vl-BCCZjnvwxny  {G  oH  [H8A;|+DEU+V  NP(\mqyz{q|  ~J  rK  ]KHQK,EFW,X  QS)Kc+dGMMO+d(+dLe,fW]]_,f),f+-(,.)fG=F%z''--/ayJyg%z"%z>G&|77==?b{K{w&|#&|%-79O,P()&.8:Q-R)*#**67^iFYEZos*t!**// * 7 7 ?IAv!**66*061a!+!2!2-(I5 ES)	V  *	E#**52CT_j  yA  CS  xT*  U!**//'1'>'>v'F$Hf!**6617.68Q!+!2!2#-#6#6m,	9,U\-ABBJRV^_`VabnVoJo8A;|#<X#Fuw [kowxyoz  |H  pI  \IHQK,EFV,W  OQ)CS#TGMMO#T #TLe,fW]]_,f),f#% ,.)fG4>j'--/YiBiWjMj>H&}7GMMOc|L|w&}#&}%/$?!&-79P,Q()#**5']hEXDYnr*s!**// * 7 7 ?IAv!**66*061a!+!2!2-(I5 EU*	X &&--==UViUj=kF&&--==TUhTi=jF- I-E9_ ,e,f
 &{&|J $U,f k&}sH   <S;T TT'T
?T
5TT>TT T8TN)__doc__core.exceptionsr    r   r   r   r   utils.dnr	   r?        r>   <module>rF      s   0 2 = = IrE   