Package net.datacrow.core.security

Examples of net.datacrow.core.security.SecuredUser


       
        PluginHelper.addListener(buttonSave, "SaveAll", view.getModule().getIndex());
        PluginHelper.addListener(buttonRemove, "RemoveRow", view.getModule().getIndex());
   
        // Build the panel
        SecuredUser user = SecurityCentre.getInstance().getUser();
           
        if (user == null || user.isEditingAllowed(view.getModule()))
          panelActionsRight.add(buttonSave);
       
        buttonSave.setEnabled(user == null || user.isEditingAllowed(view.getModule()));
       
        if view.getType() == View._TYPE_INSERT &&
                (user == null || user.isEditingAllowed(view.getModule()))) {
            panelActionsLeft.add(buttonRemove);
            panelActionsLeft.add(buttonAdd);
        }
   
        for (Component c: view.getAdditionalActions())
            panelActionsLeft.add(c);
   
        if (view.getType() == View._TYPE_INSERT)
            panelActionsRight.add(buttonClear);
   
        if (user == null || user.isEditingAllowed(view.getModule()))
          panelActionsRight.add(buttonCancel);
       
        setLayout(Layout.getGBL());
        add(panelActionsLeft, Layout.getGBC(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0));
View Full Code Here


        FacesContext fc = FacesContext.getCurrentInstance();
        VariableResolver vr = fc.getApplication().getVariableResolver();
        DcWebUser wu = (DcWebUser) vr.resolveVariable(fc, "user");
       
        try {
            SecuredUser su = SecurityCentre.getInstance().login(wu.getUsername(), wu.getPassword(), true);
            wu.setSecuredUser(su);
            DcWebModules modules = (DcWebModules) vr.resolveVariable(fc, "modules");
            modules.load();
        } catch (SecurityException se) {
            fc.addMessage("loginError", new FacesMessage(se.getMessage()));
View Full Code Here

    private void changePassword() {
        String currentPass = String.valueOf(fldCurrentPassword.getPassword());
       
        try {
            SecurityCentre sc = SecurityCentre.getInstance();
            SecuredUser su = sc.login(sc.getUser().getUsername(), currentPass, false);
            if (su != null) {
               
                String newPass1 = String.valueOf(fldNewPassword1.getPassword());
                String newPass2 = String.valueOf(fldNewPassword2.getPassword());

                if (newPass1.length() == 0 || newPass2.length() == 0) {
                    DcSwingUtilities.displayMessage("msgPleaseEnterNewPassword");
                } else if (newPass1.equals(newPass2)){
                    sc.changePassword(su.getUser(), newPass1);
                    close();
                } else {
                    DcSwingUtilities.displayMessage("msgPasswordsDoNotMatch");
                }
               
View Full Code Here

     * Returns a new connection to the database based on the logged on user.
     */
    public static Connection getConnection() {
        if (isClosed(connection)) {
       
            SecuredUser su = SecurityCentre.getInstance().getUser();
            if (su == null)
                connection = getConnection("sa", "");
            else
                connection = getConnection(su.getUsername(), su.getPassword());
           
            logger.debug("Created a new, normal, database connection");
        }

        return connection;
View Full Code Here

TOP

Related Classes of net.datacrow.core.security.SecuredUser

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.