Package models.data

Examples of models.data.User


    @Required(message = "E-mail is required")
    @Email(message = "Invalid e-mail supplied")
    public String email;

    public String validate() {
        User user = User.findByEmail(email);
        if (user == null) {
            //no such user
            return "user not found";
        }
        //handle the toggle user isEnabled process
        play.Logger.warn(""+user.getIsEnabled());
       
       
        if (user.getIsEnabled() == 1){
             play.Logger.warn("disable");
            user.setIsEnabled(0);
        }
        else{
           user.setIsEnabled(1);
        }
        user.save();
     
        return null;
    }
View Full Code Here


    public String validate() {
        if (!password.equals(password2)) {
            return ApplicationConstants.PASSWORD_MISMATCH;
        }

        User user = User.findByEmail(email);
        if (user != null) {
            return ApplicationConstants.USER_ALREADY_REGISTERED;
        }

        //do registration
        user = new Player();
        user.setFirstName(firstName);
        user.setLastName(lastName);
        user.setEmail(email);
        user.setPassword(password);
        user.setIsEnabled(ApplicationConstants.TRUE);
        user.save();

        return null;
    }
View Full Code Here

    }

    public static Result playGame(int gameId) {
        Game game = Game.find.byId(gameId + "");
        User currentUser = UserManager.getCurrentLoggedInUser();
        if (game == null) {
            return notFound(game_playGame_notFound.render());
        }

        if (!game.canJoinGame(currentUser)) {
View Full Code Here

     * @param gameForm
     * @return
     */
    public Game createFixedTimeChallengeGame(GameForm gameForm) {
        FixedTimeChallengeGame game = new FixedTimeChallengeGame();
        User user = UserManager.getCurrentLoggedInUser();
        // if user is not in the session, then cannot create game
        if (user == null) {
            return null;
        }

View Full Code Here

        //save new virtual current date if no gotten
        if (game.getVirtualStartDate() != null) {
            game.setVirtualCurrentDate(TimeKeeper.convert(game));
            game.save();
        }
        User player = UserManager.getCurrentLoggedInUser();

        // set the game state
        List<GamePlayer> gamePlayers = game.getPlayers();

        gameState.setPlayers(gamePlayers);
View Full Code Here

public class ManagementController extends Controller {

    public static Result index() {
        GameManager gm = new GameManager();
        User user = UserManager.getCurrentLoggedInUser();
        if (user != null && user.isAdmin()) {
            return ok(management.render(gm.getStockList(), "", "stockTab"));
        } else {
            return ok("You don't have acess to Admin DashBoard!");
        }
View Full Code Here

    public static Result stockList() {
        return TODO;
    }

    public static Result addStock() {
        User user = UserManager.getCurrentLoggedInUser();
        if (user != null && user.isAdmin()) {

            boolean success = true;
            GameManager gm = new GameManager();

            Form<StockForm> stockForm = Form.form(StockForm.class).bindFromRequest();
View Full Code Here

            return ok("You don't have acess to Admin DashBoard!");
        }
    }

    public static Result deleteStock() {
        User user = UserManager.getCurrentLoggedInUser();
        if (user != null && user.isAdmin()) {

            boolean success = true;
            GameManager gm = new GameManager();
            Form<StockForm> stockForm = Form.form(StockForm.class).bindFromRequest();
            if (stockForm.hasErrors()) {
View Full Code Here

            return ok("You don't have acess to Admin DashBoard!");
        }
    }

    public static Result toggleStock() {
        User user = UserManager.getCurrentLoggedInUser();
        if (user != null && user.isAdmin()) {

            boolean success = true;
            GameManager gm = new GameManager();
            int rs = 1;
            Form<StockForm> stockForm = Form.form(StockForm.class).bindFromRequest();
View Full Code Here

    public static Result player() {
        return TODO;
    }

    public static Result playerToggle() {
        User user = UserManager.getCurrentLoggedInUser();
        if (user != null && user.isAdmin()) {
            GameManager gm = new GameManager();
            Form<UserForm> userForm = Form.form(UserForm.class).bindFromRequest();
            if (userForm.hasErrors()) {
                return ok(management.render(gm.getStockList(), "Failed enable/disable User", "userTab"));
            } else {
View Full Code Here

TOP

Related Classes of models.data.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.