コード例 #1
0
 def childFactory(self, context, name):
     unquoted = uriUnquote(name)
     try:
         dn = distinguishedname.DistinguishedName(stringValue=unquoted)
     except distinguishedname.InvalidRelativeDistinguishedName, e:
         # TODO There's no way to throw a FormException at this stage.
         return None
コード例 #2
0
ファイル: change_password.py プロジェクト: KenMacD/ldaptor
 def childFactory(self, ctx, name):
     unquoted=uriUnquote(name)
     try:
         dn = distinguishedname.DistinguishedName(stringValue=unquoted)
     except distinguishedname.InvalidRelativeDistinguishedName, e:
         # TODO There's no way to throw a FormException at this stage.
         return None
コード例 #3
0
    def childFactory(self, context, name):
        entry = inevow.ISession(context).getLoggedInRoot().loggedIn

        filt = uriUnquote(name)

        e = ldapsyntax.LDAPEntry(client=entry.client, dn=self.baseObject)
        d = e.search(filterText=filt, sizeLimit=20)
        d.addCallback(ReallyMassPasswordChangePage)
        return d
コード例 #4
0
    def childFactory(self, context, name):
        entry = inevow.ISession(context).getLoggedInRoot().loggedIn

        filt = uriUnquote(name)

        e=ldapsyntax.LDAPEntry(client=entry.client,
                               dn=self.baseObject)
        d=e.search(filterText=filt, sizeLimit=20)
        d.addCallback(ReallyMassPasswordChangePage)
        return d
コード例 #5
0
ファイル: edit.py プロジェクト: KenMacD/ldaptor
    def childFactory(self, context, name):
        dn = uriUnquote(name)
        userEntry = inevow.ISession(context).getLoggedInRoot().loggedIn

        e = ldapsyntax.LDAPEntryWithClient(dn=dn,
                                           client=userEntry.client)
        d = e.fetch()
        def _getSchema(entry):
            d = fetchschema.fetch(entry.client, entry.dn)
            def cb((attributeTypes, objectClasses), entry):
                return (entry, attributeTypes, objectClasses)
            d.addCallback(cb, entry)
            return d
コード例 #6
0
ファイル: move.py プロジェクト: Jbran77/ldaptor
    def childFactory(self, context, name):
        dn = uriUnquote(name)
        session = inevow.ISession(context)
        userEntry = session.getLoggedInRoot().loggedIn

        move = session.getComponent(IMove)
        if move is None:
            move = []
            session.setComponent(IMove, move)

        e = ldapsyntax.LDAPEntryWithClient(dn=dn, client=userEntry.client)
        move.append(e)
        u = url.URL.fromContext(context).sibling('search')
        return u
コード例 #7
0
ファイル: move.py プロジェクト: KenMacD/ldaptor
    def childFactory(self, context, name):
        dn = uriUnquote(name)
        session = inevow.ISession(context)
        userEntry = session.getLoggedInRoot().loggedIn

        move = session.getComponent(IMove)
        if move is None:
            move = []
            session.setComponent(IMove, move)

        e = ldapsyntax.LDAPEntryWithClient(dn=dn,
                                           client=userEntry.client)
        move.append(e)
        u = url.URL.fromContext(context).sibling('search')
        return u
