public String login() {
		User fetchUser = userHelper.getUser(username, password);

		if (fetchUser != null) {
			// success
			user = fetchUser;
			loggedIn = true;
			if (user.getType().equals("admin")) {
				admin = true;
				librarian = true;
			}
			if (user.getType().equals("librarian")) librarian = true;

			// ako je januar, pustaj sve
			if (Calendar.getInstance().get(Calendar.MONTH) == 0) return "index";

			// monthly awards trigger
			SystemBean.monthlyAwards();

			// unactive
			if (user.getActive() == null || !user.getActive()) {
				FacesMessage message = new FacesMessage("Nalog neaktivan. Morate platiti članarinu i sačekati odobrenje administratora.");
				FacesContext context = FacesContext.getCurrentInstance();
				context.addMessage(btnLogin.getClientId(context), message);

				return null;
			}

			return "search";
		}
		else {
			// invalid
            FacesMessage message = new FacesMessage("Podaci nisu ispravni");
            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(btnLogin.getClientId(context), message);

			return null;
		}
	}