Package org.ofbiz.pos.component

Examples of org.ofbiz.pos.component.InputWithPassword


        this.setVisible(false);

        // setup the shared components
        this.session = XuiContainer.getSession();
        this.output = new Output(this);
        this.input = new InputWithPassword(this);
        this.journal = new Journal(this);
        this.operator = new Operator(this);
        this.setLastActivity(System.currentTimeMillis());

        if (!firstInit) {
View Full Code Here


    }

    private static synchronized void baseLogin(PosScreen pos, boolean mgr) {
        XuiSession session = pos.getSession();
        Output output = pos.getOutput();
        InputWithPassword input = pos.getInput();

        String loginFunc = mgr ? "MGRLOGIN" : "LOGIN";
        String[] func = input.getLastFunction();
        String text = input.value();
        if (func != null && func[0].equals(loginFunc)) {
            if (UtilValidate.isEmpty(func[1]) && UtilValidate.isEmpty(text)) {
                output.print(UtilProperties.getMessage(PosTransaction.resource,"PosULogin",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput( false);
            } else if (UtilValidate.isEmpty(func[1])) {
                output.print(UtilProperties.getMessage(PosTransaction.resource,"PosUPassw",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput( true);
            } else {
                input.setPasswordInput( false);
                String username = func[1];
                String password = text;
                if (!mgr) {
                    boolean passed = false;
                    try {
                        session.login(username, password);
                        passed = true;
                    } catch (XuiSession.UserLoginFailure e) {
                        input.clear();
                        input.setFunction(loginFunc);
                        output.print(e.getMessage() + " " +  UtilProperties.getMessage(PosTransaction.resource,"PosULogin",Locale.getDefault()));
                    }
                    if (passed) {
                        input.clear();
                        pos.setLock(false);
                        pos.refresh();
                        return;
                    }
                } else {
                    GenericValue mgrUl = null;
                    try {
                        mgrUl = session.checkLogin(username, password);
                    } catch (XuiSession.UserLoginFailure e) {
                        output.print(e.getMessage());
                        input.clear();
                    }
                    if (mgrUl != null) {
                        boolean isMgr = session.hasRole(mgrUl, "MANAGER");
                        if (!isMgr) {
                            output.print(UtilProperties.getMessage(PosTransaction.resource,"PosUserNotManager",Locale.getDefault()));
                            input.clear();
                        } else {
                            ManagerEvents.mgrLoggedIn = true;
                            pos.showPage("mgrpanel");
                        }
                    }
View Full Code Here

        this.setVisible(false);

        // setup the shared components
        this.session = XuiContainer.getSession();
        this.output = new Output(this);
        this.input = new InputWithPassword(this);
        this.journal = new Journal(this);
        this.operator = new Operator(this);
        this.promoStatusBar = new PromoStatusBar(this);
        this.setLastActivity(System.currentTimeMillis());
View Full Code Here

        this.setVisible(false);

        // setup the shared components
        this.session = XuiContainer.getSession();
        this.output = new Output(this);
        this.input = new InputWithPassword(this);
        this.journal = new Journal(this);
        this.operator = new Operator(this);
        this.promoStatusBar = new PromoStatusBar(this);
        this.setLastActivity(System.currentTimeMillis());
View Full Code Here

    }

    private static synchronized void baseLogin(PosScreen pos, boolean mgr) {
        XuiSession session = pos.getSession();
        Output output = pos.getOutput();
        InputWithPassword input = pos.getInput();

        String loginFunc = mgr ? "MGRLOGIN" : "LOGIN";
        String[] func = input.getLastFunction();
        String text = input.value();
        if (func != null && func[0].equals(loginFunc)) {
            if (UtilValidate.isEmpty(func[1]) && UtilValidate.isEmpty(text)) {
                output.print(UtilProperties.getMessage(PosTransaction.resource,"PosULogin",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput(false);
            } else if (UtilValidate.isEmpty(func[1])) {
                output.print(UtilProperties.getMessage(PosTransaction.resource,"PosUPassw",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput(true);
            } else {
                input.setPasswordInput(false);
                String username = func[1];
                String password = text;
                if (!mgr) {
                    boolean passed = false;
                    try {
                        session.login(username, password);
                        passed = true;
                    } catch (XuiSession.UserLoginFailure e) {
                        input.clear();
                        input.setFunction(loginFunc);
                        output.print(e.getMessage() + " " +  UtilProperties.getMessage(PosTransaction.resource,"PosULogin",Locale.getDefault()));
                    }
                    if (passed) {
                        input.clear();
                        pos.setLock(false);
                        pos.refresh();
                        return;
                    }
                } else {
                    GenericValue mgrUl = null;
                    try {
                        mgrUl = session.checkLogin(username, password);
                    } catch (XuiSession.UserLoginFailure e) {
                        output.print(e.getMessage());
                        input.clear();
                    }
                    if (mgrUl != null) {
                        boolean isMgr = session.hasRole(mgrUl, "MANAGER");
                        if (!isMgr) {
                            output.print(UtilProperties.getMessage(PosTransaction.resource,"PosUserNotManager",Locale.getDefault()));
                            input.clear();
                        } else {
                            ManagerEvents.mgrLoggedIn = true;
                            pos.showPage("mgrpanel");
                        }
                    }
View Full Code Here

    }

    private static synchronized void baseLogin(PosScreen pos, boolean mgr) {
        XuiSession session = pos.getSession();
        Output output = pos.getOutput();
        InputWithPassword input = pos.getInput();

        String loginFunc = mgr ? "MGRLOGIN" : "LOGIN";
        String[] func = input.getLastFunction();
        String text = input.value();
        if (func != null && func[0].equals(loginFunc)) {
            if (UtilValidate.isEmpty(func[1]) && UtilValidate.isEmpty(text)) {
                output.print(UtilProperties.getMessage(PosTransaction.resource,"PosULogin",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput(false);
            } else if (UtilValidate.isEmpty(func[1])) {
                output.print(UtilProperties.getMessage(PosTransaction.resource,"PosUPassw",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput(true);
            } else {
                input.setPasswordInput(false);
                String username = func[1];
                String password = text;
                if (!mgr) {
                    boolean passed = false;
                    try {
                        session.login(username, password);
                        passed = true;
                    } catch (XuiSession.UserLoginFailure e) {
                        input.clear();
                        input.setFunction(loginFunc);
                        output.print(e.getMessage() + " " +  UtilProperties.getMessage(PosTransaction.resource,"PosULogin",Locale.getDefault()));
                    }
                    if (passed) {
                        input.clear();
                        pos.setLock(false);
                        pos.refresh();
                        return;
                    }
                } else {
                    GenericValue mgrUl = null;
                    try {
                        mgrUl = session.checkLogin(username, password);
                    } catch (XuiSession.UserLoginFailure e) {
                        output.print(e.getMessage());
                        input.clear();
                    }
                    if (mgrUl != null) {
                        boolean isMgr = session.hasRole(mgrUl, "MANAGER");
                        if (!isMgr) {
                            output.print(UtilProperties.getMessage(PosTransaction.resource,"PosUserNotManager",Locale.getDefault()));
                            input.clear();
                        } else {
                            ManagerEvents.mgrLoggedIn = true;
                            pos.showPage("mgrpanel");
                        }
                    }
View Full Code Here

        this.setVisible(false);

        // setup the shared components
        this.session = XuiContainer.getSession();
        this.output = new Output(this);
        this.input = new InputWithPassword(this);
        this.journal = new Journal(this);
        this.operator = new Operator(this);
        this.promoStatusBar = new PromoStatusBar(this);
        this.setLastActivity(System.currentTimeMillis());
View Full Code Here

        this.setVisible(false);

        // setup the shared components
        this.session = XuiContainer.getSession();
        this.output = new Output(this);
        this.input = new InputWithPassword(this);
        this.journal = new Journal(this);
        this.operator = new Operator(this);
        this.promoStatusBar = new PromoStatusBar(this);
        this.setLastActivity(System.currentTimeMillis());
View Full Code Here

        this.setVisible(false);

        // setup the shared components
        this.session = XuiContainer.getSession();
        this.output = new Output(this);
        this.input = new InputWithPassword(this);
        this.journal = new Journal(this);
        this.operator = new Operator(this);
        this.setLastActivity(System.currentTimeMillis());

        if (!firstInit) {
View Full Code Here

    }

    private static synchronized void baseLogin(PosScreen pos, boolean mgr) {
        XuiSession session = pos.getSession();
        Output output = pos.getOutput();
        InputWithPassword input = pos.getInput();

        String loginFunc = mgr ? "MGRLOGIN" : "LOGIN";
        String[] func = input.getLastFunction();
        String text = input.value();
        if (func != null && func[0].equals(loginFunc)) {
            if (UtilValidate.isEmpty(func[1]) && UtilValidate.isEmpty(text)) {
                output.print(UtilProperties.getMessage("pos","ULOGIN",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput( false);
            } else if (UtilValidate.isEmpty(func[1])) {
                output.print(UtilProperties.getMessage("pos","UPASSW",Locale.getDefault()));
                input.setFunction(loginFunc);
                input.setPasswordInput( true);
            } else {
                input.setPasswordInput( false);
                String username = func[1];
                String password = text;
                if (!mgr) {
                    boolean passed = false;
                    try {
                        session.login(username, password);
                        passed = true;
                    } catch (XuiSession.UserLoginFailure e) {
                        input.clear();
                        input.setFunction(loginFunc);
                        output.print(e.getMessage() + " " +  UtilProperties.getMessage("pos","ULOGIN",Locale.getDefault()));
                    }
                    if (passed) {
                        input.clear();
                        pos.setLock(false);
                        pos.refresh();
                        return;
                    }
                } else {
                    GenericValue mgrUl = null;
                    try {
                        mgrUl = session.checkLogin(username, password);
                    } catch (XuiSession.UserLoginFailure e) {
                        output.print(e.getMessage());
                        input.clear();
                    }
                    if (mgrUl != null) {
                        boolean isMgr = session.hasRole(mgrUl, "MANAGER");
                        if (!isMgr) {
                            output.print(UtilProperties.getMessage("pos","UserNotmanager",Locale.getDefault()));
                            input.clear();
                        } else {
                            ManagerEvents.mgrLoggedIn = true;
                            pos.showPage("mgrpanel");                           
                        }
                    }
View Full Code Here

TOP

Related Classes of org.ofbiz.pos.component.InputWithPassword

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.