コード例 #8
0
    def locateChild(self, request, segments):
        ret = super(AddPage, self).locateChild(request, segments)
        if ret != rend.NotFound:
            return ret

        if segments[0] == 'manual':
            if not segments[1:]:
                return rend.NotFound
            path = segments[1]
            unquoted = uriUnquote(path)
            objectClasses = unquoted.split('+')
            assert len(objectClasses) >= 1

            structName = objectClasses[0]
            structuralObjectClass = mapNameToObjectClass(
                self.objectClasses, structName)
            assert structuralObjectClass is not None, \
                   "objectClass %s must have schema"%structName

            auxiliaryObjectClasses = []
            for auxName in objectClasses[1:]:
                oc = mapNameToObjectClass(self.objectClasses, auxName)
                assert oc is not None, "objectClass %s must have schema" % oc
                auxiliaryObjectClasses.append(oc)
            r = ManualAddPage(structuralObjectClass=structuralObjectClass,
                              auxiliaryObjectClasses=auxiliaryObjectClasses,
                              attributeTypes=self.attributeTypes,
                              objectClasses=self.objectClasses)
            return r, segments[2:]
        elif segments[0] == 'smart':
            if not segments[1:]:
                return rend.NotFound
            name = segments[1]
            if not name:
                return rend.NotFound
            plug = self.getPlugin(name)
            module = plug.load()
            add = module.add()
            r = SmartObjectAddPage(add)
            return r, segments[2:]
        else:
            return rend.NotFound
コード例 #9
0
ファイル: add.py プロジェクト: tubaman/ldaptor
    def locateChild(self, request, segments):
        ret = super(AddPage, self).locateChild(request, segments)
        if ret != rend.NotFound:
            return ret

        if segments[0] == 'manual':
            if not segments[1:]:
                return rend.NotFound
            path=segments[1]
            unquoted=uriUnquote(path)
            objectClasses = unquoted.split('+')
            assert len(objectClasses) >= 1

            structName=objectClasses[0]
            structuralObjectClass = mapNameToObjectClass(self.objectClasses,
                                                         structName)
            assert structuralObjectClass is not None, \
                   "objectClass %s must have schema"%structName

            auxiliaryObjectClasses = []
            for auxName in objectClasses[1:]:
                oc = mapNameToObjectClass(self.objectClasses, auxName)
                assert oc is not None, "objectClass %s must have schema"%oc
                auxiliaryObjectClasses.append(oc)
            r = ManualAddPage(structuralObjectClass=structuralObjectClass,
                              auxiliaryObjectClasses=auxiliaryObjectClasses,
                              attributeTypes=self.attributeTypes,
                              objectClasses=self.objectClasses)
            return r, segments[2:]
        elif segments[0] == 'smart':
            if not segments[1:]:
                return rend.NotFound
            name = segments[1]
            if not name:
                return rend.NotFound
            plug = self.getPlugin(name)
            module = plug.load()
            add = module.add()
            r = SmartObjectAddPage(add)
            return r, segments[2:]
        else:
            return rend.NotFound
コード例 #10
0
ファイル: gadget.py プロジェクト: norox/ldaptor
    def locateChild(self, ctx, segments):
        ret = super(LdaptorWebUIGadget, self).locateChild(ctx, segments)
        if ret != rend.NotFound:
            return ret

        path = segments[0]
        unquoted = uriUnquote(path)
        try:
            dn = distinguishedname.DistinguishedName(stringValue=unquoted)
        except distinguishedname.InvalidRelativeDistinguishedName, e:
            # TODO There's no way to throw a FormException at this stage.
            u = url.URL.fromContext(ctx)

            # TODO protect against guard bug, see
            # http://divmod.org/users/roundup.twistd/nevow/issue74
            u = u.child("")

            # TODO freeform_post!configurableName!methodName
            u.add("basedn", path)
            return u, []
コード例 #11
0
    def locateChild(self, ctx, segments):
        ret = super(LdaptorWebUIGadget, self).locateChild(ctx, segments)
        if ret != rend.NotFound:
            return ret

        path = segments[0]
        unquoted = uriUnquote(path)
        try:
            dn = distinguishedname.DistinguishedName(stringValue=unquoted)
        except distinguishedname.InvalidRelativeDistinguishedName, e:
            # TODO There's no way to throw a FormException at this stage.
            u = url.URL.fromContext(ctx)

            # TODO protect against guard bug, see
            # http://divmod.org/users/roundup.twistd/nevow/issue74
            u = u.child('')

            # TODO freeform_post!configurableName!methodName
            u.add('basedn', path)
            return u, []