@@ -58,13 +58,13 @@ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundEx
List<GrantedAuthority> grantedAuthorities = createGrantedAuthorities(roleService.findCustomerRolesByCustomerId(customer.getId()));
if (pwChangeRequired) {
if (forcePasswordChange) {
returnUser = new User(username, customer.getPassword(), true, true, !customer.isPasswordChangeRequired(), true, grantedAuthorities.toArray(new GrantedAuthority[0]));
returnUser = new User(username, customer.getPassword(), true, true, !customer.isPasswordChangeRequired(), true, grantedAuthorities);
} else {
grantedAuthorities.add(new GrantedAuthorityImpl("ROLE_PASSWORD_CHANGE_REQUIRED"));
returnUser = new User(username, customer.getPassword(), true, true, true, true, grantedAuthorities.toArray(new GrantedAuthority[0]));
returnUser = new User(username, customer.getPassword(), true, true, true, true, grantedAuthorities);
}
} else {
returnUser = new User(username, customer.getPassword(), true, true, !customer.isPasswordChangeRequired(), true, grantedAuthorities.toArray(new GrantedAuthority[0]));
returnUser = new User(username, customer.getPassword(), true, true, !customer.isPasswordChangeRequired(), true, grantedAuthorities);
}
return returnUser;
}
@@ -2,7 +2,7 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

<!-- Entity mappings - override for extensibility -->
<bean id="org.broadleafcommerce.profile.core.domain.Address" class="org.broadleafcommerce.profile.core.domain.AddressImpl" scope="prototype">
@@ -5,13 +5,13 @@
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
http://www.springframework.org/schema/util/spring-util-3.1.xsd">

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" depends-on="blCacheManager">
<property name="jpaVendorAdapter">
@@ -3,9 +3,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
http://www.springframework.org/schema/context/spring-context-3.1.xsd">

<context:component-scan base-package="org.broadleafcommerce.profile">
<context:exclude-filter type="regex" expression="org.broadleafcommerce.profile.web.*"/>
@@ -4,7 +4,7 @@
<parent>
<artifactId>broadleaf</artifactId>
<groupId>org.broadleafcommerce</groupId>
<version>1.6.0-M2-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>core</artifactId>
<packaging>pom</packaging>
@@ -4,7 +4,7 @@
<parent>
<artifactId>broadleaf</artifactId>
<groupId>org.broadleafcommerce</groupId>
<version>1.6.0-M2-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>integration</artifactId>
@@ -1,42 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">


<sec:http auto-config="true" >
<sec:intercept-url pattern="/account/**" access="ROLE_USER" />
<sec:form-login login-page='/registerCustomer/registerCustomer.htm'
default-target-url='/welcome.htm'
authentication-failure-url="/registerCustomer/registerCustomer.htm?error=true"
login-processing-url="/login_post.htm"
/>
<sec:logout logout-url="/logout.htm"/>
<sec:remember-me />
<sec:custom-filter after="REMEMBER_ME_FILTER" ref="blCustomerStateFilter"/>
</sec:http>

<!-- bean id="passwordEncoder" class="org.springframework.security.providers.encoding.Md5PasswordEncoder"/ -->

<!--=============================================================================================== -->
<!-- Override the authentication provider to use the JDBC authentication defined below. -->
<!--=============================================================================================== -->
<sec:authentication-manager alias="blAuthenticationManager">
<sec:authentication-provider user-service-ref="blUserDetailsService" >
<sec:password-encoder ref="blPasswordEncoder"/>
</sec:authentication-provider>
</sec:authentication-manager>

<sec:jdbc-user-service
data-source-ref="blDS"
id="blUserDetailsService"
users-by-username-query="select user_name,password,true from blc_customer where user_name=?"
authorities-by-username-query="select c.user_name,r.role_name from blc_customer c join blc_customer_role cr on c.customer_id = cr.customer_id join blc_role r on cr.role_id = r.role_id where user_name=?"
/>

<bean id="blCustomerStateFilter" class="org.broadleafcommerce.profile.web.core.security.CustomerStateFilter"/>

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">


<sec:http auto-config="true" >
<sec:intercept-url pattern="/account/**" access="ROLE_USER" />
<sec:form-login login-page='/registerCustomer/registerCustomer.htm'
default-target-url='/welcome.htm'
authentication-failure-url="/registerCustomer/registerCustomer.htm?error=true"
login-processing-url="/login_post.htm"
/>
<sec:logout logout-url="/logout.htm"/>
<sec:remember-me />
<sec:custom-filter after="REMEMBER_ME_FILTER" ref="blCustomerStateFilter"/>
</sec:http>

<!-- bean id="passwordEncoder" class="org.springframework.security.providers.encoding.Md5PasswordEncoder"/ -->

<!--=============================================================================================== -->
<!-- Override the authentication provider to use the JDBC authentication defined below. -->
<!--=============================================================================================== -->
<sec:authentication-manager alias="blAuthenticationManager">
<sec:authentication-provider user-service-ref="blUserDetailsService" >
<sec:password-encoder ref="blPasswordEncoder"/>
</sec:authentication-provider>
</sec:authentication-manager>

<sec:jdbc-user-service
data-source-ref="blDS"
id="blUserDetailsService"
users-by-username-query="select user_name,password,true from blc_customer where user_name=?"
authorities-by-username-query="select c.user_name,r.role_name from blc_customer c join blc_customer_role cr on c.customer_id = cr.customer_id join blc_role r on cr.role_id = r.role_id where user_name=?"
/>

<bean id="blCustomerStateFilter" class="org.broadleafcommerce.profile.web.core.security.CustomerStateFilter"/>

</beans>
@@ -4,11 +4,11 @@
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

<context:component-scan base-package="org.broadleafcommerce.profile.web"/>
<context:component-scan base-package="org.broadleafcommerce.core.web"/>
44 pom.xml
@@ -10,7 +10,7 @@
<artifactId>broadleaf</artifactId>
<packaging>pom</packaging>
<name>BroadleafCommerce</name>
<version>1.6.0-M2-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
<description>BroadleafCommerce Top Level Project</description>
<url>http://www.broadleafcommerce.org</url>
<licenses>
@@ -680,35 +680,35 @@
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
<exclusions>
@@ -721,21 +721,21 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
@@ -749,42 +749,56 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>3.0.5.RELEASE</version>
<version>3.1.0.RELEASE</version>
<type>jar</type>
<scope>runtime</scope>
</dependency>