Skip Navigation

[Resolved] Custom User Role – just to view pages on the front-end

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 29 replies, has 3 voices.

Last updated by Christian Cox 4 years ago.

Assisted by: Christian Cox.

Author
Posts
#2116765

Hi,

I have a custom user-role "pharmacist" and I have some hidden sections on our page, which only logged in users can see.

The user-role "pharmacists" has no access to the wp-admin dashboard (if he tries to enter he should be redirected)

Everything was working fine, until I installed the toolset.

We use a custom url with some secret $_GET code and people going to this url will be logged in via the
wp_signon() function and also wp_set_auth_cookie()

If I change the credentials in my function to an admin user, everything works fine.

The other user role is not working

Thanks for your time and help

Georg

#2116801

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

Thank you for getting in touch.

I don't believe the issue here is being explained clearly.

Can you let me know what exactly happened after you've installed our Toolset Plugin ? Also which plugin are you using to create the custom pharmacist role.

Thanks,
Shane

#2116841

Hi

we make the role within the function.php file

f.e.
add_role( "gl-intern", "Professionals", array(
'read' => true, 'level_0' => true
) );

To explain it again in more details:
1. We do have an external service called docCheck which is handling logins
2. once a client is logged in the will get to our secret url with a $_GET Code
3. we check if the code is correct and sign them in as a user with the
$user = wp_signon( $creds, false );
wp_set_current_user($user->ID );
wp_set_auth_cookie( $user->ID, true );

4. if nothing throws an error we redirect the user to a page where we check if the user is logged in or not
5. but after login we can not see any pages and it will throw an error (redirect loops)
6. to make it work again we need to clear all the cookies

before we installed Toolset it was working perfectly fine and we have the same script running on other sites
without Toolset.

Any idea?

#2116847

I created a new role with the toolset plugin, with the same result.
It works with an admin user, but not with a simple user, who has no "rights"

#2116863

As soon as I deactivate Toolset it works again FYI

#2118869

any idea?

#2118951

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

Which Toolset plugin did you activate that caused the issue ? Was it our Toolset Access plugin as I know that our Access plugin handles user permissions so it may be a case where they are conflicting somehow.

Please let me know.
Thanks,
Shane

#2120831

I am using Toolset Access Version 2.8.11 - and I also use Remove Dashboard Access Version 1.1.3.

But if I activate the Toolset Access with or without the Remove-Dashboard-Access it is not working.
A logged in user - in my case call it a reader - can not access any sites. It will redirect until it crashes.

#2121255

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Georg,

Thank you, would you mind allowing me to have admin access to the site so that I can take a look to see what could be causing this issue.

I may need to take a copy of the site for further checks here locally if im not able to see what is causing the issue.

I've enabled the private fields for your next response.

Thanks,
Shane

#2121555

As soon as a user signs in - which is not an admin - the user will not be able to see any pages. Each page will lead to and infinite redirect. We use the user doccheck as a user to work with and external login system. So if people login with the doccheck tool they will be logged in as the user doccheck. But this is actually not important as no user except admin works.

#2122623

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi George,

I'm a little unsure of how to approach this issue. Can you give me step by step instruction on how to replicate the issue ?

Is it a case where the non-admin user should be able to access the backend of the site but they aren't able to ?

Please provide some clarity so that I can continue with my checks.

Thanks,
Shane

#2122669

Hi, I made you a video explaining the problem we are facing
hidden link

#2122671

Hi, we made you a video explaining the problem - hidden link - not sure if this was posted before - thanks

#2122673

check - did my video link got posted here or not?

#2123441

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Georg,

I checked the video, please standby for an update.