diff options
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java')
-rw-r--r-- | id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java new file mode 100644 index 000000000..3f4b21fdd --- /dev/null +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java @@ -0,0 +1,62 @@ +package at.gv.egovernment.moa.id.configuration.struts.action; + +import java.util.Date; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.interceptor.ServletRequestAware; +import org.apache.struts2.interceptor.ServletResponseAware; + +import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; +import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; +import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; +import at.gv.egovernment.moa.id.configuration.Constants; +import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; + +import com.opensymphony.xwork2.ActionSupport; + +public class UserManagementAction extends ActionSupport + implements ServletRequestAware, ServletResponseAware { + + private static final long serialVersionUID = 1L; + + private HttpServletRequest request; + private HttpServletResponse response; + + private AuthenticatedUser authUser; + + + public String createTestUser() throws MOADatabaseException { + + UserDatabase user = new UserDatabase(); + user.setBpk(""); + user.setFamilyname("Max"); + user.setGivenname("Mustermann"); + user.setIsActive(true); + user.setIsAdmin(false); + user.setInstitut("EGIZ"); + user.setLastLoginItem(new Date()); + user.setMail("masdf@amfasdf.com"); + user.setPhone("00660011542"); + user.setUsername("testuser"); + + ConfigurationDBUtils.save(user); + + return Constants.STRUTS_SUCCESS; + } + + + public void setServletResponse(HttpServletResponse response) { + this.response = response; + + } + + public void setServletRequest(HttpServletRequest request) { + this.request = request; + + } + + + +} |