Ticket #269: Do not requery connection when updating.

This commit is contained in:
Michael Jumper
2013-02-26 21:24:09 -08:00
parent 39a2d4eae7
commit 66fece64f4

View File

@@ -199,12 +199,15 @@ public class ConnectionDirectory implements Directory<String, Connection>{
@Override @Override
public void update(Connection object) throws GuacamoleException { public void update(Connection object) throws GuacamoleException {
// If connection not actually from this auth provider, we can't handle
// the update
if (!(object instanceof MySQLConnection))
throw new GuacamoleException("Connection not from database.");
// Verify permission to update // Verify permission to update
permissionCheckService.verifyConnectionUpdateAccess(this.user_id, object.getIdentifier()); permissionCheckService.verifyConnectionUpdateAccess(this.user_id, object.getIdentifier());
// TODO: Rely on update() to be given MySQLConnection MySQLConnection mySQLConnection = (MySQLConnection) object;
MySQLConnection mySQLConnection =
providerService.getExistingMySQLConnection(object);
// Create database object for insert // Create database object for insert
net.sourceforge.guacamole.net.auth.mysql.model.Connection connection = net.sourceforge.guacamole.net.auth.mysql.model.Connection connection =