Changeset 1629009
- Timestamp:
- 04/04/2017 09:18:25 AM (9 years ago)
- Location:
- keep-in-touch/trunk
- Files:
-
- 3 edited
-
class-keep-in-touch-db.php (modified) (3 diffs)
-
class-keep-in-touch-msg.php (modified) (1 diff)
-
keep-in-touch.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
keep-in-touch/trunk/class-keep-in-touch-db.php
r1628720 r1629009 50 50 } 51 51 52 static function register_subscription_request($email, $code )52 static function register_subscription_request($email, $code, $full_name) 53 53 { 54 54 global $wpdb; … … 63 63 'code' => $code, 64 64 'status' => 'pending_activation', 65 'full_name' => $full_name, 65 66 ), 66 67 array( … … 80 81 'weekly' => true, 81 82 'newsletter' => true, 83 'full_name' => $full_name, 82 84 ) 83 85 ); -
keep-in-touch/trunk/class-keep-in-touch-msg.php
r1628704 r1629009 44 44 '<form method="post" action="' . home_url(Keep_In_Touch_Utils::get_page_path_from_slug(Keep_In_Touch_Utils::$PAGE_SLUG)) . '">' . 45 45 '<input type="hidden" name="keep_in_touch_email_reference" value="' . $email . '" />' . 46 '<input type=" hidden" placeholder="' . __('Enter your name', 'keep-in-touch') . '" name="keep_in_touch_full_name" value=""/>' .46 '<input type="text" placeholder="' . __('Enter your name', 'keep-in-touch') . '" name="keep_in_touch_full_name" value="" style="width:100%"/>' . 47 47 '<input type="text" placeholder="' . __('Enter email', 'keep-in-touch') . '" name="keep_in_touch_email" value="" style="width:100%" />' . 48 48 '<br /><input type="submit" name="keep_in_touch_submit" value="' . __('Sign up', 'keep-in-touch') . '" />' . -
keep-in-touch/trunk/keep-in-touch.php
r1628720 r1629009 91 91 92 92 $email = sanitize_email($_POST['keep_in_touch_email']); 93 if (!isset($_POST['keep_in_touch_email_reference'])) 93 if (!self::is_null_or_empty_string($_POST['keep_in_touch_email_reference'])) 94 $email_reference = sanitize_email($_POST['keep_in_touch_email_reference']); 95 if (!self::is_null_or_empty_string($_POST['keep_in_touch_full_name'])) 96 $full_name = sanitize_text_field($_POST['keep_in_touch_full_name']); 97 98 if (!isset($email_reference)) 94 99 self::handle_subscribe_first_step($email); 95 else if ( sanitize_email($_POST['keep_in_touch_email_reference'])== $email)96 self::handle_subscribe_second_step($email );100 else if ($email_reference == $email) 101 self::handle_subscribe_second_step($email, $full_name); 97 102 else 98 103 Keep_In_Touch_Msg::emit_invalid_anti_robot_check($email, $email_reference); … … 104 109 } 105 110 106 static private function handle_subscribe_second_step($email )111 static private function handle_subscribe_second_step($email, $full_name) 107 112 { 108 113 $confirmation_code = Keep_In_Touch_Utils::generate_unique_id(20); 109 if (Keep_In_Touch_Db::register_subscription_request($email, $confirmation_code ))114 if (Keep_In_Touch_Db::register_subscription_request($email, $confirmation_code, $full_name)) 110 115 Keep_In_Touch_Msg::emit_confirm_subscription($email, $confirmation_code); 111 116 else
Note: See TracChangeset
for help on using the changeset viewer.