Author Topic: Force Password Change - snippet  (Read 361 times)

Offline Ruud

  • Posts: 3642
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Force Password Change - snippet
« on: December 19, 2015, 11:10:53 PM »
When running a website with many users (i.e. for an association) it could very well be that users are being created by an administrator with a simple password. When this is done the administrator normally asks that the user will change their password after they login.

This snippet makes it possible to force the user to do that.

Just install the snippet as a normal module and include one simple line in your template with the default password sent to your users.
Use the same password - like '1234' - for all new created users and call the snippet like this:

Code: [Select]
<?php force_password_change('1234'); ?>
As soon as a user logs in with the password '1234' he/she will be forced to change it before he/she can continue.

Download: http://www.dev4me.nl/modules-snippets/opensource/force-password-change/

Online dbs

  • Betatester
  • **
  • Posts: 7600
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Force Password Change - snippet
« Reply #1 on: December 20, 2015, 03:31:50 PM »
Tested and works. Good idea.  (Y)
Had first tried this line a droplet... but this don't work.

Offline Ruud

  • Posts: 3642
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Force Password Change - snippet
« Reply #2 on: December 20, 2015, 10:38:20 PM »
No, this cannot work in a droplet.

Droplets are executed after the page content is generated.
This call uses a (not well known) feature in WB to use other content than what the database would generate. This must be done before droplets are executed.