dirname is new user property

This commit is contained in:
Peter Hormanns 2021-08-13 14:30:40 +02:00
parent b5cded8fe6
commit bdbbc57d05

View File

@ -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() + "\"");