	public static Result register(){
		Form<Register> registerForm = form(Register.class).bindFromRequest();
		Pattern pattern = Pattern.compile("[^a-z ]", Pattern.CASE_INSENSITIVE);
		Matcher matcher = pattern.matcher(registerForm.get().name);
		List<Link> breadcrumbs = new ArrayList<Link>();
		breadcrumbs.add(new Link("Home", "/"));
		breadcrumbs.add(new Link("Sign Up", "/signup"));
		if(!registerForm.get().email.isEmpty()){
			if(Ebean.find(UserModel.class).where().eq(
					"email",registerForm.get().email).findUnique() != null){
				flash("error", EMessages.get(EMessages.get("register.same_email")));
				return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, registerForm));
			}
		}
		if(registerForm.hasErrors()){
			flash("error", EMessages.get(EMessages.get("error.text")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, form(Register.class).bindFromRequest()));
		}
		if(matcher.find()){
			flash("error", EMessages.get(EMessages.get("error.invalid_symbols")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, form(Register.class).bindFromRequest()));
		}
		pattern = Pattern.compile("[^a-z._+@0-9!#$%&'*+-/=?^_`{|}~]");
		matcher = pattern.matcher(registerForm.get().email);
		if(matcher.find()){
			flash("error", EMessages.get(EMessages.get("error.invalid_email")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, form(Register.class).bindFromRequest()));
		}
		try{
			new SimpleDateFormat("yyyy/mm/dd").parse(registerForm.get().bday);
		}catch(Exception e){
			flash("error", EMessages.get(EMessages.get("error.invalid_date")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, form(Register.class).bindFromRequest()));
		}
		String bebrasID = null;
		try {
			bebrasID = AuthenticationManager.getInstance().createUser(registerForm);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ok(registerLandingPage.render(EMessages.get("info.success"), new ArrayList<Link>(), bebrasID));
	}

	public static Result register(){
		Form<Register> registerForm = form(Register.class).bindFromRequest();
		Pattern pattern = Pattern.compile("[^a-z ]", Pattern.CASE_INSENSITIVE);
		Matcher matcher = pattern.matcher(registerForm.get().name);
		List<Link> breadcrumbs = new ArrayList<Link>();
		breadcrumbs.add(new Link("Home", "/"));
		breadcrumbs.add(new Link("Sign Up", "/signup"));
		if(!registerForm.get().email.isEmpty()){
			if(Ebean.find(UserModel.class).where().eq(
					"email",registerForm.get().email).findUnique() != null){
				flash("error", EMessages.get(EMessages.get("register.same_email")));
				return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, registerForm));
			}
		}
		if(registerForm.hasErrors()){
			flash("error", EMessages.get(EMessages.get("error.text")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, registerForm));
		}
		if(matcher.find()){
			flash("error", EMessages.get(EMessages.get("error.invalid_symbols")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, registerForm));
		}
		pattern = Pattern.compile("[^a-z._+@0-9!#$%&'*+-/=?^_`{|}~]");
		matcher = pattern.matcher(registerForm.get().email);
		if(matcher.find()){
			flash("error", EMessages.get(EMessages.get("error.invalid_email")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, registerForm));
		}
		try{
			new SimpleDateFormat("yyyy/mm/dd").parse(registerForm.get().bday);
		}catch(Exception e){
			flash("error", EMessages.get(EMessages.get("error.invalid_date")));
			return badRequest(register.render((EMessages.get("register.title")), breadcrumbs, registerForm));
		}
		String bebrasID = null;
		try {
			bebrasID = AuthenticationManager.getInstance().createUser(registerForm);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ok(registerLandingPage.render(EMessages.get("info.success"), new ArrayList<Link>(), bebrasID));
	}
