Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/dt login security fixes #2277

Merged
Prev Previous commit
Next Next commit
fix: use custom resetpass page if using custom login
  • Loading branch information
squigglybob committed Nov 28, 2023
commit 91aa5f356c85b73d5899edfe07d993106276754c
14 changes: 7 additions & 7 deletions dt-login/login-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ function dt_login_redirect_login_page() {
return;
}

if ( $page_viewed == 'wp-login.php' && isset( $_GET['action'] ) && $_GET['action'] === 'rp' ) {
return;
}
//if ( $page_viewed == 'wp-login.php' && isset( $_GET['action'] ) && $_GET['action'] === 'rp' ) {
// return;
//}

// if ( $page_viewed == "wp-login.php" && isset( $_GET['action'] ) && $_GET['action'] === 'resetpass' ) {
// wp_redirect( dt_login_url( 'resetpass' ) );
// exit;
// }
if ( $page_viewed == 'wp-login.php' && isset( $_GET['action'] ) && ( $_GET['action'] === 'resetpass' || $_GET['action'] === 'rp' ) ) {
wp_redirect( dt_login_url( 'resetpass' ) );
exit;
}

if ( $page_viewed == 'wp-login.php' && isset( $_GET['action'] ) && $_GET['action'] === 'logout' ) {
wp_redirect( dt_login_url( 'logout' ) );
Expand Down
4 changes: 4 additions & 0 deletions dt-login/login-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@

$form_errors = new WP_Error();

if ( !isset( $_POST['pass1'] ) || $_POST['pass1'] == '' ) {
$form_errors->add( 'password_reset_missing_password', __( 'Missing email or password.', 'disciple_tools' ) );
}

if ( isset( $_POST['pass1'] ) && $_POST['pass1'] != $_POST['pass2'] ) {
$form_errors->add( 'password_reset_mismatch', __( 'Passwords do not match. Please, try again.', 'disciple_tools' ) );
}
Expand Down
Loading