Subversion Repositories WebE

Rev

Rev 33 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33 Rev 37
Line 1... Line 1...
1
package ch.ffhs.webE.action;
1
package ch.ffhs.webE.action;
2
2
3
import java.util.Map;
3
import java.util.Map;
4
4
5
import ch.ffhs.webE.dao.UserDAOImpl;
5
import ch.ffhs.webE.dao.UserDAO;
6
import ch.ffhs.webE.domain.User;
6
import ch.ffhs.webE.domain.User;
7
7
8
import com.opensymphony.xwork2.Action;
8
import com.opensymphony.xwork2.Action;
9
import com.opensymphony.xwork2.ActionContext;
9
import com.opensymphony.xwork2.ActionContext;
10
import com.opensymphony.xwork2.ActionSupport;
10
import com.opensymphony.xwork2.ActionSupport;
Line 13... Line 13...
13
public class LoginAction extends ActionSupport implements ModelDriven<User>
13
public class LoginAction extends ActionSupport implements ModelDriven<User>
14
{
14
{
15
15
16
  private static final long serialVersionUID = 1799753056277211344L;
16
  private static final long serialVersionUID = 1799753056277211344L;
17
  private final User user = new User();
17
  private final User user = new User();
18
  private final UserDAOImpl userDAO = new UserDAOImpl();
18
  private final UserDAO userDAO = new UserDAO();
19
19
20
  /* Form fields */
20
  /* Form fields */
21
  private String userName;
21
  private String userName;
22
  private String pw;
22
  private String pw;
23
23
Line 82... Line 82...
82
   * @return
82
   * @return
83
   */
83
   */
84
  public String verifyUser(String username, String password)
84
  public String verifyUser(String username, String password)
85
  {
85
  {
86
    // DB Query
86
    // DB Query
87
    User u = this.userDAO.searchUsername(username);
87
    User u = this.userDAO.getByUsername(username);
88
88
89
    // User does not exist
89
    // User does not exist
90
    if (u == null)
90
    if (u == null)
91
    {
91
    {
92
      return Action.ERROR;
92
      return Action.ERROR;