    protected void configure(Configuration config) throws ConfigurationException, AccessManagementException {
        setID(config.getAttribute(ID));
        setName(config.getChild(NAME, false).getValue(null));
        if(config.getChild(EMAIL, false) != null){
            setEmail(config.getChild(EMAIL, false).getValue(null));
        }
        if(config.getChild(PASSWORD, false) != null){
            this.encryptedPassword = config.getChild(PASSWORD, false).getValue(null);
        }
        if(config.getChild(LANGUAGE, false) != null) {
            setLanguage(config.getChild(LANGUAGE, false).getValue(null));
        }
        if(config.getChild(SALT,false) != null) {
            this.salt = config.getChild(SALT, false).getValue(null);
        }
        if(config.getChild(DESCRIPTION, false) != null) {
            setDescription(config.getChild(DESCRIPTION, false).getValue(null));
        }
        if(config.getChild(EXPIRE, false) != null){
            SimpleDateFormat sdf1 = new SimpleDateFormat(DATE_TIME_FORMAT);
            SimpleDateFormat sdf2 = new SimpleDateFormat(DATE_FORMAT);
                String dateAsString = config.getChild(EXPIRE, false).getValue(null);
                Date expire = null;
                if(null != dateAsString){
                    try {
                        expire = sdf2.parse(dateAsString);
                    } catch (ParseException e) {
                        try {
                            expire = sdf1.parse(dateAsString);
                        } catch (ParseException e1) {
                            log.error(e.getMessage() + " (The user will be made expired)");
                        }finally{
                            if(expire == null){
                                GregorianCalendar cal = new GregorianCalendar();
                                cal.add(Calendar.YEAR, -10);
                                expire = cal.getTime();
                            }else{
                            }
                        }
                    }finally{
                        this.setExpirationDate(expire);
                    }
                }
        }
        Configuration groupsNode = config.getChild(GROUPS_TAG_NAME, false);
        if (groupsNode != null) {
            Configuration[] groupNodes = groupsNode.getChildren(GROUP_TAG_NAME);
            if (groupNodes != null && groupNodes.length > 0) {
                _groupIDs = new ArrayList();
                for (int i = 0; i < groupNodes.length; i++) {
                    _groupIDs.add(groupNodes[i].getAttribute(GROUP_ID_ATTR_NAME));
                }
            } else {
                log.warn("DEBUG: User '" + getID() + "' does not seem to belong to any groups.");
            }
        } else { 
            log.warn("User '" + getID() + "' does seem to be an instance of a previous version without '" + GROUPS_TAG_NAME + "' tag and hence will be migrated automatically.");
            if (true) {
                log.warn("Fix group index ...");
                String[] gids = getGroupIDs(false);
                _groupIDs = new ArrayList();
                for (int i = 0; i < gids.length; i++) {
                    _groupIDs.add(gids[i]);
                }
                save();
            }
        }
    }

    protected void configure(Configuration config) throws ConfigurationException, AccessManagementException {
        setID(config.getAttribute(ID));
        setName(config.getChild(NAME, false).getValue(null));
        if(config.getChild(EMAIL, false) != null){
            setEmail(config.getChild(EMAIL, false).getValue(null));
        }
        if(config.getChild(PASSWORD, false) != null){
            this.encryptedPassword = config.getChild(PASSWORD, false).getValue(null);
        }
        if(config.getChild(LANGUAGE, false) != null) {
            setLanguage(config.getChild(LANGUAGE, false).getValue(null));
        }
        if(config.getChild(SALT,false) != null) {
            this.salt = config.getChild(SALT, false).getValue(null);
        }
        if(config.getChild(DESCRIPTION, false) != null) {
            setDescription(config.getChild(DESCRIPTION, false).getValue(null));
        }
        if(config.getChild(EXPIRE, false) != null){
            SimpleDateFormat sdf1 = new SimpleDateFormat(DATE_TIME_FORMAT);
            SimpleDateFormat sdf2 = new SimpleDateFormat(DATE_FORMAT);
                String dateAsString = config.getChild(EXPIRE, false).getValue(null);
                Date expire = null;
                if(null != dateAsString){
                    try {
                        expire = sdf2.parse(dateAsString);
                    } catch (ParseException e) {
                        try {
                            expire = sdf1.parse(dateAsString);
                        } catch (ParseException e1) {
                            log.error(e.getMessage() + " (The user will be made expired)");
                        }finally{
                            if(expire == null){
                                GregorianCalendar cal = new GregorianCalendar();
                                cal.add(Calendar.YEAR, -10);
                                expire = cal.getTime();
                            }else{
                            }
                        }
                    }finally{
                        this.setExpirationDate(expire);
                    }
                }
        }
        Configuration groupsNode = config.getChild(GROUPS_TAG_NAME, false);
        if (groupsNode != null) {
            _groupIDs = new ArrayList();
            Configuration[] groupNodes = groupsNode.getChildren(GROUP_TAG_NAME);
            if (groupNodes != null && groupNodes.length > 0) {
                for (int i = 0; i < groupNodes.length; i++) {
                    _groupIDs.add(groupNodes[i].getAttribute(GROUP_ID_ATTR_NAME));
                }
            } else {
                log.warn("User '" + getID() + "' does not seem to belong to any groups.");
            }
        } else { 
            log.warn("User '" + getID() + "' does seem to be an instance of a previous version without '" + GROUPS_TAG_NAME + "' tag and hence will be migrated automatically.");
            if (true) {
                log.warn("Fix group index ...");
                String[] gids = getGroupIDs(false);
                _groupIDs = new ArrayList();
                for (int i = 0; i < gids.length; i++) {
                    _groupIDs.add(gids[i]);
                }
                save();
            }
        }
    }
