Jump to content

DrQuincy

Members
  • Posts

    323
  • Joined

  • Last visited

  • Days Won

    1

DrQuincy last won the day on August 30 2023

DrQuincy had the most liked content!

Profile Information

  • Location
    UK

Recent Profile Visitors

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

DrQuincy's Achievements

Sr. Member

Sr. Member (5/6)

84

Reputation

  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!
×
×
  • Create New...