- fixed accessible settings and register and password-reset page;

- fixed roles filtration on social registration;
This commit is contained in:
nikitozzzzzzz
2017-09-10 20:06:00 +03:00
parent 223d4fb5ba
commit 495f447b5c
4 changed files with 191 additions and 172 deletions
+3 -2
View File
@@ -103,14 +103,15 @@ if ( ! class_exists( 'Roles_Capabilities' ) ) {
$role = $this->um_get_user_role( $user_id );
// User already has this role so no new role is set
if ( $new_role === $role ) {
if ( $new_role === $role || ( ! $this->is_role_custom( $new_role ) && user_can( $user, $new_role ) ) ) {
$new_role = false;
} else {
// Users role is different than the new role
// Remove the old UM role
if ( ! empty( $role ) && $this->is_role_custom( $role ) )
if ( ! empty( $role ) && $this->is_role_custom( $role ) ) {
$user->remove_role( $role );
}
// Add the new role
if ( ! empty( $new_role ) ) {