Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alt. Views, Menu Items Not Hidden? #475

Closed
jaswrks opened this issue Feb 10, 2015 · 10 comments
Closed

Alt. Views, Menu Items Not Hidden? #475

jaswrks opened this issue Feb 10, 2015 · 10 comments

Comments

@jaswrks
Copy link
Contributor

jaswrks commented Feb 10, 2015

I've seen a couple of reports regarding Alt. Views in the latest release of s2Member.

A customer writes...

After upgrading to the new version tonight, I'm seeing restricted pages in menus for anonymous users. I've deactivated other plugins to see if they were causing them and they were not.

Referencing: https://websharks.zendesk.com/agent/tickets/5076

@jaswrks
Copy link
Contributor Author

jaswrks commented Feb 10, 2015

Another report of this: https://websharks.zendesk.com/agent/tickets/5082

@jaswrks
Copy link
Contributor Author

jaswrks commented Feb 10, 2015

Another report of this: https://websharks.zendesk.com/agent/tickets/5118

@jaswrks jaswrks added this to the Next Release milestone Feb 10, 2015
@raamdev
Copy link
Contributor

raamdev commented Feb 10, 2015

Reported on the Community Forum too: https://wordpress.org/support/topic/report-alternative-views-restrictions-no-longer-working?replies=19

I left a link back to this GitHub Issue there.

@jeremygradisher
Copy link

I have that exact issue as well - multisite situation - Alt links should not be showing within the nav and they are - . I haven't changed anything else - it has to do with one of the last two updates. I applied one or both a couple of days ago. There was another thread I commented on the January update addressed things with alt view - Potential that is where it started? #372

@jeremygradisher
Copy link

This is the file that causes that problem (Different from v150102 to v150203:
/s2member/includes/classes/utilities.inc.php

v150102: /s2member/includes/classes/utilities.inc.php

line 17:
if (realpath (FILE) === realpath ($_SERVER["SCRIPT_FILENAME"]))
exit ("Do not access this file directly.");

------------------------

v150203: /s2member/includes/classes/utilities.inc.php

line 17:
if(!defined('WPINC')) // MUST have WordPress.
exit ('Do not access this file directly.');


The changelog refers to it:
(s2Member/s2Member Pro) Security: This release of s2Member checks for the existence of the WordPress PHP Constant: WPINC instead of looking for the less reliable $_SERVER['SCRIPT_FILENAME']. Some site owners reported this was causing trouble in a localhost environment during testing, or when running s2Member on some hosts that are missing the SCRIPT_FILENAME environment variable; e.g. some Windows servers. Fixed in this release. See also: this GitHub issue if you'd like additional details.

They also point out another string about it.
#454

That file: /s2member/includes/classes/utilities.inc.php
is the problem - take the one from v150102 and it works
correctly - Alternative View Protection

I have that file if you need it - jeremygradisher@gmail.com

@jaswrks
Copy link
Contributor Author

jaswrks commented Feb 11, 2015

Next Release Changelog:

  • (s2Member) Bug Fix: Alt. View Restrictions stopped working on navigation menu items in the previous release of s2Member v150203 due to a default argument value being misinterpreted by a sub-routine. Fixed in this release. See also: this GitHub issue if you'd like further details.

@jaswrks
Copy link
Contributor Author

jaswrks commented Feb 11, 2015

@jeremygradisher Thanks for your work to research this issue :-)

Short-Term Patch Fix

This bug has been corrected in the development copy. A fix will be pushed out in our next release. As a short-term fix, you can replace your copy of this file with the corrected/updated version.

@webdesign1
Copy link

I replaced the file with the corrected version on homesoccerdrills.com and the site went down completely. There seems to be a break somewhere in the file of sorts. I'm guessing there is a difference between v. 150202 & 150203. Is there a validated fix for 150203 - as I'm assuming that file is a 150202 fix?

@jaswrks
Copy link
Contributor Author

jaswrks commented Feb 12, 2015

@webdesign1

The patch has been tested/confirmed to correct the issue. Please be sure that you apply the patch to an existing installation of s2Member v150203. Also, please be sure that you don't miss any characters whenever you copy and/or replace the file contents that you have now.

@webdesign1
Copy link

I tested again - everything worked. Thanks!

Brian Nori

On Feb 11, 2015, at 7:17 PM, JasWSInc notifications@github.com wrote:

@webdesign1

The patch has been tested/confirmed to correct the issue. Please be sure that you apply the patch to an existing installation of s2Member v150203. Also, please be sure that you don't miss any characters whenever you copy and/or replace the file contents that you have now.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants