lumpysimon / wp-force-password-change Goto Github PK
View Code? Open in Web Editor NEWA WordPress plugin that forces users to change their password the first time they log in after registering
A WordPress plugin that forces users to change their password the first time they log in after registering
Add an admin page where administrators can force all users to change their password next time they log in. Could be useful for example if your site has been hacked and you want everyone to change their passwords.
Would probably need to be able to specify which roles it applies to.
Maybe also with the option to email users?
Add a checkbox to the user edit screen that will force a user to change their password next time they log in.
There are some plugins like buddypress that use a higher priority for template_redirect by default. If this is the case, the template_redirect from this plugin will be ignored.
Hi, i installed your plugin and it caused error too many redirects?
thanks
Hi Simon, thanks for your plugin ! But I try to change the redirect url to a custom page with a form added by the shortcode from pippinplugins. So I try as jibranb said, with changing the url but it doesn't work and I'm always redirected to the wp-admin/profile page.
This is the code :
`function redirect() {
global $current_user;
if ( is_admin() ) {
$screen = get_current_screen();
if ( 'profile' == $screen->base )
return;
if ( 'plugins' == $screen->base )
return;
} else {
global $wp;
$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
if ( strpos( $current_url, 'connexion-collaborateur' ) ) {
return;
}
}
if ( !is_user_logged_in() )
return;
wp_get_current_user();
if ( get_user_meta( $current_user->ID, 'force-password-change', true ) ) {
wp_redirect( get_site_url() . '/changement-mdp' );
exit; // never forget this after wp_redirect!
}
}`
Would you say me what is wrong ?
After that, I'll have an other question ;-)
Thanks a lot !!
If I deactivate the plugin, I can't get back the original email message for password as new user is created.
Hi @lumpysimon,
ΒΏIs there any repo where i can download old versions of this plugin?
I've got a script that checks and downloads a concrete version (used to be 0.5) using @wp-cli but it doesn't work anymore because there are no previous versions available neither here nor at wordpress.com π
Regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.