Exemplo n.º 1
0
def _getRoomFile(roomDN):
    if roomDN.startswith('cn='):
        dnParts = explodeDn(roomDN, True)
        if not dnParts:
            MODULE.warn('Could not split room DN: %s' % roomDN)
            raise UMC_Error(_('Invalid room DN: %s') % roomDN)
        return os.path.join(ROOMDIR, dnParts[0])
    return os.path.join(ROOMDIR, roomDN)
Exemplo n.º 2
0
 def __init__(self, ucr=None):
     if not ucr:
         ucr = univention.config_registry.ConfigRegistry()
         ucr.load()
     self.binddn = ucr.get('tests/domainadmin/account', 'uid=Administrator,cn=users,%s' % ucr.get('ldap/base'))
     pwdfile = ucr.get('tests/domainadmin/pwdfile')
     if pwdfile:
         with open(pwdfile, 'r') as f:
             self.bindpw = f.read().strip('\n\r')
     else:
         self.bindpw = ucr.get('tests/domainadmin/pwd', 'univention')
     if self.binddn:
         self.username = uldap.explodeDn(self.binddn, 1)[0]
     else:
         self.username = None
Exemplo n.º 3
0
 def __init__(self, ucr=None):
     # type: (Optional[ConfigRegistry]) -> None
     if ucr is None:
         ucr = UCR
         ucr.load()
     self.binddn = ucr.get('tests/domainadmin/account',
                           'uid=Administrator,cn=users,%(ldap/base)s' % ucr)
     self.pwdfile = ucr.get('tests/domainadmin/pwdfile')
     if self.pwdfile:
         with open(self.pwdfile, 'r') as f:
             self.bindpw = f.read().strip('\n\r')
     else:
         self.bindpw = ucr.get('tests/domainadmin/pwd', 'univention')
     if self.binddn:
         self.username = uldap.explodeDn(self.binddn,
                                         1)[0]  # type: Optional[Text]
     else:
         self.username = None