Restrict Access Question
Hi there,
I am trying to restrict access to a page on my site. I understand how restrict access with tags works. Currently, I have a user setup with a tag called "sot". I have a page restricted to "tot". I am unable to view the page, however, even though I have the tag.
Perch: 2.8.6, PHP: 5.4.37, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.6), assets (2.8.6), categories (2.8.6), perch_forms (1.8.3), perch_members (1.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', 'perch_members', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/wildcatradioclub/wildcatradioclub.com/perch
PERCH_CORE: /home/wildcatradioclub/wildcatradioclub.com/perch/core
PERCH_RESFILEPATH: /home/wildcatradioclub/wildcatradioclub.com/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 64M, Max POST 65M, Memory: 90M, Total max file upload: 64M
Resource folder writeable: Yes
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
REQUEST_URI: /perch/core/settings/diagnostics/
DOCUMENT_ROOT: /home/wildcatradioclub/wildcatradioclub.com
HTTP_HOST: www.wildcatradioclub.com
The template for the page:
<?php include($_SERVER['DOCUMENT_ROOT'].'/perch/runtime.php'); ?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?php perch_pages_title() ?> - <?php perch_content('Site title'); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php perch_page_attributes(); ?>
<?php perch_get_css(); ?>
<link rel="stylesheet" type="text/css" href="/css/demo.css" />
</head>
<body>
<header class="layout-header">
<div class="wrapper">
<div class="company-name"><?php perch_content('Site title'); ?> - <?php perch_content('Company name'); ?></div>
<?php perch_content('Logo'); ?>
</div>
<nav class="main-nav">
<?php perch_pages_navigation(array(
'levels'=>1
));
?>
</nav>
</header>
<div class="wrapper cols2-nav-right">
<div class="primary-content">
<?php
if (perch_member_logged_in()) {
echo perch_content('Intro');
echo perch_content('Content');
}else{
echo perch_content('Intro');
echo perch_content('Unauthorized');
}
?>
</div>
<nav class="sidebar">
<?php
if (perch_member_logged_in()) {
?>
<?php perch_pages_navigation(array( 'navgroup' =>'members' )); ?>
<?php
}else{
perch_members_login_form();
}
?>
</nav>
</div>
<footer class="layout-footer">
<div class="wrapper">
<?php perch_content('Social links'); ?>
<small>Copyright © <?php echo date("Y"); ?></small>
</div>
</footer>
<?php perch_get_javascript(); ?>
</body>
</html>
Thank you, Trevor Brandt
The tags would need to be the same to allow access. If your page was restricted to
sot
instead, the user would be able to access it.I apologize, I mean to type sot. The tags are typed the same in my Perch panel.
Also, last evening I was unable to access the page regardless if the tag was present on the page and the user's account. Now, I'm able to access it no matter what.
What happens when you try to view the page?
Well, last night it redirected back to the login page I set in settings.
Now I can view the page regardless.
https://dl.dropboxusercontent.com/u/6106090/Screen%20Shot%202015-05-21%20at%207.20.03%20AM.png
https://dl.dropboxusercontent.com/u/6106090/Screen%20Shot%202015-05-21%20at%207.19.39%20AM.png
https://dl.dropboxusercontent.com/u/6106090/Screen%20Shot%202015-05-21%20at%207.19.14%20AM.png
Some screenshots, if that helps. Not sure if it does.
So now it's working?
No, it lets anyone access the page regardless if there's a tag on the page or not.
What have you set the members login page path setting to?
/members/index.php?={returnURL}
My install is at /members and index.php is where the login is located.
I can't see why that shouldn't work.
I'm not sure either. It's odd, and I've tried to troubleshoot it but I don't understand what's up.
Also, I just tried it with a different tag. It's back to the way it was before-- cannot see the page, regardless if the tag is on the user or not.
You said the behaviour changed - what caused the change?
It changed when I was changing the tags around. When I just did it again, it went back to the way it was before.
I thought maybe it was me erroring and naming the tags differently, but I double checked.
So is there no pattern?
There doesn't seem to be.
Are sessions otherwise working normally?
Yep, they work fine! I'm able to login, logout, and view other member pages without tags.
Ok. I'm not really sure how to help as I've not got a clear grasp on what's going wrong.