flydev

Members
  • Content count

    405
  • Joined

  • Last visited

  • Days Won

    11

flydev last won the day on November 22 2017

flydev had the most liked content!

Community Reputation

787 Excellent

3 Followers

About flydev

  • Rank
    Sr. Member
  • Birthday 09/21/1983

Profile Information

  • Gender
    Male
  • Location
    France

Recent Profile Visitors

2,188 profile views
  1. Thanks you very much. FYI the problem you will encounter with a modified core module, its all the modified code will be ripped off when updating the site.
  2. I am highly interested to see how in term of code you manage this. Did you hardcoded the login name in a hook or something like that ? As you say that you are monitoring a login for a specific username, you could prevent a login by hiding deeper the admin by naming the page with something complex you only know, eg. an url based on a HASH.
  3. Thank you - I will check, as now, I don't know why isn't working
  4. Did the challenge work ? I mean, the reCapatcha widget is "green-checked" ? To be sure that the problem is not in the code I give you (I am currently using the same snippet on a website) , you should try to get the challenge working on a regular module call in a regular form. Can you test it and report back ?
  5. Good, now I think that your google challenge is not successful. Be sure that you saved the changes in your list of supported domains once you added the localhost. Anything in the developer console ?
  6. Yes it is. Read my last edit in my previous post. Localhost for testing is fine, no problem with that.
  7. Sorry, I totally missed it ! Will try to find the time asap
  8. Hi @LAPS try the following : In ready.php put the following code : $captchaobj = null; wire()->addHookProperty('LoginRegister::captcha', function ($event) { $event->return = wire('modules')->get("MarkupGoogleRecaptcha"); }); wire()->addHookAfter('LoginRegister::buildLoginForm', function ($event) { /* @var $form InputfieldForm */ $obj = $event->object; $form = $event->return; $form->description = false; // remove the description $f = new InputfieldMarkup(); $f->markupText = $obj->captcha->render(); foreach ($form->children as $field) { if ($field instanceof InputfieldSubmit) { // find the submit button $form->insertBefore($f, $field); // insert reCAPTCHA before the submit button } } $event->return = $form; }); wire()->addHookBefore('LoginRegister::processLoginForm', function ($event) use (&$captchaobj) { $obj = $event->object; $captchaobj = $obj->captcha; }); wire()->addHookBefore('Session::login', function ($event) use (&$captchaobj) { if (!is_null($captchaobj) && $captchaobj->verifyResponse() == false) { $event->arguments(0, ''); $event->arguments(1, ''); $event->arguments(2, false); $event->return = false; } }); Just one thing, I couldn't get the invisible mode to work with LoginRegister, only the reCAPTCHA v2. edit: a small hint about the getScript() : you should call it from the main file, I mean, your "index.php" and only if the user isn't loggedin. if(!$user->isLoggedin()) { echo $modules->get("MarkupGoogleRecaptcha")->getScript(); }
  9. Hi @sebr You have to install the Process module called ProcessDuplicator. You can find it in the menu Modules > Install > ProcessDuplicator then once installed, you will find the module under Setup > Duplicator or click the link <eye-icon> Package Manager in Duplicator.
  10. You will end up with a PHP function (written by @mindplay.dk) ,two templates and pages which will define your menu. I will write the tutorial a bit later in the afternoon.
  11. Thanks you. it turns out that with TemplateEngineFactory it works - at least for me - in templates, the 404 is fired, but not in bootstrapped script 😬 It is your case ? And I ended up testing to throw a 404 from a bootstrapped script on two others websites which don't have TemplateEngineFactory and also on a fresh install and it doesn't work, I think we can dismiss the module.
  12. if you have a little courage (and if anyone else is interested), I can write you a little tutorial but you must put your hands dirty 😁, let me know.
  13. Hi @Robin S In a process module I am writing, there is a function to create a new user. With PasswordGenerator installed (a must have!) I get the following notice : PHP Notice: Trying to get property of non-object in .../modules/PasswordGenerator/PasswordGenerator.module:76 When I dump $field, Tracy return a null value : $field = $inputfield->hasField; // line 47 There is nothing special in the function, I just declare a new InputfieldPassword : [...] // password $field = new InputfieldPassword(); $field->attr("id+name","password"); $field->label = __("Mot de passe"); $field->required = true; $field->minlength = 6; $field->columnWidth = 50; $form->append($field); [...] $out = $form->render(); return $out; Thanks.
  14. I can't get the 404 working in a template or bootstrapped script : <?php namespace ProcessWire; include_once(__DIR__ . '/../index.php'); if(!$config->ajax || !$user->isGuest()) { throw new Wire404Exception(); } as @Pete already said, it amusingly throws an exception on my install. I am on PW 3.0.88 but was not working on 3.086 either. What I can check ? If it help, I have TemplateEngineFactory installed and I think its the main cause. I might have posted on the module's thread...
  15. this should work : $field = $fields->get('comments'); $comments = $field->type->find($field, "sort=-created");