From bdbbc57d05c9e324e0ca5e502e24dedf9b462a73 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Fri, 13 Aug 2021 14:30:40 +0200 Subject: [PATCH] dirname is new user property --- hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java b/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java index 2bb2c3c..98fbb56 100644 --- a/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java +++ b/hsarback/src/de/hsadmin/pillar/JsonPillarServlet.java @@ -121,7 +121,10 @@ public class JsonPillarServlet extends HttpServlet { } else { writer.println(" , {"); } - writer.println(" \"user\": \"" + user.getName() + "\""); + final String fullUsername = user.getName(); + final String usernamePostfix = fullUsername.length() > 6 ? fullUsername.substring(6) : "_"; + writer.println(" \"user\": \"" + fullUsername + "\""); + writer.println(" \"dirname\": \"" + usernamePostfix + "\""); writer.println(" , \"uid\": " + user.getUserId()); writer.println(" , \"comment\": \"" + user.getComment() + "\""); writer.println(" , \"shell\": \"" + user.getShell() + "\"");