Robin S

Password Generator

Recommended Posts

Password Generator

Adds a password generator to InputfieldPassword.

generator

 

Usage

Install the Password Generator module.

Now any InputfieldPassword has a password generation feature. The settings for the generator are taken automatically from the settings* of the password field.

*Settings not supported by the generator:

  • Complexify: but generated passwords should still satisfy complexify settings in the recommended range.
  • Banned words: but the generated passwords are random strings so actual words are unlikely to occur.

 

https://modules.processwire.com/modules/password-generator/

https://github.com/Toutouwai/PasswordGenerator

  • Like 22

Share this post


Link to post
Share on other sites

Thanks for the great module. It would be awesome if you make the link text " Generate password " translateable :)

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, Juergen said:

It would be awesome if you make the link text " Generate password " translateable

Sure, this is done in v0.0.2

14 hours ago, Mike Rockett said:

would be awesome if we could somehow integrate these kinds of passwords (for easy memorisation)

If you know of a Javascript library that can generate those sorts of passwords while still satisfying password field settings I'd be happy to integrate it. But I think memorising passwords is only a short hop away from reusing passwords, which is asking for trouble.

  • Like 3

Share this post


Link to post
Share on other sites
8 hours ago, Robin S said:

If you know of a Javascript library that can generate those sorts of passwords while still satisfying password field settings I'd be happy to integrate it. But I think memorising passwords is only a short hop away from reusing passwords, which is asking for trouble.

Also true - though passphrases and passwords are different beasts in themselves, and one would use them differently, in the context mentioned anyway. I generally like to have passphrases generated, and then saved to my local wallet (and then synced to my cloud wallet). As for a JS lib, I did find some, but they were a bit hectic, and one of them requires a user dictionary (doesn't come with a stock one)... Anyways, was just an idea.

  • Like 1

Share this post


Link to post
Share on other sites

v0.0.4 released - adds support for the new password field option that requires the old password to be entered.

  • Like 3

Share this post


Link to post
Share on other sites
17 hours ago, Robin S said:

v0.0.4 released - adds support for the new password field option that requires the old password to be entered.

Thank you!
Should be part of the core, BTW.

  • Like 1

Share this post


Link to post
Share on other sites

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;

 

passwordgen.thumb.gif.a73fdbd81bc18c2e52ec50c42c19a2ec.gif

 

Thanks.

  • Like 2

Share this post


Link to post
Share on other sites

@flydev, thanks for the report. Looks like I didn't account for use of InputfieldPassword without an associated FieldtypePassword. Fixed in v0.1.5 (I changed to semantic versioning).

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By BitPoet
      Since I was stuck to my flat today I took up a wish and rolled a Process module / CKEditor plugin combo that adds @-autocomplete like the mentions here in the forum to CKEditor fields. It's configurable, but only in module settings for now, the positioning of the select list is quite off and there's still some visual work to be done, so it is in early alpha state.
      Nonetheless, if you want to take a look, here it is:
      https://github.com/BitPoet/ProcessMention

       
      After installation, you may want to look into the "Additional selector" entry in the module's settings. You will most likely want to limit results to certain templates there.
       
      Edit: Updated to version 0.0.30 with fixed positioning of the dropdown.
      Edit2: Settings are configurable in field context now. If pwmentions is enabled, the according settings are shown on the "Input" tab.
       
    • By thuijzer
      https://github.com/thuijzer/processwire-FieldtypeBusinessHours
      Fieldtype Business Hours
      ProcessWire Fieldtype for entering business hours (opening hours)
       
      Input format
      Leave a day empty when closed on that day
      Times are in 24 hour format.
      9:00-12:00 9:00-12:00, 13:00-17:30 16:00-2:00  
      Usage in templates
      Days are from 1 to 7 where 1 is Monday and 7 is Sunday (ISO-8601)
      echo $page->field_name->isNowOpen() ? 'Now open' : 'Now closed'; if($page->field_name[1] == null) { echo 'Closed on Monday'; } if($page->field_name[2]->inRange('11:00')) { echo 'Tuesday at 11:00 open'; } echo $page->field_name[1]; echo $page->field_name[1]->getEntries()->getFrom()->format('H:i');  
    • By hellomoto
      I was working on this:
      class PWCRM extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Client Relationship Management', 'version' => .001, 'singular' => true, 'autoload' => true ); } public function init() {} public function ready() { $this->pages->addHookBefore('render', $this, 'accessHook'); $this->pages->addHookAfter('render', $this, 'hookAfterPageRender'); } public function accessHook(HookEvent $event) { $page = $this->wire('page'); if (!strpos($page->template->tags, 'crm')) return; if (!$this->wire('user')->hasRole('crm')) $this->wire('session')->redirect($this->wire('config')->urls->login);//throw new Wire404Exception(); } public function hookAfterPageRender(HookEvent $event) { $page = $event->object; echo $page->template->tags; if (!strpos($page->template->tags, 'crm')) return; echo $this->wire('config')->urls->templates; include_once($this->wire('config')->urls->templates.'functions.inc'); $pagehtml = $event->return; $pagehtml = str_replace( '</head>', '<link id="css_crm" rel="stylesheet" href="'.$this->wire('config')->urls->templates.'css/crm.css"> </head>', $pagehtml ); $event->return = $pagehtml; //$event->replace = true; } } I have tried placing the hooks into the init() function, and more... Neither method is effective. The echoes now output, but no redirection (although I have the access settings for the top-level template for this set to render a 404 for underprivileged users, which it does, overriding this, but nonetheless this should work aside from that.
      Then I wrote this up quick:
      <?php namespace ProcessWire; class MaintenanceMode extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Maintenance Mode', 'version' => 1, 'summary' => 'Disables the website frontend for non-superusers.', 'singular' => true, 'autoload' => true, 'permanent' => false ); } public function init() { $this->addHookBefore('Page::render', $this, 'displayDecide'); } public function displayDecide($event) { $page = $event->object; if ($page->template == 'admin' || $this->wire('user')->hasRole('superuser')) return; // replace the method hooked $event->replace = true; $event->return = "Patience please while we undergo some brief maintenance work."; } } which likewise avails nothing. What the hell is my problem here? 
    • By adrian
           Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS
       

       
      Integrates and extends Nette's Tracy debugging tool and adds 30+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.