Jump to content

gerritvanaaken

Members
  • Posts

    44
  • Joined

  • Last visited

1 Follower

About gerritvanaaken

  • Birthday 08/01/1979

Contact Methods

  • Website URL
    http://praegnanz.de
  • Skype
    van-aaken

Profile Information

  • Gender
    Male
  • Location
    Würzburg, Germany

Recent Profile Visitors

3,370 profile views

gerritvanaaken's Achievements

Jr. Member

Jr. Member (3/6)

45

Reputation

  1. Hallo, I have some problems with special characters in POST URLs. It’s awkward. These are my routes: ['OPTIONS', 'tasks/{city}/{employee}', ['GET']], ['GET', 'tasks/{city}/{employee}', Googledocs::class, 'fetchTasks'], ['OPTIONS', 'tasks/{city}/{employee}/{row}', ['POST']], ['POST', 'tasks/{city}/{employee}/{row}', Googledocs::class, 'putTasksRow'] Employees with an Umlaut, however, seem to confuse the path/method detection: GET https://myapi.com/api/docs/tasks/wuerzburg/Pia-Mäder (works) POST https://myapi.com/api/docs/tasks/wuerzburg/Pia-Mäder (works, but shouldn’t) POST https://myapi.com/api/docs/tasks/wuerzburg/Pia-Mader (error 405, as intended) POST https://myapi.com/api/docs/tasks/wuerzburg/Pia-Mäder/42 (error 405, but should work) POST https://myapi.com/api/docs/tasks/wuerzburg/Pia-Mader/42 (works) (Yes, I should be using PUT or PATCH instead of POST, but my hosting provider has – strangely enough – a problem with Umlauts as well, when they are in PUT requests. It doesn’t even start PHP in these cases and throws an 405 error from Apache)
  2. Nevermind. My POST request had the wrong Content Type Header.
  3. This may be a silly question, but I couldn’t access the payload/body of a POST request within the public static function. The $data variable only contains the path, but not the body of the request. My code goes like this: 'email' => [ ['OPTIONS', '', ['POST']], ['POST', '', Email::class, 'sendEmail'] ], class Email { public static function sendEmail ($data) { var_dump($data); // contains only path var_dump(wire('input')); // "post" data is null My goal here is, of course, to send an email from a JavaScript application, using my PW installation as proxy.
  4. I manually updated the plugin with your pull request. It works for me under PHP 8.1 (stopped working with JavaScript-Errors after upgrading PHP. Would be nice if it could be merged into the official repo!
  5. One field for each role could cause problems, because a new user might have more than one role. Then: which message do you send? All of them? You would need some complicated conditional logic in the UI. Not all that easy.
  6. Wow, @adrian – that looks good, it might be exactly what I need for my client. I’ll chedk this out in the next few days. Do you have a small hint in which format I set line breaks? $u->emailMessage = "Hello {name}\n\nwelcome to the show"; or better this way? $u->emailMessage = 'Hello {name} welcome to the show';
  7. Is it possible to have different welcome messages for different User-Roles? I use the module via API. Maybe it’s possible to manually choose an email template file for each welcome message, something like this: $u = new User(); $u->name = "foo"; $u->pass = randomPassword(); $u->sendEmail = true; $u->welcomeMessageFile = '/some/path/client.txt'; $u->save() My client has a bunch of different user types that need a variety of welcome texts. Any idea how I could accomplish that?
  8. Thanks for the update! It would be brilliant if you could take a look at two issues that I experience using the new custom image/file data (which were introduced in 3.0.142). This feature seems to be not that stable in repeater context and multi-language context...
  9. @Jens Martsch - dotnetic That is more or less the same that I did. Not pretty, but works:
  10. Here is my final init.php code for bilingual password forgot. if (wire('session')->language) { wire('languages')->setLanguage(wire('session')->language); } $wire->addHookBefore('ProcessLogin::execute', function($event) { if (wire('input')->lang == 'fr') { wire('languages')->setLanguage(7085); wire('session')->language = 7085 } });
  11. I’m such a noob! I used the hook with function parentheses. ProcessLogin::execute() is wrong. ProcessLogin::execute works totally fine. Thanks, case closed!
  12. Hey @kixe Thanks for your answer. However, I couldn’t hook in correctly. I tried every hook from "ProcessLogin". The most suitable seemed "buildLoginForm" or "renderLoginForm", because I want the form itself to be translated. None of my hooking attempts seemed to be executed. This is from my init.php: $wire->addHookBefore('ProcessLogin::buildLoginForm()', function($event) { wire('log')->save('langlog', 'language should be: '.wire('input')->lang); if (wire('input')->lang == 'fr') { wire('languages')->setLanguage(7085); } }); I cannot explain why there is no log entry after visiting mysite.com/processwire/?forgot=1&lang=fr
  13. If my backend has two languages, is there any way to force (via URL parameter?) which language will be displayed on the login page and the password forgot page?
  14. Maybe I’ll just build the language-dependend "show/hide" switch as a hidden field, and then write a little bit of custom javascript to somehow make it very compact in the top right corner. Let’s see how that works out.
×
×
  • Create New...