adrian

Page Protector

Recommended Posts

@ottogal - I just tested here to confirm it is still working as expected with PW 3 and everything seems to be fine. Unfortunately I am traveling at the moment with very limited internet access so I don't really have much time to help you at the moment. Is it possible you also have some other modules that are impacting access permissions? I would try testing on a clean PW install to see if you can narrow down the issue.

I'll check back in again when I can to see where you're at.

Share this post


Link to post
Share on other sites

@adrian: Thank you for your time, anyway.

At the moment I don't have the time to dig deeper into it, but surely will try later.

Share this post


Link to post
Share on other sites

On the Settings page of the module PageProtector 0.1.4 the "Protect Entire Site" shortcut is missing.
Was it removed intentionally?

Share this post


Link to post
Share on other sites

It's still there for me. Remember this will only be on the main module config settings page, not the settings tabs for individual pages.

Also, note that once you have protected the homepage, this shortcut is no longer available - it doesn't have any purpose in this case.

post-985-0-55478100-1458177940_thumb.png

Share this post


Link to post
Share on other sites

once you have protected the homepage, this shortcut is no longer available - it doesn't have any purpose in this case.

I understand. But then the hint under Instructions ("... or use the "Protect Entire Site" shortcut below") should be removed in this case, too.

Share this post


Link to post
Share on other sites

I have to overwrite the default Prohibited Message in each individual page Setting. I'm missing the possibility to do it in the module's Settings for all ptotected pages.

Share this post


Link to post
Share on other sites

Hi @ottogal,

I have just committed a new version which handles both your requests:

  • hiding the instructions about the shortcut to protecting the entire site
  • ability to set a default Prohibited Message in the module's config settings.

Let me know if you have any problems with this.

  • Like 4

Share this post


Link to post
Share on other sites

Hi @adrian,

sorry for the late reply.

I tried to install the new version 0.1.5 from the Backend via Modules > Site. Despite the notification of the successful installation, the module was not upgraded.

