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

made it check for a verified user before sending a notification email #1

Merged
merged 7 commits into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Disciple.Tools theme
Disciple.Tools Theme

Copyright (C) 2016-2017 by Chris W and other contributors
Copyright (C) 2016-2018 Disciple.Tools

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
3 changes: 2 additions & 1 deletion dt-assets/functions/details-bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class="second-bar">
<?php } ?>
</div>
</div>
<div class="cell small-4 center-items hide-for-small-only">
<div class="cell small-4 center hide-for-small-only">
<strong><?php the_title_attribute(); ?></strong>
</div>
<div class="cell small-4 align-right grid-x grid-margin-x">
<div class="cell shrink center-items ">
Expand Down
4 changes: 2 additions & 2 deletions dt-assets/js/contact-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ jQuery(document).ready(function($) {
//create new group
$(".js-create-group").on("submit", function(e) {
e.preventDefault();
let title = $(".js-create-group input[name=title]").val()
let title = $("#create-group-modal .js-create-group input[name=title]").val()
API.create_group(title,contactId)
.then((newGroup)=>{
$(".reveal-after-group-create").show()
$("#new-group-link").html(`<a href="${newGroup.permalink}">${title}</a>`)
$("#new-group-link").html(`<a href="${newGroup.permalink}">${_.escape(title)}</a>`)
$(".hide-after-group-create").hide()
$('#go-to-group').attr('href', newGroup.permalink);
Typeahead['.js-typeahead-groups'].addMultiselectItemLayout({ID:newGroup.post_id.toString(), name:title})
Expand Down
1 change: 1 addition & 0 deletions dt-assets/js/group-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ jQuery(document).ready(function($) {
people_groups : { values: [] },
leaders : { values: [] },
}
$('#group-details-edit #title').val( group.name );
let addressHTML = "";
(group.contact_address|| []).forEach(field=>{
addressHTML += `<li style="display: flex">
Expand Down
4 changes: 3 additions & 1 deletion dt-notifications/notifications-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ public function send_email()
* to allow for asynchronous processing. This is a valid nonce but is not recognized by the WP standards checker.
*/
// @codingStandardsIgnoreLine
if( isset( $_POST[ 'action' ] ) && sanitize_key( wp_unslash( $_POST[ 'action' ] ) ) == 'dt_async_email_notification' && isset( $_POST[ '_nonce' ] ) && $this->verify_async_nonce( sanitize_key( wp_unslash( $_POST[ '_nonce' ] ) ) ) ) {

$id = get_user_by( "email", sanitize_email( $_POST[ 0 ][ 'email' ] ) );
if( (metadata_exists( "user", $id->ID, "default_password_nag" ) || metadata_exists( "user", $id->id, "session_tokens" )) && wp_unslash( $_POST[ 'action' ] ) == 'dt_async_email_notification' && isset( $_POST[ '_nonce' ] ) && $this->verify_async_nonce( sanitize_key( wp_unslash( $_POST[ '_nonce' ] ) ) ) ) {

// @codingStandardsIgnoreLine
wp_mail( sanitize_email( $_POST[ 0 ][ 'email' ] ), sanitize_text_field( wp_unslash( $_POST[ 0 ][ 'subject' ] ) ), sanitize_textarea_field( wp_unslash( $_POST[ 0 ][ 'message' ] ) ) );
Expand Down