Jump to content
benbyf

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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. 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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);
}

 

Share this post


Link to post
Share on other sites

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)?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AndZyk
      Hello,
      this maybe a simple question, but it bothers me for a while now:
      There used to be a warning, if two or more user try to edit the same page. But ever since AdminThemeUIkit I haven't seen it any more.
      Is this a bug or are there special circumstances under which the warning will be displayed?
      If I am logged-in in the same browser with one default and one privat window, I don't see this warning. But also different browsers on different machines in the same network don't see this warning.
      I was looking for the blog post on which this feature was announced, but couldn't find it anymore.
      We had the case, that two people were writing a text for the same page, but after person A saved the page first, the text of the person B was lost. I know we could have used ProDrafts for this case, but it shouldn't happen in the first place.
      I would appreciate some feedback. 😀
      Regards, Andreas
    • By SwimToWin
      I have a website that allows users to create their personal "website" (a page with sub-pages).
      Users shall be able to:
      Log in (frontend and/or admin), Edit "their" page(s) - I am using the "Page Edit Per User"-module (https://modules.processwire.com/modules/page-edit-per-user/) to grant access to the relevant pages Create child pages - possible? Users shall not be able to see other pages in the admin interface - "Admin Restrict Page Tree" may do the trick (https://modules.processwire.com/modules/admin-restrict-page-tree/)? Frontend editing shall be possible - I am considering "Fredi" (https://modules.processwire.com/modules/fredi/) for this. The challenge is that it takes a lot of modules and configuration.
      Is there a way to set this up that doesn't require a lot of configuration for each new user?
    • By benbyf
      Hello, having trouble getting PW to save my user or field in cron hook.
      It seems to report the same field info each time unchanged. It should be counting down in seconds.
      public function init() { // set to every30Seconds in settings $this->defaultInterval = $this->cron_check; // add hooks to CRON $this->addHookAfter("LazyCron::{$this->defaultInterval}", $this, 'checkUserSubscription'); } public function ___checkUserSubscription(HookEvent $e){ // seconds since last lazycron $seconds = $e->arguments[0]; $log = wire('log'); $field = $this->exclusiveRole; // users with specific role and field $users = $this->users->find("roles=$field"); foreach ($users as $user) { // get stored time $currentTime = $user->get($this->fieldName); // if time not null if($currentTime){ // evalute stored time minus time past $resultTime = intval($currentTime) - intval($seconds); $log->message("result ".$resultTime); // save user page $user->set($this->fieldName, $resultTime); $this->users->save($user); } } }  
    • By MrKing
      Hi,
      I am hoping to be able to use processwire for a charity with over 900 members and about 90 interest groups.
      One of the deciding factors (and there are many) is whether I would be able, as the admin, to add all my existing members, all the interest groups and all the group membership data programatically. As you might imagine, I would not want to do this by hand.
      I have written data upload scripts for a 'home brewed' experimental site but would much prefer to use processwire as the foundation of our site, if possible.
      Many thanks.
    • By Sergio
      I have this "editor" role, that has the "user-admin-all" permission.
      I tried several times, doing different things sets of permissions, but I can't make a user with this role being able to make another user an "editor" too. PW disables the "editor" checkbox. I read the documentation 3 times that my eyes cannot see what I'm missing anymore.
      Any clues?
×
×
  • Create New...