Ejemplo n.º 1
0
    def delete(self):
        """ Tries to delete the item on the server
        """

        lumaConnection = LumaConnectionWrapper(self.serverParent.serverMeta)
        bindSuccess, exceptionObject = lumaConnection.bindSync()

        if not bindSuccess:
            message = QtCore.QCoreApplication.translate(
                "LDAPTreeItem", "Could not bind to server.")
            return (False, message, exceptionObject)

        success, exceptionObject = lumaConnection.delete(
            self.smartObject().getDN())
        lumaConnection.unbind()

        if success:
            self.childItems = []
            self.populated = True
            return (True, None, None)
        else:
            message = QtCore.QCoreApplication.translate(
                "LDAPTreeItem",
                "Could not delete entry: " + exceptionObject[0]["desc"])
            return (False, message, exceptionObject)
Ejemplo n.º 2
0
    def deleteObject(self):
        """
        Deletes the remote object that this model represents
        """

        lumaConnection = LumaConnectionWrapper(
            self.smartObject.getServerMeta())
        bindSuccess, exceptionObject = lumaConnection.bindSync()

        if not bindSuccess:
            message = self.str_BIND
            return (False, message, exceptionObject)

        success, exceptionObject = lumaConnection.delete(
            self.smartObject.getDN())
        lumaConnection.unbind()

        if success:
            #serverName = self.smartObject.getServerAlias()
            #dn = self.smartObject.getPrettyParentDN()
            #self.model().reloadItem(self.smartObject.parent())
            #self.modelChangedSignal.emit()
            return (True, None, None)
        else:
            message = self.str_DELETE
            return (False, message, exceptionObject)
Ejemplo n.º 3
0
 def delete(self):
     """ Tries to delete the item on the server
     """
     
     lumaConnection = LumaConnectionWrapper(self.serverParent.serverMeta)
     bindSuccess, exceptionObject = lumaConnection.bindSync()
     
     if not bindSuccess:
         message = QtCore.QCoreApplication.translate("LDAPTreeItem","Could not bind to server.")
         return (False, message, exceptionObject)
     
     success, exceptionObject = lumaConnection.delete(self.smartObject().getDN())
     lumaConnection.unbind()
     
     if success:
         self.childItems = []
         self.populated = True
         return (True, None, None)
     else:
         message = QtCore.QCoreApplication.translate("LDAPTreeItem","Could not delete entry: "+exceptionObject[0]["desc"])
         return (False, message, exceptionObject)
Ejemplo n.º 4
0
    def deleteObject(self):
        """
        Deletes the remote object that this model represents
        """

        lumaConnection = LumaConnectionWrapper(self.smartObject.getServerMeta())
        bindSuccess, exceptionObject = lumaConnection.bindSync()

        if not bindSuccess:
            message = self.str_BIND
            return (False, message, exceptionObject)

        success, exceptionObject = lumaConnection.delete(self.smartObject.getDN())
        lumaConnection.unbind()

        if success:
            #serverName = self.smartObject.getServerAlias()
            #dn = self.smartObject.getPrettyParentDN()
            #self.model().reloadItem(self.smartObject.parent())
            #self.modelChangedSignal.emit()
            return (True, None, None)
        else:
            message = self.str_DELETE
            return (False, message, exceptionObject)