(I'm running PW 3.0.15).

Share this post


Link to post
Share on other sites

Hi @adrian,

sorry for the late reply.

I tried to install the new version 0.1.5 from the Backend via Modules > Site. Despite the notification of the successful installation, the module was not upgraded.

(I'm running PW 3.0.15).

This sounds like a modules caching issue or maybe a FileCompiler caching issue? Can you try a Modules > Refresh? I'd be surprised if that doesn't work, but if not, maybe clear your FileCompiler cache as well? 

Share this post


Link to post
Share on other sites

Did both, same result: If I click "Continue to module settings" (below the "updated successfully" message), the settings show the 0.1.4 version.

Share this post


Link to post
Share on other sites

Did both, same result: If I click "Continue to module settings" (below the "updated successfully" message), the settings show the 0.1.4 version.

I am not sure what to suggest. Can you take a look in the .module file and make sure it says: "15" as the version number?

If it does, then can you let me know if the new functionality is available despite the version number in the module config showing 14?

Share this post


Link to post
Share on other sites

Hhm, getModuleInfo() returns  'version' => 15, and all the files have the date of yesterday (my update). Obviously the update process was successful.

But the entry on Modules > Site continues to display 0.1.4, the settings page is the old one. The new functionality is not available...

Should I try to uninstall and reinstall the module, instead of updating?
 

Share this post


Link to post
Share on other sites
Should I try to uninstall and reinstall the module, instead of updating?

Sure, although if you have lots of separate pages protected you might want to copy the module settings from the modules DB table so you can add them back in without having to re-create them all after the reinstall.

Are you having issues with updating any other modules, or just this one?

Share this post


Link to post
Share on other sites
Are you having issues with updating any other modules, or just this one?

My other modules all are up-to-date, so I can't say.

copy the module settings from the modules DB table

Thank you for the idea!

Uninstalling and reinstalling the module solved the issue. (Before the reinstall I had to delete the files in the modules folder.) Many thank, adrian!

Share this post


Link to post
Share on other sites

I crowed too soon: After a new start of the backend I made a modules refresh to find the following "success" message (green):

  • Session: Cleared the admin theme navigation cache (topnav)

  • Session: Detected 1 module version change (will be applied the next time each module is loaded):

    PageProtector: 0.1.5 => 0.1.4
  • Session: Modules cache refreshed (112 modules)

  • Session: Module "FieldtypeEvents" has multiple files (bold file is the one in use). Click here to change which file is used

    /site/modules/FieldtypeEvents/FieldtypeEvents.module/site/modules/FieldtypeEvents-master/FieldtypeEvents.module
  • Session: Module "ImportPagesCSV" has multiple files (bold file is the one in use). Click here to change which file is used

    /site/modules/ImportPagesCSV-master/ImportPagesCSV.module/site/modules/ImportPagesCSV/ImportPagesCSV.module
  • Session: Module "InputfieldEvents" has multiple files (bold file is the one in use). Click here to change which file is used

    /site/modules/FieldtypeEvents/InputfieldEvents.module/site/modules/FieldtypeEvents-master/InputfieldEvents.module
  • Modules: Upgrading module (PageProtector: 0.1.5 => 0.1.4)

And the installed version is again 0.1.4 ...   :(

(By the way: In the case of multiple files for a module, one with the trailing "-master" and one without it, which one should I use? What's the difference?)

Share this post


Link to post
Share on other sites

Any chance you can PM me with access to this server, or is it a local dev setup?

Why do you have multiple copies of so many of your modules?

You should delete all the -master versions.

Also, when installing modules I would recommend the core method of installing by class name - it looks to me like you installed several modules manually and then used the upgrades modules to upgrade them - hence the extra copies. You must have a 0.1.4 version of PageProtector somewhere in your system.

Share this post


Link to post
Share on other sites

Now I installed the module via github, that worked without issues.

At the moment I can't give you access to the setup.

Thanks for the hints to the -master versions of modules. Again the question: What are they for, what's the difference to the others?

  • Like 1

Share this post


Link to post
Share on other sites

The -master issue is probably just a result of you manually unzipping and FTP'ing the module folder. If you use the modules page to install, either via class name, github url, or from your hdd you won't see these. 

PS Glad you are now seeing 0.1.5!

Share this post


Link to post
Share on other sites

Because when you manually unzip a project from Github it has "-master" or "-dev" etc in the folder name. You don't want this in PW, so you either need to manually remove this, or install automatically from the zip itself. If you install manually and then run the Upgrade module, it is adding the version without the -master so you end up with two versions. Does that explain it?

Share this post


Link to post
Share on other sites

Yep. :)  - As far as I see both versions of the module file are identical; so for a installed module of which I've got only the -master version, I can rename the file pruning the trailing "-master"?

Share this post


Link to post
Share on other sites

Yep. :)  - As far as I see both versions of the module file are identical; so for a installed module of which I've got only the -master version, I can rename the file pruning the trailing "-master"?

Yes that would be preferable.

Share this post


Link to post
Share on other sites

Me:

As far as I see both versions of the module file are identical; so for a installed module of which I've got only the -master version, I can rename the file pruning the trailing "-master"?

You:

Yes that would be preferable.

That seems to be a bad idea:

When I removed the trailing  -master  from the folder's name  \site\modules\PageTableExtended-master  and tried to login, I got this Warning:

Field: Fieldtype 'FieldtypePageTableExtended' does not exist

With pruning the  -master  from  \site\modules\MarkupSimpleNavigation-master , I got an "non object" error message refering to the line where the navigation is rendered...

So I renamed back all these folders to their previous names (with trailing  -master). 

???

Share this post


Link to post
Share on other sites
That seems to be a bad idea:

Just make sure you run Modules > Refresh after renaming and they will work again.

The reason I think it's important is so that you can use the Upgrades module to upgrade all your modules to new versions easily. And in future if you install using the ClassName or the zip (via URL or upload), then you won't ever have to deal with the "-master".

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By OLSA
      Hello for all,
      ConfigurationForm fieldtype module is one my experiment from 2016.
      Main target to build this module was to store multiple setup and configuration values in just 1 field and avoid to use 1 db table to store just single "number of items on page", or another db table to store "layout type" etc. Thanks to JSON formatted storage this module can help you to reduce number of PW native fields in project, save DB space, and reduce number of queries at front-end.
      Install and setup:
      Download (at the bottom ), unzip and install like any other PW module (site/modules/...). Create some filed using this type of field (ConfigurationForm Fieldtype) Go to field setup Input tab and drag some subfields to container area (demo). Set "Name" and other params for subfields Save and place field to templates ("Action tab") How to use it:
      In my case, I use it to store setup and configurations values, but also for contact details, small content blocks... (eg. "widgets").
      Basic usage example:
      ConfigForm fieldtype "setup" has subfields:
      "limit", type select, option values: 5, 10, 15, 20
      "sort", type select, option values: "-date", "date",  "-sort", "sort"
      // get page children (items) $limit = isset($page->setup->limit) ? $page->setup->limit : 10; $sort = isset($page->setup->sort) ? $page->setup->sort : '-sort'; $items = $page->children("limit=$limit, sort=$sort");  
      Screenshots:


       
      Notes:
      Provide option to search inside subfields Provide multilanguage inputs for text and textarea field types Provide option for different field layout per-template basis Do not place/use field type "Button" or "File input" because it won't works. Please read README file for more details and examples Module use JSON format to store values. Text and textarea field types are multilanguage compatible, but please note that main target for this module was to store setup values and small content blocks and save DB space. Search part inside JSON is still a relatively new in MySQL (>=5.77) and that's on you how and for what to use this module.
      Thanks:
      Initial point for this fieldtype was jQuery plugin FormBuiled and thanks to Kevin Chappel for this plugin.
      In field type "link" I use javascript part from @marcostoll module and thanks to him for that part.
      Download:
      FieldtypeConfigForm.zip
      Edit: 14. August 2018. please delete/uninstall previously downloaded zip
      Regards.
         
    • By bernhard
      @Sergio asked about the pdf creation process in the showcase thread about my 360° feedback/survey tool and so I went ahead and set my little pdf helper module to public.
      Description from PW Weekly:
       
      Modules Directory: https://modules.processwire.com/modules/rock-pdf/
      Download & Docs: https://gitlab.com/baumrock/RockPdf
       
      You can combine it easily with RockReplacer: 
      See also a little showcase of the RockPdf module in this thread:
       
    • By bernhard
      WHY?
      This module was built to fill the gap between simple $pages->find() operations and complex SQL queries.
      The problem with $pages->find() is that it loads all pages into memory and that can be a problem when querying multiple thousands of pages. Even $pages->findMany() loads all pages into memory and therefore is a lot slower than regular SQL.
      The problem with SQL on the other hand is, that the queries are quite complex to build. All fields are separate tables, some repeatable fields use multiple rows for their content that belong to only one single page, you always need to check for the page status (which is not necessary on regular find() operations and therefore nobody is used to that).
      In short: It is far too much work to efficiently and easily get an array of data based on PW pages and fields and I need that a lot for my RockGrid module to build all kinds of tabular data.

      Basic Usage

       
      Docs & Download
      https://modules.processwire.com/modules/rock-finder/
      https://gitlab.com/baumrock/RockFinder/tree/master
       
      Changelog
      180810, v1.0.5, basic support for options fields 180528, v1.0.4, add custom select statement option 180516, change sql query method, bump version to 1.0.0 180515, multilang bugfix 180513, beta release <180513, preview/discussion took place here: https://processwire.com/talk/topic/18983-rocksqlfinder-highly-efficient-and-flexible-sql-finder-module/
    • By Thomas Diroll
      Hi guys I'm relatively new to PW and just finished developing a page for a client. I was able to include all necessary functionality using the core fieldtypes but now I it seems that I need to extend them with a custom one. What I need is a simple button, that copies the absolute url (frontend not PW-backend) of the page which is currently edited to the clipboard. As this feature is only needed inside a specific template, I tend to use a custom fieldtype which provides this feature. I've been looking inside the core modules code (eg. FieldtypeCheckbox.module) but I don't really get the structure of it and how its rendered to the admin page. I also didn't find a lot of tutorials covering custom fieldtypes.
      Maybe some of you could give me some tips on how to write a basic custom fieldtype that renders a button which copies the value of
      page->httpUrl() to the clipboard using JS. Thanks!
    • By bernhard
      Some of you might have followed the development of this module here: https://processwire.com/talk/topic/15524-previewdiscussion-rockdatatables/ . It is the successor of "RockDataTables" and requires RockFinder to get the data for the grid easily and efficiently. It uses the open source part of agGrid for grid rendering.
       
      WHY?
      ProcessWire is awesome for creating all kinds of custom backend applications, but where it is not so awesome in my opinion is when it comes to listing this data. Of course we have the built in page lister and we have ListerPro, but none of that solutions is capable of properly displaying large amounts of data, for example lists of revenues, aggregations, quick and easy sorts by the user, instant filter and those kind of features. RockGrid to the rescue 😉 
       
      Features/Highlights:
      100k+ rows Instant (client side) filter, search, sort (different sort based on data type, eg "lower/greater than" for numbers, "contains" for strings) extendable via plugins (available plugins at the moment: fullscreen, csv export, reload, batch-processing of data, column sum/statistics, row selection) all the agGrid features (cell renderers, cell styling, pagination, column grouping etc) vanilla javascript, backend and frontend support (though not all plugins are working on the frontend yet and I don't plan to support it as long as I don't need it myself)  
      Limitations:
      While there is an option to retrieve data via AJAX the actual processing of the grid (displaying, filtering, sorting) is done on the client side, meaning that you can get into troubles when handling really large datasets of several thousands of rows. agGrid should be one of the most performant grid options in the world (see the official example page with a 100k row example) and does a lot to prevent problems (such as virtual row rendering), but you should always have this limitation in mind as this is a major difference to the available lister options that do not have this limitation.
      Currently it only supports AdminThemeUikit and I don't plan to support any other admin theme.
       
      Download: https://gitlab.com/baumrock/RockGrid
      Installation: https://gitlab.com/baumrock/RockGrid/wikis/Installation
      Quikckstart: https://gitlab.com/baumrock/RockGrid/wikis/quickstart
      Further instructions: https://gitlab.com/baumrock/RockGrid/wikis/quickstart#further-instructions
       
      Module status: alpha, License: MIT
      Note that every installation and uninstallation sends an anonymous google analytics event to my google analytics account. If you don't want that feel free to remove the appropriate lines of code before installation/uninstallation.
       
      Contribute:
      You can contribute to the development of this and other modules or just say thank you by
      testing, reporting issues and making PRs at gitlab liking this post buying me a drink: paypal.me/baumrock/5 liking my facebook page: facebook.com/baumrock hiring me for pw work: baumrock.com  
      Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support for 60€ per hour.
       
      Changelog
      180730 support subdir installations 180711 bugfix (naming issue) 180630 alpha realease  
      Use Cases / Examples:
      Colored grid cells, Icons, Links etc. The Grid also has a "batcher" feature built in that helps communicating with the server via AJAX and managing resource intensive tasks in batches:

      Filters, PW panel links and instant reload on panel close:

      You can combine the grid with a chart library like I did with the (outdated) RockDataTables module: