adrian Posted January 12, 2023 Author Share Posted January 12, 2023 Hi @sebr - when I test your module, it saves the the data truncated to 65535 characters. I don't get any error. I also tested the module saveModuleConfigData() method with a long string, and again it just truncates it. All I can think is that there was a DB error during the save which removed the data. Maybe saveModuleConfigData (or actually saveConfig) needs a try catch to make sure an error can't delete data? Link to comment Share on other sites More sharing options...
Marty Walker Posted February 19, 2023 Share Posted February 19, 2023 Hi @adrian, Long time no speak. Quick question. I'm using this method to insert the form into my web page: if($page->protected) { echo $page->loginForm; } else { // show some $page images here } The form shows up and I'm able to login but it then shows nothing beyond where the form sits, even if I refresh. Am I missing something? Cheers Marty Link to comment Share on other sites More sharing options...
adrian Posted February 25, 2023 Author Share Posted February 25, 2023 Hi @Marty Walker - hope you're well! I think perhaps you don't quite have things right, but I am really guessing at this point. Keep in mind that if you want to embed into the site you need a dedicated template as defined in the settings and you shouldn't need the if($page->protected) check. Does that help at all, or am I missing the point entirely? Link to comment Share on other sites More sharing options...
Marty Walker Posted February 26, 2023 Share Posted February 26, 2023 Hi Adrian, I've changed my setup it since I posted it but I would like to get this working. This is how I had my options set up. The 'Portfolio' page also has the Page Protect option enabled for user 'portfolio'. Link to comment Share on other sites More sharing options...
adrian Posted February 27, 2023 Author Share Posted February 27, 2023 Hi Marty, I think the problem is that you don't want to protect the page that is using the portfolio template. And as I mentioned above you also don't want the if($page->protected) check. What you want is to protect the pages that have the images you're trying to restrict access to (using the option on the settings tab). Everything else will be taken care of by the module. Hope that gets you going and sorry if the instructions aren't clear. Link to comment Share on other sites More sharing options...
Teresa Lynn Posted July 27, 2023 Share Posted July 27, 2023 Hi Adrian: We have an odd issue that's cropped up with our protected page module. We set up a 'review' access role (essentially a guest role so they need to log in to review a hidden page). It's worked perfectly for a long time and now it doesn't. People can only view the page if they are logged into the /admin area first, then they can go to the hidden protected page and login there too. This is true even when logging in with super admin creds. Both sites (we have more but I'm focusing on these two) are using 7.4 php and 3.0.208 / 3.0.210 PW versions. What users experience: they go to the protected page link, enter their login creds and submit. The login page reloads rather than letting you through to the page. The only way to get to the page is to log into the /admin back end first, then logging into the protected page. This is awkward / clumsy for the site visitor who don't need back end access. I'm wondering if you have ideas on what could be the issue. Is the latest PW version affecting things / conflicting? Or something else we should be looking at? Link to comment Share on other sites More sharing options...
JayGee Posted November 6, 2024 Share Posted November 6, 2024 Hi @adrian - just wondering with your module is there a way to configure the whole site to be protected, but to exclude one particular page from protection? I can't see a way to do this without having to configure every page 1 by 1, unless I'm missing a trick? Link to comment Share on other sites More sharing options...
adrian Posted November 7, 2024 Author Share Posted November 7, 2024 @JayGee - not currently. I wonder if the best option might be to make protectedCheck() hookable and then you could add an exception for the required page via a hook in ready.php Link to comment Share on other sites More sharing options...
JayGee Posted November 8, 2024 Share Posted November 8, 2024 15 hours ago, adrian said: @JayGee - not currently. I wonder if the best option might be to make protectedCheck() hookable and then you could add an exception for the required page via a hook in ready.php Thanks @adrian for confirming I wasn't overlooking something obvious at least! The use case was to protect a staging site but allow certain routes for webhooks/APIs etc. Have worked around it for the moment using basic auth at server level, but it would be a handy feature. Will add it to the backlog and have a look at forking it and making a mod when get some time 🙂 Link to comment Share on other sites More sharing options...
JayGee Posted December 13, 2024 Share Posted December 13, 2024 On 11/6/2024 at 9:56 PM, JayGee said: Hi @adrian - just wondering with your module is there a way to configure the whole site to be protected, but to exclude one particular page from protection? I can't see a way to do this without having to configure every page 1 by 1, unless I'm missing a trick? Hi @adrian I just wanted to share that this problem came up again today and I found a working resolution without needing to modify your module. We installed your module and enabled protection from the home page settings and checked to cover all children (essentially enabled site wide). We then moved the webhook APIs to a module using the URL hooks (hooked via init()) which allows them to bypass the site protection without unprotecting the rest of the site. 🙌 I thought I'd share in case this is of use for anyone else in the same situation. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now