Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 5.3.5.

Duplications

File Line
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 462
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 630
        }

        LdapUser ldapUser = new LdapUser(  );
        ldapUser.setTitle( strCivility );
        ldapUser.setTitleLabel( I18nService.getLocalizedString( PROPERTY_LABEL_CIVYLITY + strCivility,
                request.getLocale(  ) ) );
        ldapUser.setGivenName( strFirstName );
        ldapUser.setSn( strLastName );
        ldapUser.setMail( strEmail );
        ldapUser.setPasswd( strPasswd );
        ldapUser.setTelephoneNumber( strTelephoneNumber );
        ldapUser.setStreetNumber( strStreetNumber );
        ldapUser.setStreetNumberSuffix( strStreetNumberSuffix );
        ldapUser.setStreetNumberSuffixLabel( I18nService.getLocalizedString( PROPERTY_LABEL_STREET_SUFFIX +
                strStreetNumberSuffix, request.getLocale(  ) ) );
        ldapUser.setStreetType( strStreetType );
        ldapUser.setStreetTypeLabel( I18nService.getLocalizedString( PROPERTY_LABEL_STREET_TYPE + strStreetType,
                request.getLocale(  ) ) );
        ldapUser.setStreet( strStreet );
        ldapUser.setDistrictNumber( strDistrictNumber );
        ldapUser.setPostalCode( strPostalCode );
        ldapUser.setLn( strCity );
        ldapUser.setSt( strEtatProv );
        ldapUser.setCo( strCountry );

        if ( strError != null )
        {
            request.getSession(  ).setAttribute( SESSION_ATTRIBUTE_LDAP_USER, ldapUser );
            url.addParameter( PARAMETER_ERROR_CODE, strError );

            return url.getUrl(  );
        }
        else
        {
            //Create user in ldap
            try
            {
                LdapUserHome.registration( ldapUser );
File Line
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 268
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 318
    public XPage getCreateRegistration( XPage page, HttpServletRequest request )
    {
        String strErrorCode = request.getParameter( PARAMETER_ERROR_CODE );
        String strSuccess = request.getParameter( PARAMETER_ACTION_SUCCESSFUL );

        LdapUser ldapUser = (LdapUser) request.getSession(  ).getAttribute( SESSION_ATTRIBUTE_LDAP_USER );

        if ( ldapUser == null )
        {
            ldapUser = new LdapUser(  );
        }

        HashMap model = new HashMap(  );

        model.put( MARK_PLUGIN_NAME, _plugin.getName(  ) );
        model.put( MARK_CIVILITY_REF_LIST,
            SelfRegistrationUtils.buildRefList( request, PROPERTY_CIVILITY_ITEMS_NUMBER, PROPERTY_LABEL_CIVYLITY ) );
        model.put( MARK_STREET_SUFFIX_REF_LIST,
            SelfRegistrationUtils.buildRefList( request, PROPERTY_STREET_SUFFIX_ITEMS_NUMBER,
                PROPERTY_LABEL_STREET_SUFFIX ) );
        model.put( MARK_STREET_TYPE_REF_LIST,
            SelfRegistrationUtils.buildRefList( request, PROPERTY_STREET_TYPE_ITEMS_NUMBER, PROPERTY_LABEL_STREET_TYPE ) );
        model.put( MARK_DISTRICT_NUMBER_LIST,
            SelfRegistrationUtils.buildRefList( request, PROPERTY_DISTRIC_NUMBER_ITEMS_NUMBER,
                PROPERTY_LABEL_DISTRIC_NUMBER ) );
        model.put( MARK_ERROR_CODE, strErrorCode );
        model.put( MARK_ACTION_SUCCESSFUL, strSuccess );
        model.put( MARK_USER, ldapUser );

        String strBaseUrl = AppPathService.getBaseUrl( request );

        model.put( PARAMETER_ACTION_BACK, strBaseUrl + AppPropertiesService.getProperty( PROPERTY_ACTION_BACK ) );
File Line
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 412
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 603
        }

        // Check telephone number format
        String strPatternPhoneNumber = AppPropertiesService.getProperty( PATERN_PHONE_NUMBER );

        if ( ( strError == null ) && ( strTelephoneNumber != null ) && !strTelephoneNumber.equals( "" ) &&
                !SelfRegistrationUtils.checkValueOnPattern( strPatternPhoneNumber, strTelephoneNumber ) )
        {
            strError = ERROR_SYNTAX_PHONE_NUMBER;
        }

        // Check street number format
        String strPatternStreetNumber = AppPropertiesService.getProperty( PATERN_STREET_NUMBER );

        if ( ( strError == null ) && ( strStreetNumber != null ) && !strStreetNumber.equals( "" ) &&
                !SelfRegistrationUtils.checkValueOnPattern( strPatternStreetNumber, strStreetNumber ) )
        {
            strError = ERROR_SYNTAX_STREET_NUMBER;
        }

        //Check postal code format
        String strPatternPostalCode = AppPropertiesService.getProperty( PATERN_POSTAL_CODE );

        if ( ( strError == null ) && ( strPostalCode != null ) && !strPostalCode.equals( "" ) &&
                !SelfRegistrationUtils.checkValueOnPattern( strPatternPostalCode, strPostalCode ) )
        {
            strError = ERROR_SYNTAX_POSTAL_CODE;
        }
File Line
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 379
fr/paris/lutece/plugins/selfregistration/web/SelfRegistrationApp.java 535
        String strEmail = request.getParameter( PARAMETER_EMAIL );
        String strPasswd = request.getParameter( PARAMETER_PASSWORD );
        String strConfirmPasswd = request.getParameter( PARAMETER_CONFIRMATION_PASSWORD );
        String strTelephoneNumber = request.getParameter( PARAMETER_TELEPHONE_NUMBER );
        String strStreetNumber = request.getParameter( PARAMETER_STREET_NUMBER );
        String strStreetNumberSuffix = request.getParameter( PARAMETER_STREET_SUFFIX_NUMBER );
        String strStreetType = request.getParameter( PARAMETER_STREET_TYPE );
        String strStreet = request.getParameter( PARAMETER_STREET );
        String strDistrictNumber = request.getParameter( PARAMETER_DISTRICT_NUMBER );
        String strPostalCode = request.getParameter( PARAMETER_POSTAL_CODE );
        String strCity = request.getParameter( PARAMETER_CITY );
        String strEtatProv = request.getParameter( PARAMETER_ETAT_PROV );
        String strCountry = request.getParameter( PARAMETER_COUNTRY );

        //Check mandatory fields
        if ( ( strCivility == null ) || ( strFirstName == null ) || ( strEmail == null ) || ( strLastName == null ) ||