Skip to content

Commit

Permalink
Merge pull request #2510 from QuizandSurveyMaster/dev-zubair
Browse files Browse the repository at this point in the history
fixed issue with email login
  • Loading branch information
zubairraeen authored Mar 27, 2024
2 parents fb7d7d7 + a0a788f commit 66d8038
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions js/qsm-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,7 @@ var QSMContact;
answers: [],
required: false,
hide_label: false,
use_default_option: false,
use: '',
enable: true,
is_default: false
Expand All @@ -1476,6 +1477,7 @@ var QSMContact;
type: field.find('.type-control').val(),
required: field.find('.qsm-required-control').prop('checked'),
hide_label: field.find('.qsm-hide-label-control').prop('checked'),
use_default_option: field.find('.qsm-use-default-control').prop('checked'),
use: field.find('.use-control').val(),
enable: field.find('.enable-control').prop('checked'),
};
Expand Down Expand Up @@ -1577,6 +1579,9 @@ var QSMContact;
if (['checkbox', 'radio', 'select', 'date'].includes(type)) {
field.find('.qsm-contact-form-field-settings .qsm-hide-label-option').hide();
}
if ( 'select' == type ) {
field.find('.qsm-contact-form-field-settings .qsm-use-default-option').show();
}
jQuery(document).trigger('qsm_contact_field_hide_show_settings', [field, type]);
}
};
Expand Down
3 changes: 3 additions & 0 deletions php/admin/options-page-contact-tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ function qsm_options_contact_tab_template() {
<div class="qsm-contact-form-group qsm-hide-label-option">
<label class="qsm-contact-form-label"><input type="checkbox" name="hide_label" class="qsm-hide-label-control" <# if ( "true" == data.hide_label || true == data.hide_label ) { #>checked<# } #> ><span><?php esc_html_e('Hide Label?', 'quiz-master-next');?></span></label>
</div>
<div class="qsm-contact-form-group qsm-use-default-option">
<label class="qsm-contact-form-label"><input type="checkbox" name="use_default_option" class="qsm-use-default-control" <# if ( "true" == data.use_default_option || true == data.use_default_option ) { #>checked<# } #> ><span><?php esc_html_e('Make the first option default selection?', 'quiz-master-next');?></span></label>
</div>
<div class="qsm-contact-form-group qsm-placeholder-option">
<label class="qsm-contact-form-label"><?php esc_html_e('Placeholder', 'quiz-master-next');?></label>
<input type="text" class="qsm-contact-form-control" name="placeholder" value="{{data.placeholder}}">
Expand Down
5 changes: 4 additions & 1 deletion php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ public function qsm_ajax_login() {
$user = get_user_by('login', $username);

if ( ! $user ) {
wp_send_json_error( array( 'message' => __( 'User not found! Please try again.', 'quiz-master-next' ) ) );
$user = get_user_by('email', $username);
if ( ! $user ) {
wp_send_json_error( array( 'message' => __( 'User not found! Please try again.', 'quiz-master-next' ) ) );
}
}

$user_id = $user->ID;
Expand Down
8 changes: 5 additions & 3 deletions php/classes/class-qsm-contact-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,11 @@ class="qmn_quiz_radio"
?>
<span class='mlw_qmn_question qsm_question'><?php echo esc_attr( $field_label ); ?></span>
<select class='<?php echo esc_attr( $class ); ?>' name='contact_field_<?php echo esc_attr( $index ); ?>' id='contact_field_<?php echo esc_attr( $index ); ?>'>
<option value=''>
<?php echo esc_html( __('Choose ', 'quiz-master-next').$field_label ); ?>
</option>
<?php if ( ! isset( $field['use_default_option'] ) || 'true' != $field['use_default_option'] ) { ?>
<option value=''>
<?php echo esc_html( __('Choose ', 'quiz-master-next').$field_label ); ?>
</option>
<?php } ?>
<?php
$option_values = explode( ",", $field['options'] );
// Iterating over comma separeted values to populate option tag
Expand Down

0 comments on commit 66d8038

Please sign in to comment.