1   /*
2    * Apache License
3    * Version 2.0, January 2004
4    * http://www.apache.org/licenses/
5    *
6    * Copyright 2008 by chenillekit.org
7    *
8    * Licensed under the Apache License, Version 2.0 (the "License");
9    * you may not use this file except in compliance with the License.
10   * You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   */
14  
15  package org.chenillekit.access.pages;
16  
17  import org.apache.tapestry5.annotations.Persist;
18  import org.apache.tapestry5.ioc.annotations.Inject;
19  import org.slf4j.Logger;
20  
21  
22  /**
23   * Login page. The user is given three login attempts, or else the browser session will need to be closed.
24   *
25   * @version $Id: Login.java 380 2008-12-30 10:21:52Z mlusetti $
26   */
27  public class Login
28  {
29  	private static final int MAX_LOGIN_ATTEMPTS = 3;
30  	
31  	@SuppressWarnings("unused")
32  	@Inject
33  	private Logger logger;
34  
35  //	@Inject
36  //	private ComponentResources resources;
37  
38  	@Persist
39  	private int loginAttempts;
40  
41  	final public boolean isLoginAllowed()
42  	{
43  		return loginAttempts < MAX_LOGIN_ATTEMPTS;
44  	}
45  	
46  	void onActivate()
47  	{
48  	}
49  }