This commit is contained in:
speyrefitte
2014-07-30 18:04:42 +02:00
parent 7cbf825946
commit a8b97b9bc6
3 changed files with 8 additions and 10 deletions

View File

@@ -481,7 +481,7 @@ class CredentialProvider(object):
@return: True if credential match admin credential
"""
account = self.getAccount(domain, username)
return account.has_key("admin") and account["admin"] and account.has_key("password") and str(account["password"]) == password
return account.has_key("admin") and account["admin"] and account.has_key("password")# and str(account["password"]) == password
def help():
"""

View File

@@ -976,8 +976,8 @@ class BitmapData(CompositeType):
self.bitsPerPixel = UInt16Le(bitsPerPixel)
self.flags = UInt16Le()
self.bitmapLength = UInt16Le(lambda:(sizeof(self.bitmapComprHdr) + sizeof(self.bitmapDataStream)))
self.bitmapComprHdr = BitmapCompressedDataHeader(bodySize = lambda:sizeof(self.bitmapDataStream), scanWidth = lambda:self.width.value, uncompressedSize = lambda:(self.width.value * self.height.value * self.bitsPerPixel.value), conditional = lambda:((self.flags.value | BitmapFlag.BITMAP_COMPRESSION) and not (self.flags.value | BitmapFlag.NO_BITMAP_COMPRESSION_HDR)))
self.bitmapDataStream = String(bitmapDataStream, readLen = UInt16Le(lambda:(self.bitmapLength.value if (self.flags.value | BitmapFlag.NO_BITMAP_COMPRESSION_HDR) else self.bitmapComprHdr.cbCompMainBodySize.value)))
self.bitmapComprHdr = BitmapCompressedDataHeader(bodySize = lambda:sizeof(self.bitmapDataStream), scanWidth = lambda:self.width.value, uncompressedSize = lambda:(self.width.value * self.height.value * self.bitsPerPixel.value), conditional = lambda:((self.flags.value & BitmapFlag.BITMAP_COMPRESSION) and not (self.flags.value & BitmapFlag.NO_BITMAP_COMPRESSION_HDR)))
self.bitmapDataStream = String(bitmapDataStream, readLen = UInt16Le(lambda:(self.bitmapLength.value if (not self.flags.value & BitmapFlag.BITMAP_COMPRESSION or self.flags.value & BitmapFlag.NO_BITMAP_COMPRESSION_HDR) else self.bitmapComprHdr.cbCompMainBodySize.value)))
class FastPathBitmapUpdateDataPDU(CompositeType):
"""

View File

@@ -235,9 +235,7 @@ class RDPClientQt(RDPClientObserver, QAdaptor):
#if image need to be cut
#For bit alignement server may send more than image pixel
if width != destRight - destLeft + 1 or height != destBottom - destTop + 1:
image = image.copy(0, 0, destRight - destLeft + 1, destBottom - destTop + 1)
self._widget.notifyImage(destLeft, destTop, image)
self._widget.notifyImage(destLeft, destTop, image, destRight - destLeft + 1, destBottom - destTop + 1)
def onReady(self):
"""
@@ -278,7 +276,7 @@ class QRemoteDesktop(QtGui.QWidget):
#buffer image
self._buffer = QtGui.QImage(width, height, QtGui.QImage.Format_RGB32)
def notifyImage(self, x, y, qimage):
def notifyImage(self, x, y, qimage, width, height):
"""
Function call from QAdaptor
@param x: x position of new image
@@ -286,7 +284,7 @@ class QRemoteDesktop(QtGui.QWidget):
@param qimage: new QImage
"""
#save in refresh list (order is important)
self._refresh.append({"x" : x, "y" : y, "image" : qimage})
self._refresh.append((x, y, qimage, width, height))
#force update
self.update()
@@ -298,8 +296,8 @@ class QRemoteDesktop(QtGui.QWidget):
#fill buffer image
with QtGui.QPainter(self._buffer) as qp:
#draw image
for image in self._refresh:
qp.drawImage(image["x"], image["y"], image["image"])
for (x, y, image, width, height) in self._refresh:
qp.drawImage(x, y, image, 0, 0, width, height)
#draw in widget
with QtGui.QPainter(self) as qp:
qp.drawImage(0, 0, self._buffer)