Jump to content

[SOLVED(ish)] priviledges redirecting users from template wrong


Recommended Posts

Posted

HELLO! having user Role issues.

I've got a Role:  members and a template that is set to only allow view of Members and to redirect anyone else to / but id redircts Member users still currently, and only alows people to view the page if the template is set to view on the guest role also. :(

Any help would be appreciated. I'm running  ProcessWire 3.0.62

5a9974975cd55_Screenshot2018-03-0215_57_22.thumb.png.3d70532fcec45b62bbfce03006ea1124.png

5a99749b73c7d_Screenshot2018-03-0215_57_03.thumb.png.468c6b04e6bb54cf5d1c4f56d00aee4f.png

5a99749ec9d7f_Screenshot2018-03-0215_56_52.thumb.png.eebd080adfab503d3f3679a7a5f5e00f.png

Posted

Update: Seems to work fine on dev site and not on live. could there be some strange server differences happening?!

Posted
3 minutes ago, benbyf said:

Update: Seems to work fine on dev site and not on live. could there be some strange server differences happening?!

Make sure your online host is not blocking or restricting anything. 

Posted
9 minutes ago, benbyf said:

how? its a shared host, so god knows.

I've dealt in the past with a web host who enabled some ModSecurity or Custom settings that were geared towards protecting WordPress installations.  This affected some of my clients PW sites on shared hosting.  Once I sent a message to the web host, letting them know these weren't WP sites and that their changes were impacting the PW sites, they relented and removed the WP-specific host settings.

  • Like 2
  • 2 weeks later...
Posted

Thinking im starting to lose it. could there be a bug in PW 3.0.62? still cant seem to get this to work with the template view permissions set to guest no-view and member role can view

if($session->login($username, $pass)){
	$session->redirect($pages->get("/events/")->url);
}

 

Posted

Are you logged in at all after the call to login (perhaps output your user name somewhere on the home page)? Are there any noticeable differences in the raw responses, especially the cookie headers (either in the login call or the redirect)?

Posted
9 hours ago, BitPoet said:

Are you logged in at all after the call to login (perhaps output your user name somewhere on the home page)? Are there any noticeable differences in the raw responses, especially the cookie headers (either in the login call or the redirect)?

Sorry, hows the best way to do this?

Posted

Just perform the login while you have the developer console (F12) open, once on the dev site, once on live, and compare response headers line by line. See if something is missing or different on the live server.

Posted

no dice. Same headers, same server, same version of PW (latest stable), same permissions as far as i can see and same roles but one site wont let that the members user access a template :/ grr

Posted

So no idea what happened here in the end, I solved the issue by deleting the Role, adding the role again and assigning the template as viewable. This solved it by I have no idea why (I guess there must have been a setting somewhere that was conflicting).

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...