Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Option to restrict pages to ip address


Go to End


5 Posts   1364 Views

Avatar
jkdude

Community Member, 19 Posts

15 April 2015 at 11:48am

Edited: 15/04/2015 11:53am

Hi all,

I've got a client who is wondering if we're able to add an option to the CMS, maybe a checkbox in the Visibility section, that allows a page to be visible only within their ip address so that people within that ip address could view published pages without logging in. When pages are approved, they'd like to uncheck that box and it will become available to the public. How would I go about getting something like that implemented? Is it possible?

Thanks
JK

Avatar
helenclarko

Community Member, 166 Posts

15 April 2015 at 1:31pm

Hi Jkdude,

I've done a similar thing before with a .htaccess file, however that was for the entire website, not just a selection of pages.

I guess you could assign your client to a new group and give them access to view draft pages.
I realise this is not really the solution you are after, but it would allow the client to view all pages under draft/awaiting submittion.

I also stumbled accross an IP Whitelist tool you could use.
https://github.com/silverstripe-labs/silverstripe-securityextras
I haven't tested it myself, but it looks like you can assign a whitelist ip to a group, maybe this could help or atleast be the base to creating an addon.

Hope that helps,
-helenclarko

Avatar
jkdude

Community Member, 19 Posts

15 April 2015 at 1:55pm

Hi Helen,

Thanks for the quick response. It was one of the suggestions we gave our client but they specifically need it to not require logging in.

Thanks.
JK

Avatar
helenclarko

Community Member, 166 Posts

13 May 2015 at 10:53am

Avatar
jkdude

Community Member, 19 Posts

13 May 2015 at 10:57am

Wow. That's exactly what we need. Thanks for sharing.