transfer user property locked

This commit is contained in:
Peter Hormanns 2015-12-23 17:06:20 +01:00
parent 0be76b6c23
commit 88f944afa1
2 changed files with 9 additions and 0 deletions

View File

@ -190,6 +190,10 @@ public abstract class AbstractRemote implements IRemote {
return integ != null;
}
protected boolean assertNotNull(Boolean bool) {
return bool != null;
}
protected void replaceKey(Map<String, String> whereParams, String shortKey, String regularKey) {
if (whereParams.containsKey(shortKey)) {
final String value = whereParams.get(shortKey);

View File

@ -23,6 +23,7 @@ public class UnixUserRemote extends AbstractRemote {
map.put("pac", user.getPac().getName());
map.put("shell", user.getShell());
map.put("homedir", user.getHomedir());
map.put("locked", user.isLocked());
Integer quotaSoft = user.getQuotaSoftlimit();
if (assertNotNull(quotaSoft)) {
map.put("quota_softlimit", quotaSoft.toString());
@ -72,6 +73,10 @@ public class UnixUserRemote extends AbstractRemote {
if (assertNotNull(quotaLimit)) {
user.setQuotaHardlimit(Integer.parseInt(quotaLimit));
}
Boolean locked = (Boolean) map.get("locked");
if (assertNotNull(locked)) {
user.setLocked(locked);
}
}
@Override