Jump to content

DrQuincy

Members
  • Posts

    323
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by DrQuincy

  1. I think you're right. It makes sense you can't tell PW to ignore images while at the same time handling access for them.
  2. Perfect, thanks! On this comment: I am not setting this to true in my config.php. However, I do have some sites where under the Access tab of the template I have Prevent direct access to file assets owned by pages using this template? set to Yes, always. Does this effectively set $config->pagefileSecure = true for all assets belonging to pages that use that template? In other words, if you are wanting to manage access to assets you cannot use a static 404 HTML file. Is that right? It makes sense but I just wanted to check.
  3. Just an idea really. Recently, I had server issues due to a ton of 404s that were all firing up ProcessWire. It was an unusual scenario but it made me wonder if it's possible to have a static HTML page that is used for either all 404s — or maybe some 404s. All 404s would be simpler. Is it possible to switch this off so that Apache handles all 404s instead of PW? Just thinking out loud but I also wondered if it would be possible to restrict the static 404 page to certain extensions such as images. In my example above, the server overload was due to broken image links. I'd still like all other errors (e.g. 500, 403) to go through PW. Thanks. 🙂
  4. Thanks, yes. The idea of it is great but the SMTP provider is not Google. It's a lesser known one.
  5. Do you know how to hook into WireMail so I can set this manually? I thought it was based on Swift but I just read that's discontinued now. I'd be able to get it working with Swift but I need it to use WireMail for LRP, EmailNewUser, etc to work.
  6. I'm using SMTP successfully with Google and an app password for other clients. A client has a custom stricter setup and they say they can only use SMTP with Oauth2. I presume this will involve regularly generating access tokens. Is there any way to make this work with the WireMail SMTP module? There is nothing in the settings. I need it to work at a global level so all $mail routes through this since I am using the LoginRegisterPro and EmailNewUser modules. Thanks.
  7. I may be missing something glaringly obvious here (I am admittedly tired!)… I have the text formatter TextformatterMarkdownExtra applied to a field that uses EasyMDE in the front end. If I add HTML to the field it gets putput as is. E.g. This is <strong>bold</strong>. This is bold. I thought Markdown would trip out HTML by default. Indeed, in the module settings if I submit the under the Test Markdown section I get: <p>This is &lt;strong&gt;bold&lt;/strong&gt;.</p> But on the front end it renders as: <p>This is <strong>bold</strong>.</p> Any ideas? It's not a massive issue as a client wouldn't typically even know what HTML is but thought I'd check. EDIT: I just tried another site and the other one seems to work as expected but I can't see anything different in the settings! The only difference I can see is the site that doesn't work uses 3.0.229 and the one that does uses 3.0.246. Both use the same version of TextformatterMarkdownExtra (1.8.0).
  8. Here's a much more elegant solution that doesn’t require altering the database: $session->forceLogin('admin'); Place this code in /site/templates/admin.php Don’t forget to disable it after though. 🙂
  9. I'm setting up a site that uses the two-factor auth to login (backend and via LoginRegisterPro); the client also wants to use SMTP. The SMTP didn't work and so I couldn't login via LoginRegisterPro. On /processwire/ the browser had already gone through TFA so I was able to log in. It made me think: had I not been able to log in the way I did, how would I do so if TFA is enabled and SMTP is not working. I am assuming I can disable SMTP or TFA via the database. If that's the case, how do I do this? Would the best way, without losing any SMTP settings, be to empty the data field in the ProcessLogin row of the modules table? Thanks.
  10. How do I use the API to export templates and fields in the same format as when you're logged into the back and and choose Templates|Fields › Export? I've searched but I can't sync anything. Thanks. 😀
  11. Just resurecting this one: Is this possible? I don't want to do it at this stage but I'm just wondering how it might be done.
  12. @bernhard Thanks for your massively helpful debug code. I can see now that the Users::* hooks apply to managing users in the back-end so it was never going to work with LRP — the LRP-specific ones are what I needed.
  13. That's great, thanks, I'm definitely going to try that. 🙂 I do want to know why the User hooks aren't firing but in case anyone is using LRP and wondering the same, I have made what I need to do work with the following hooks: LoginRegisterPro::createdUser: use this to send an admin email to let the site owner know that a new user has registered LoginRegisterProLogin::success: used to set approved=0 on $user More info here: https://processwire.com/store/login-register-pro/docs/#hooks
  14. I have a default front-end user field call approved that is a true|false switch. I want to redirect them to a URL is not yet manually approved. I have this hook in $config->prependTemplateFile file. wire()->addHookBefore('Users::login', function($event) { $user = $event->arguments[0]; $user->of(true); if($user->approved === false) { // Prevent login $event->return = false; wire('session')->redirect('/account/?approved=0'); } }); But it does not fire. Do I have the hook wrong or is it in the wrong place? The file itself is definitely being included and if I replace the contents of the hook to a simple exit statement, still nothing happens. EDIT: I am using LoginRegisterPro, are the hooks different?
  15. Ah-ha, there it is, thanks @AndZyk!
  16. Thanks for the link! There is no such option on the TfaEmail module page. I only get two settings for the code, the “from” email and the method of sending the email. I get that option in LoginRegisterPro — but not for back-end users.
  17. Just that really. I'm using Ryan's TfaEmail module. I can force this on users by role in LoginRegisterPro — but how can I do it for back-end users? Is it possible? I.e. So any already created users use it and also any futures ones — and prevent it from being switched off. Thanks.
  18. If you want to use video directly on your site — as opposed to embeding from YouTube, etc — is just .mp4 generally okay now? I know you used to provide several formats but I just worked with a company that are just using <video><source src="video.mp4" type="video/mp4"></source></video>. Is that good enough? I tested on my various browsers and it all worked — even on my Linux machines.
  19. Yes, good point, I don't need two different child templates. Thanks.
  20. Thanks but I want to use different sorting dynamically though to avoid adding a separate template. One is news, most recent first. The other is events where the date would be ascending since the dates would be in the future. I hope that makes sense.
  21. I have a template that has a date field attached to it and I use this to reverse sort items. This works great for my blog feed. However, I want to use the same template for an events field. To save me managing an entirely separate template, is there a hook I can use that will uncheck the “reverse sort” checkbox dyanically? So: /blog/ sorts children per the template settings, most recent first /events/ uses a hook to display pages date order ascending Note I am only referring to the site tree in the admin. Obviously, on the front end I can easily use selectors to get the desired result. Thanks.
  22. And here's the answer to migrating large sites! Thanks Ryan. https://processwire.com/blog/posts/webp-images-on-an-existing-site/#implementing-the-webp-strategy
  23. If you enable webp, where the easiest way on a legacy site to get a webp version of every image in the CMS?
  24. Apologies, everything I need is here: https://processwire.com/blog/posts/webp-images-and-more/#webp-image-strategies-in-processwire
  25. This is a bit vague but I've always been behind the curve with regards to next-gen images. To those of you PW masters that use them I have a few questions please. 🙂 What is you preferred format? In 2024, do you still need to supply a jpg/png fallback? How to you manage this in PW given that support outside of the browser is quote poor. What I mean by that is while us devs can work with them easily, clients tend to only know what jpgs are. Thanks!
×
×
  • Create New...