mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1224: Log extension sources of objects affected by REST API.
This commit is contained in:
@@ -55,6 +55,7 @@ public class AffectedObject implements LoggableDetail {
|
|||||||
|
|
||||||
Object object = event.getObject();
|
Object object = event.getObject();
|
||||||
String identifier = event.getObjectIdentifier();
|
String identifier = event.getObjectIdentifier();
|
||||||
|
String dataSource = event.getAuthenticationProvider().getIdentifier();
|
||||||
|
|
||||||
String objectType;
|
String objectType;
|
||||||
String name = null; // Not all objects have names
|
String name = null; // Not all objects have names
|
||||||
@@ -95,8 +96,8 @@ public class AffectedObject implements LoggableDetail {
|
|||||||
// Users
|
// Users
|
||||||
case USER:
|
case USER:
|
||||||
|
|
||||||
if (identifier.equals(event.getAuthenticatedUser().getIdentifier()))
|
if (identifier != null && identifier.equals(event.getAuthenticatedUser().getIdentifier()))
|
||||||
return "their own user account";
|
return "their own user account within \"" + dataSource + "\"";
|
||||||
|
|
||||||
objectType = "user";
|
objectType = "user";
|
||||||
break;
|
break;
|
||||||
@@ -116,12 +117,12 @@ public class AffectedObject implements LoggableDetail {
|
|||||||
// including the name of the object, as well, if available
|
// including the name of the object, as well, if available
|
||||||
if (identifier != null) {
|
if (identifier != null) {
|
||||||
if (name != null)
|
if (name != null)
|
||||||
return objectType + " \"" + identifier + "\" (currently named \"" + name + "\")";
|
return objectType + " \"" + identifier + "\" within \"" + dataSource + "\" (currently named \"" + name + "\")";
|
||||||
else
|
else
|
||||||
return objectType + " \"" + identifier + "\"";
|
return objectType + " \"" + identifier + "\" within \"" + dataSource + "\"";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return objectType;
|
return objectType + " within \"" + dataSource + "\"";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user