remove duplicated admin group and user configuration

This commit is contained in:
Sebastian Sdorra
2011-02-08 19:46:19 +01:00
parent 8b97cfe9b0
commit b1eb19d087
3 changed files with 0 additions and 146 deletions

View File

@@ -137,7 +137,6 @@ public class PAMAuthenticationHandler implements AuthenticationHandler
{
User user = new User(username);
user.setAdmin(isAdmin(unixUser));
result = new AuthenticationResult(user, unixUser.getGroups());
}
}
@@ -229,40 +228,6 @@ public class PAMAuthenticationHandler implements AuthenticationHandler
this.config = config;
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @param unixUser
*
* @return
*/
private boolean isAdmin(UnixUser unixUser)
{
boolean admin = false;
if (config.getAdminUserSet().contains(unixUser.getUserName()))
{
admin = true;
}
else
{
for (String group : unixUser.getGroups())
{
if (config.getAdminGroupSet().contains(group))
{
admin = true;
break;
}
}
}
return admin;
}
//~--- fields ---------------------------------------------------------------
/** Field description */

View File

@@ -52,28 +52,6 @@ import javax.xml.bind.annotation.XmlRootElement;
public class PAMConfig
{
/**
* Method description
*
*
* @return
*/
public String getAdminGroups()
{
return adminGroups;
}
/**
* Method description
*
*
* @return
*/
public String getAdminUsers()
{
return adminUsers;
}
/**
* Method description
*
@@ -87,28 +65,6 @@ public class PAMConfig
//~--- set methods ----------------------------------------------------------
/**
* Method description
*
*
* @param adminGroups
*/
public void setAdminGroups(String adminGroups)
{
this.adminGroups = adminGroups;
}
/**
* Method description
*
*
* @param adminUsers
*/
public void setAdminUsers(String adminUsers)
{
this.adminUsers = adminUsers;
}
/**
* Method description
*
@@ -120,65 +76,8 @@ public class PAMConfig
this.serviceName = serviceName;
}
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
Set<String> getAdminGroupSet()
{
return split(adminGroups);
}
/**
* Method description
*
*
* @return
*/
Set<String> getAdminUserSet()
{
return split(adminUsers);
}
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @param rawString
*
* @return
*/
private Set<String> split(String rawString)
{
Set<String> tokens = new HashSet<String>();
for (String token : rawString.split(","))
{
if (token.trim().length() > 0)
{
tokens.add(token);
}
}
return tokens;
}
//~--- fields ---------------------------------------------------------------
/** Field description */
@XmlElement(name = "admin-groups")
private String adminGroups = "";
/** Field description */
@XmlElement(name = "admin-users")
private String adminUsers = "";
/** Field description */
@XmlElement(name = "service-name")
private String serviceName = "sshd";

View File

@@ -38,16 +38,6 @@ registerGeneralConfigPanel({
fieldLabel : 'Service name',
name : 'service-name',
allowBlank : false
},{
xtype : 'textfield',
fieldLabel : 'Admin Groups',
name : 'admin-groups',
allowBlank : true
},{
xtype : 'textfield',
fieldLabel : 'Admin Users',
name : 'admin-users',
allowBlank : true
}],
onSubmit: function(values){