Jump to content

douwe

Members
  • Posts

    6
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    The Netherlands

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

douwe's Achievements

Newbie

Newbie (2/6)

1

Reputation

  1. Joohoo...! By using 'nav' instead of 'page => 'navItems' in getModuleInfo() i am able to have submenu items! Found this info in wire/core/Process.php. I think chatgpt made up 'navitems' itself 😞 But why is manually creating a subpage not working? Regards, Douwe.
  2. Hi! I have an admin module MyModule which is next to Pages, Setup, Modules,... in the main menu. I would like to hang submenu items under it that execute ___executeSubmenu1(), ___executeSubmenu2(), etc. I have found that it can be done by adding a subpage with e.g. name submenu1, template admin and process MyModule. A submenuitem then appears, but when I select the submenu it still executes ___execute() instead of ___executeSubmenu1(). The crazy thing is that the url ../processwire/mymodule/submenu1/submenu1 (so 2x submenu1) then does execute ___executeSubmenu1(). I also tried using navItems in getModuleInfo(), but I don't see anything from that in the menu. In between all my attempts I always do an uninstall/install and Modules/Refresh. Unfortunately to no avail. It's probably a small error on my side, but I just don't see it.... Can anyone give me a little hint to investigate further? I would be very happy with that. Regards, Douwe.
  3. Yes!! Thank you, that's exactly what I need. I can also leave away the userid/created_users_id check that I had in my template php-file. The hook is also providing for that. Thanks again for this very educating reply (for me at least).
  4. Thank you for helping me @kongondo and @Robin S. Disabling the 'view pages' role does prevent accessing the files. A 404-page shows up, but the user can't create a new page either. The goal I'm trying to achieve is that a logged in user can only download the files attached to his own pages ($user->id == $page->created_users_id). Logged in users are creating pages with uploads in the frontend (api). I made a role for logged in users, but than they can still download each others files. I think I need a hook somewhere so that not only the role is checked but also the created_users_id. Is that the way to go? And to which function should I apply the hook?
  5. Hi @kongondo, Thanks for the quick reply. New page (+files) is created after enabling $config->pagefileSecure. I create the page on the frontend with the api, but i also tried creating a new page in the backend. Both have the same result: Access with hyphen triggers a forbidden error. Access without hyphen does download the file even if 'm not logged in.
  6. Hi, I'm a happy new user of Processwire. I would like to use the new template setting 'prevent direct access to file assets'. So I upgraded to the newest dev version 3.0.168. For a template I select the option 'Yes always, regardless of page status or access control'. In the file system is see that al the pagid's for pages with this template are being prefixed with a hyphen, f.e. ../assets/files/-1030/.. And when I try to load http://localhost:8080/site/assets/files/-1030/test.pdf i get a forbidden error, so that seems ok. But... when I try to access the page without the hyphen (http://localhost:8080/site/assets/files/1030/test.pdf) the file is still being downloaded?! I also tried setting $config->pagefileSecure = true and creating a new page with a file, but that doesn't work either. Is there any other setting I should apply to prevent direct access? Kind regards, Douwe.
×
×
  • Create New...