Jump to content

pwFoo

Members
  • Posts

    708
  • Joined

  • Last visited

Everything posted by pwFoo

  1. PW 2.x requires php 5.3. So I wouldn't increase the requirements by my module... but you're right! php 5.3 is EOL and an modern hosting should offer a new(er) version or multiple php versions.
  2. I shouldn't post workarounds and fixes in hurry... It's a missing feature with php < 5.5 Note: Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false. So I removed one method call... but there are TWO Maybe this fix will work, because it's without an method call. But I don't know if php <5.5 empty() can handle object properties... At the moment I haven't a php 5.3 test env, so maybe it works for you and you can report back here //if (empty(wire('session')->get('registerStep'))) { $session = wire('session'); if (empty($session->registerStep)) { If the PW alternate syntax ($session->registerStep) shouldn't work with empty() isset could work. //if (empty(wire('session')->get('registerStep'))) { $session = wire('session'); if (!isset($session->registerStep)) {
  3. Hi Fester, You have to add an Inputfield. See example. // Create form field $myField = $modules->get('InputfieldText');
  4. I think empty() can't handle method calls and objects. In the evening I'll take a look and fix it. Thanks for feedback and testing!!!
  5. There are some more lines like the changed one. So is it the same line or another?
  6. Hello Macrura, line 63 of FrontendUserRegisterEmailValidation.module: if (empty(wire('session')->get('registerStep'))) { Seems to be PHP < 5.5 related... To be compatible with PHP 5.3 and 5.4 I have to check the usage of empty() in combination with wire() and replace such calls... I'll take a look later. You could test this: // if (empty(wire('session')->get('registerStep'))) { $session = wire('session'); if (empty($session->get('registerStep'))) {
  7. Version 0.8.5 Add some more comments to FrontendUserRegisterEmailValidation module FrontendUser::auth() is now hookable (to build a auto login after sucessful user registration) Add usage shorthand to call login / register with one method call by set a second param ($redirect) // load module $fu = $modules->get('FrontendUser'); // login echo $fu->login(null, $redirectDestination); // with default fields //echo $fu->login(array('username', 'password', 'persist', 'forgot'), $redirectDestination); // load module $fu = $modules->get('FrontendUser'); // registration echo $fu->register(null, $redirectDestination); // with default fields //echo $fu->register(array('username', 'email', 'emailValidation', 'password'), $redirectDestination); The compatibility to PHP 5.3 seems to work fine, but isn't fully tested. Because Processwire 2.5 / 2.6 requires PHP 5.3+ I would't increase the requirements to PHP 5.4
  8. No problem. If you send me the additional code and I have the time I could rewrite it to a hook. I would like to see the module used by the community and extended by hooks / plugins to keep the module core simple, clean and reusable Custom plugins could be added to my git repo / wiki to share with other PW users. I'm also interested in feedback if you use it inside a project. Just to see how it could be improved.
  9. The hole email verification (hide password field, add verification code field, process additional fields and send the email) is based on hooks without a FU module modification. Additional email and auto login should be done by an additional hook Maybe I can take a look in the evening, but don't know yet... FrontendUser module should work fine, but keep in mind it's alpha at the moment and needs testing!
  10. Thanks for feedback. Is the template append problems also fixed with the new version? Because that was also a anonymous function / php 5.3 problem. Have to verified that the FrontendUserRegisterEmailValidation module configuration is working? It's used as email subject ($this->subject) an prepanded email text ($this->content). Works fine with php 5.5, but haven't tested it with php 5.3. Could you tell me that you have changed? Customization should be possible without hack / modify the module. Just with PW hooks, custom plugins and additional fields
  11. ok. Maybe a prepand / append to template problem? Could you check the config file? I load a custom template from module folder. Maybe I need another way to load it to prevent the template append / prepand... Updated module to 0.8.4 / email validation plugin to 0.0.2. module instance / object is now available via wire('fu') to simplify plugin hooks and... add PHP 5.3 compatibility Minimum tested at the moment! Could you test it and post the results here?
  12. Hi Tom, I think the email template isn't loaded! Again a PHP 5.3 workaround is needed I have an idea how to fix it and make the module compatible to PHP 5.3. I'll update it soon!
  13. Hello Tom, thank You for your feedback here! It's a anonymous function problem / missing feature. I have to add a PHP 5.4 dependency or find a workaround. I missed that because I tested it with a PHP 5.5.24. See here: http://php.net/manual/en/functions.anonymous.php That could be a workaround... /** * Username form field * @return InputfieldText Username field */ protected function usernameRegister() { $field = $this->modules->get('InputfieldText'); $field->label = $this->_('Username'); $field->attr('id+name', 'username'); $field->required = 1; $field->fhSanitizer = 'username'; // workaround PHP 5.3 $fu = $this; //$field->addHookAfter('processInput', function($event) { $field->addHookAfter('processInput', function($event) use ($fu) { $field = $event->object; // workaround PHP 5.3 //$username = $this->form->fhValue($field->name); $username = $fu->attr('form')->fhValue($field->name); if (empty($username)) return; elseif (wire('users')->count("name={$username}") == 0) { // workaround PHP 5.3 //$this->userObj->name = $username; $fu->attr('userObj')->name = $username; } else { $field->error(__('Username already taken!')); } }); return $field; } I think some more changes like that have to be done to get it work with PHP 5.3 But I don't know if it make sense to make it PHP 5.3 compatible. But should be no problem if that's all... P.S.: Sorry for confusion of different topics *g* The correct support topic is: https://processwire.com/talk/topic/9811-frontenduser-login-logout-and-register-users-members/
  14. Version 0.8.3 moved email validation to sub-module FrontendUserRegisterEmailValidation Added FrontendUserRegisterEmailValidation module configuration (email subject and text) Removed plain email template (now generated by php based on the html one) simple example html email template
  15. I have some problems with the email template / config. Subject and text should be configurable, but I won't write a template parser to replace tokens like {{token}} {{url}} ... or something similar. Write the text to the template isn't a good way and also not translatable. So how should / could it be done a nice way? Set text block in module configuration to be shown before the token / link? Move the complex email verification plugin to a separated module file with own config section? Use a page for email subject / text to be translatable like other fields? ... I try to build a universal usable login / register module, so suggestions and feedback is welcome!
  16. Updated FU version 0.8.2 replaced hard coded verification email with simple html / plain templates to send an html email with wiremail. Has to be improved / changed in the future, but I don't know how I'll implement it (module configuration, template, ...) to keep it flexible and simple.
  17. Here is the source code of the LoginPersist integration. $persist = $this->modules->get('InputfieldCheckboxes'); $persist->name = 'persist'; $persist->attr('id+name', 'persist'); $persist->skipLabel = 4; $persist->addoption('persist', $this->_('Remember me?')); $persist->addHookAfter('Session::login', function($event) use (&$persist) { if (isset($persist->value[0]) && $persist->value[0] === 'persist') { $this->modules->get('LoginPersist')->persist(); } }); The examples hook into existing form fields. Add own fields (example "$myField") or change order $fu->login(array('username', 'password', 'persist', 'forgot', $myField)); See basic usage
  18. I should be easy to extend the register form with additional fields (like done with the login and register plugins examples). A FrontendUserProfile is planned and should be easy to build with the FormHelper module (and also without, but I like it It simplify some tasks like sanitize values or form processing). Maybe ProcessProfile core module could do the job... I take a look and maybe add a simple example, but that should be moved to the FormHelper topic.
  19. Hello jacmaes, fhstorage is a hidden admin page to handle file uploads to not existing pages (during frontend page creation for example). It should be added and removed during FormHelperExtra module un-/install. I'll take a look at it later. But FormHelperExtra isn't needed! Just install FormHelper and FrontendUser modules and it should work.
  20. Added new FrontendUser module
  21. Added new FrontendUser module
  22. FrontendUser The FrontendUser module provides a frontend login, logout and user registration functionality. Features See module documentation for details. login with error handling and value sanitizing Plugin: ProcessForgotPassword core module integration Plugin: LoginPersist module integration user registration with username and email address already in use check email adress pre-register validation (email verification) Extendable with additional fields and by PW hooks forms generated by PW form api Custom style / script Requirements FormHelper (0.7.1+) Usage Documentation / examples Repository PW module repo GIT repo ToDo / Issues Issues I hope it will be helpful to the community and I would be glad to get feedback or suggestions for improvement!
  23. FrontendUser module handles login, logout and user registration. I moved the complex email validation plugin, ProcessForgotPassword and LoginPersist module integration into the FrontendUser module for testing. If anyone would do some tests... Repo: https://bitbucket.org/pwFoo/frontenduser/overview Doku: https://bitbucket.org/pwFoo/frontenduser/wiki/Documentation Current download for testing: https://bitbucket.org/pwFoo/frontenduser/get/master.zip
  24. Config was just fine. Tested it once again and it works. Maybe typo with the username ?! Sender address of ProcessForgotPassword is overwritten by WireMailSmtp if different, but works fine... Sorry, should be my bad
  25. I use WireMailSmtp and it works fine with my own code, but I receive no Email from ProcessForgotPassword module. Tested with the admin and my own frontend login without get an email. ProcessForgotPassword seems to use WireMail, but maybe not compatible to WireMailSmtp?
×
×
  • Create New...