
    =OOfk                      >    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_DELETEBASEDEREF_NEVER)safe_dnc           	      B
   t        |t              s|g}t        |t              s|g}| j                  rJg }g }|D ]  }|j                  t	        |              |D ]  }|j                  t	        |              |}|}d}	d}
|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 }n|}|}|D cg c]  }|j%                          }}|D cg c]  }|j%                          }}t'               }|D cg c]  }|j%                         |v s| }}|D cg c]  }|j%                         |v s| }}|rt(        |f|d<   |rt(        |f|d<   |sv| 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 }n|}|}|D cg c]  }|j%                          }}|D cg c]  }|j%                          }}t'               }|D cg c]  }|j%                         |v s| }}|D cg c]  }|j%                         |v s| }}|rt(        |f|d<   |rt(        |f|d<   |sv| 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 remove from groups
    :param groups_dn: the list of groups where members are to be removed
    :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
    Removes users-groups relations following the eDirectory rules: groups are removed from securityEquals and groupMembership
    attributes in the member object while members are removed from 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responseresultr   lowerdictr   modifyend_transaction)
connection
members_dn	groups_dnfixtransactionsafe_members_dnsafe_groups_dn	member_dngroup_dntransaction_controlerrorr   r"   r!   _existing_security_equalsexisting_group_membershipelementchangessecurity_equals_to_removegroup_membership_to_removegroupexisting_membersexisting_equivalent_to_memember_to_removeequivalent_to_me_to_removes                             l/var/www/premiumrankchecker/venv/lib/python3.12/site-packages/ldap3/extend/novell/removeMembersFromGroups.pyedir_remove_members_from_groupsr?      s   " j.1 \
i0K	# 	7I""79#56	7! 	5H!!'("34	5 %
"	E(//66HHJ  *	F#**63Dd`k  zJ  L]  y^*  _!**//'1'>'>v'F$Hf!**6617.68Q#-#6#6!+!2!2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)+4(,5)G_'`G'`$'`Ha(bW(b%(bfG@I(yWW]]_`xMx(y%(yAJ){ggmmoazNz'){&){(-:<U,V()).;=W-X)*#**67^iFYEZos*t!**// * 7 7 ?IAv!**66*061a!+!2!2-(I5 EU*	X  +	E#**52CT_j  yA  CS  xT*  U!**//'1'>'>v'F$Hf!**6617.68Q#-#6#6!+!2!2m,	9,U\-ABBJRV^_`VabnVoJo8A;|#<X#Fuw [kowxyoz  |H  pI  \IHQK,EFV,W  OQ)#- ,6)?OPGPPHa(bW(b%(bfG7AiGW]]_XhEhiiAK)|gw}}b{O{')|&)|%24D$E!)-:<V,W()#**5']hEXDYnr*s!**// * 7 7 ?IAv!**66*061a!+!2!2-(I5 EW+	Z &&--==UViUj=kF&&--==TUhTi=jF- I-E9] (a(b )z){R  Q(b  j)|sH    S9S>TT&T>T8TT<TTT6TN)__doc__core.exceptionsr    r   r   r   r   utils.dnr	   r?        r>   <module>rF      s   0 2 @ @ LrE   