Jump to content

pwFoo

Members
  • Posts

    708
  • Joined

  • Last visited

Everything posted by pwFoo

  1. Hi, I need a frontend form with an repeater field (single text field with user input). After the form is submitted it will generate a new page, save it and than fill all the additional fields (works fine with images). But during add an item repeater says: Is there another way to build an "repeater field" used in a frontend form? Is there a solution to get it work?
  2. It was important to check token mismatch and changed / duplicate username or email address before a new user is saved. I think you shouldn't use my plugin. Write a submodule which isn't based on FrontendUserRegisterEmailValidation. Just register an unpublished user. Send an activation mail via hook after save(). User activation could be done as independent (sub-)module.
  3. The Email should contain the token and a link to the second step of user registration form (filled with username, email address and token). Password reset isn't handled by FrontendUser module, it just uses the ProcessForgotPassword core module. Your use case is possible and the needed snippets and examples should be here in the forum, but you need to extend FrontendUser to work as you want it. I implemented ProcessForgotPassword because it should be secure and do the password reset job.
  4. Take a look at the FrontendUserRegisterEmailValidation submodule. It adds an email validation step before the new user will be registered. Just load the plugin as additional field "emailValidation". $fu->register(array('username', 'email', 'emailValidation', 'password'));
  5. Hi apeisa, any updates / change history? My latest purchased version is 2015-3-23 Regards
  6. Website and shop to purchase a copy isn't available any more?
  7. I haven't take a look into it, but add hooks have to be done before $fu->process(). After this method the form is processed by PW. Why not send the email by wireMail() with custom content and recipient? $mail = wireMail(); $mail->to($adminEmail); $mail->subject($subject); // html body //$mail->bodyHTML($emailContentHtml); // plain body $mail->body($emailContentPlain); $mail->send(); Could be done hooked after FrontendUser::save.
  8. Hi, $modules->get('EmailAdminNewUser'); // lade Modul um den Admin zu benachrichtigen I haven't used or seen EmailAdminNewUser before. So I don't know how it should work / triggered... public function init() { if($this->data['generatePassword']){ $this->addHookBefore('InputfieldPassword::render', $this, 'notRequiredNote'); $this->addHookBefore('InputfieldPassword::processInput', $this, 'removeRequired'); } if(wire('page')->process == "ProcessUser") $this->addHookAfter('ProcessPageEdit::buildFormContent', $this, 'addEmailFields'); $this->addHookAfter('Password::setPass', $this, 'getPassword'); $this->pages->addHookBefore('saveReady', $this, 'sendNewUserEmail'); } FrontendUser "save()" method won't trigger it I think... EmailAdminNewUser will only work if it hooks into $user->save().
  9. FrontendUser uses a temp PW User object. All existing fields should be saved, but it's done via PW api, not the PW admin create user process (haven't looked into it...). Send email after user registration? You could write a plugin hook after FrontendUser save() method... /** * Save the temp User object * @param User $user Temp User object to save * @return boolean Sucessful (true) saved or not (false) */ protected function ___save($user) { if (empty($user->name) || empty($user->email) || $user->pass->hash == '') { return $this->_('Register process unexpected failed!'); } if ($user->save()) { return true; } return $this->_('User registration failed!'); } Hook after save() method. If return value === true (exactly true! not "== true") you can send a mail via PW api or load a module to send the email...
  10. Conditional hide / remove fields from form, advanced processing is done in the RegisterEmailValidation plugin. Password field was removed before the form will be rendered. https://bitbucket.org/pwFoo/frontenduser/src/71207f581585ac6e089b47790eadbf3bdbedd5a9/FrontendUser/FrontendUserRegisterEmailValidation.module?at=master#FrontendUserRegisterEmailValidation.module-155 But it's a required field, so required have to be changed to false before form process. https://bitbucket.org/pwFoo/frontenduser/src/71207f581585ac6e089b47790eadbf3bdbedd5a9/FrontendUser/FrontendUserRegisterEmailValidation.module?at=master#FrontendUserRegisterEmailValidation.module-65 It should be also possible to skip the username field. $fu->register(array('email', 'password')); It isn't required by the module, but the you have to set the needed attributes before you call ___save($user). $user is a PW User object. So a pre-save hook (like used with additional nickname plugin) should work for you. $fu->addHookBefore('save', function($event) { $form = wire('fu')->form; if(!count($form->getErrors())) { wire('fu')->userObj->nickname = $form->fhValue('username', 'text'); } }); Just change it to wire('fu')->userObj->username = ...
  11. Strange... Netbeans have code completion for variables like $page, $pages, $padRender (test instance with PadLooper installed), but missed attributes and methods ($page->myField). Quick test with Visual Studio Code (Linux, 0.5) shows me code completion for attributes and methods ($page->title, $page->body ...) out of the box (it seems also without the TemplateStubs stubs.php file?!), but not variables like $padRender, $pages, ... At the moment I can't spend time to debug, but I'll reply when I solved my problem.
  12. Hello mindplay, stubs.php file wasn't generated correct. So I deleted it and regenerated it by submit at modules page. Now my fields are added to stubs.php, but Netbeans ignore the fields at code completion... I have to test some configuration settings and take a look at the Netbeans documentation. Thanks
  13. Hi Beluga, I quickly added some code snippets to the documentation. https://bitbucket.org/pwFoo/frontenduser/wiki/Documentation#markdown-header-code-snippets-examples Sorry, but during vacation I was online with my mobile. So I haven't searched this topic for code snippets before I answered
  14. Hi mindplay, with this module installed and added the following code to my (basic-page) template <?php /** * @var tpl\basic_page $page */ code completion for things like "$page->title" should be work with Netbeans? stubs.php file exists, folder is writable. Netbeans suggest variable / object names like $page, $modules, but not the object properties (example $page->title)
  15. Hi Beluga, so all problems solved now? The module is designed to be as flexible as possible. All addons and also changes should be done with params (add or replace fields) and hooks (additional or changes processing). You can translate labels and also change fields from outside if needed... $usernameField = $fu->form->get("username"); $usernameField->label = "New label"; All is based on PW hooks and PW form api / PW fields.
  16. You can translate the field labels or modify the fields (set your own label). Nö need to hack the module Is $field->fullname the field name string? $fullname = wire('fu')->form->fhValue($field->fullname); Should be something like that. $fullname = wire('fu')->form->fhValue("fullname"); Just add a debugging output inside your hook to verify that. FormHelper documentation https://bitbucket.org/pwFoo/formhelper/wiki/Documentation No PC here to take a closer look. Mobile only for two weeks
  17. First... do NOT modify the module! Extend it! Just define the field and add it to the register() optional field array. Read the wiki documentation (https://bitbucket.org/pwFoo/frontenduser/wiki/Documentation#markdown-header-register). Also take a look at code comments). Have you added the field "fullname" to the user template? If field is added and value is der ro the userObj it should be saved. See nickname example (https://bitbucket.org/pwFoo/frontenduser/wiki/Register%20extensions%20and%20plugins) and add debugging output to check your value.
  18. fhSubmitBtn is part of FormHelper and not FrontendUser. That's why you have to use $fu->form->fhSubmitBtn to get the object and der the Form field error Inside a hook you can use $fu = wire('fu'); to work with the FrontendUser object / instance. Or also the FU Form: $form = wire('fu')->form
  19. No need to change FormHelper or FrontendUser modules. Have you set $form inside your template like that? $form = $fu->form; Try something like that inside your template file (untested code!). // load module $fu = $modules->get('FrontendUser'); // prepare / create register form with default fields $fu->register(); // Add hooks to the form / fields // Your code here $fu->form->addHookAfter('processInput', function() { $recaptcha = wire('modules')->get('Recaptcha')->verifyResponse(wire('input')->post->g-recaptcha-response); if(!$recaptcha) { $form->fhSubmitBtn->error('reCAPTCHA validation not ok!'); } }); // process register / form submit $fu->process($redirectDestination); // output register form echo $fu->render();
  20. Hi Beluga, I don't like captcha solutions and so I haven't used the recaptcha module. I use my emailValidation plugin (shipped with FrontendUser module). echo $fu->register(array('username', 'email', 'emailValidation', 'password'), $redirectDestination); It validates the email address as an additional registration step before the user will be added. If recaptcha needs an additional form field just add the form field object echo $fu->register(array('username', 'email', 'password', $myRecaptchaField), $redirectDestination); Add a hook to the form processing (a $form->addHookAfter 'processInput' should do it...) to execute "verifyResponse". If the recaptcha validation isn't ok just set a field error inside the hook to stop the user registration process. $form->fhSubmitBtn->error('reCAPTCHA validation not ok!'); I hope that will help you to figure it out, because I'm in hurry and have no time to take a closer look at it.
  21. It's designed in order to avoid the need URL parameters So you can create a template / page logout or just use your code above.
  22. CSS prefix is also a nice way to do it! Thanks!
  23. Ok, should also be fine If I really need this modification I use a hook / autoload module. Thanks for this awesome module. It makes life easier
  24. Thanks! At the moment I have no time to test it, but I'll report back then... Make css file a module configuration isn't needed in every use case but would be nice. Any plans to change it?
  25. FCM release 0.5.0 (no documentation at the moment... sorry!) requires FormHelper add / edit pages default sanitizer based on field type (textarea or text) if no sanitizer is set to the field skip fields optional use admin form styles file / image upload during page add (check input, page pre-save, set field values and add files and again save the page...) usage / example // load FCM $fcm = $modules->get('FrontendContentManager'); // ADD a page to given parent with parent template $output = $fcm->renderAdd($parentPage); // or EDIT given page $output = $fcm->renderEdit($pageToEdit); // echo jsConfig inside the html head element echo $fcm->JsConfig(); // outpunt needed scripts for inputfield modules, ... inside your html head element foreach ($config->styles as $file) { echo "<link type='text/css' href='$file' rel='stylesheet' />\n"; } foreach ($config->scripts as $file) { echo "<script type='text/javascript' src='$file'></script>\n"; } // echo $output inside your template / html body element echo $output; PW module repo: http://modules.processwire.com/modules/frontend-content-manager GIT repo: https://bitbucket.org/pwFoo/frontendcontentmanager/src/
×
×
  • Create New...