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
10 changes: 7 additions & 3 deletions dt-core/admin/menu/tabs/tab-sso-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,21 @@ class="nav-tab <?php echo esc_html( ( $tab == $key ) ? 'nav-tab-active' : '' );
<table class="widefat striped">
<tbody>
<?php
$any_multisite_level_args = false;
if ( ! empty( $vars ) ) {
foreach ( $vars as $key => $value ) {
if ( $tab === $value['tab'] ) {
$any_multisite_level_args = is_multisite() && !empty( $value['multisite_level'] );
$this->tab( $value );
}
}
}


?>
<tr>
<td colspan="2">
<button class="button" type="submit">Save</button> <button class="button" type="submit" style="float:right;" name="delete" value="1">Reset</button>
<button class="button" type="submit">Save</button> <button class="button" <?php echo esc_attr( $any_multisite_level_args ? 'disabled' : '' ) ?> type="submit" style="float:right;" name="delete" value="1">Reset</button>
</td>
</tr>
</tbody>
Expand All @@ -151,9 +155,9 @@ public function tab( $args ) {
</td>
<td>
<input
type="text"
type="<?php echo esc_attr( $must_have_super_admin_rights ? 'password' : 'text' ) ?>"
name="<?php echo esc_attr( $args['key'] ) ?>"
value="<?php echo esc_attr( $args['value'] ) ?>"
value="<?php echo esc_attr( $must_have_super_admin_rights ? 'hidden secret value' : $args['value'] ) ?>"
<?php echo $must_have_super_admin_rights ? 'disabled' : '' ?>
/>
<?php echo esc_attr( $args['description'] ) ?>
Expand Down
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
10 changes: 1 addition & 9 deletions dt-login/login-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,7 @@ public function __construct() {
}

public function header_style(){
// parent::header_style();
?>
<style>
body { background: #f0f0f1; }
.login-remember { float: left; }
.login-submit { float: right; }
#firebaseui-auth-container { clear: both; }
</style>
<?php
parent::header_style();
}

public function body(){
Expand Down
Loading
Loading