Changeset 776563
- Timestamp:
- 09/22/2013 01:47:10 AM (13 years ago)
- Location:
- post-by-email/trunk
- Files:
-
- 5 edited
-
22942_updated_for_3.7.diff (modified) (1 diff)
-
class-post-by-email-admin.php (modified) (3 diffs)
-
class-post-by-email.php (modified) (13 diffs)
-
js/admin.js (modified) (7 diffs)
-
views/admin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
post-by-email/trunk/22942_updated_for_3.7.diff
r773660 r776563 423 423 - 424 424 -$pop3->quit(); 425 +do_action( 'wp-mail.php');425 +do_action( 'wp-mail.php' ); 426 426 \ No newline at end of file -
post-by-email/trunk/class-post-by-email-admin.php
r773662 r776563 139 139 } 140 140 141 if ( strpos( $options['pin'], ']' ) ) {141 if ( strpos( $options['pin'], ']' ) ) { 142 142 $error_message = __( 'Error: PIN cannot contain shortcode delimiters.', 'post-by-email' ); 143 143 add_settings_error( 'post_by_email_options', … … 199 199 ); 200 200 WP_Screen::get($this->plugin_screen_hook_suffix)->add_help_tab( array( 201 'id' => 'options-postemail', 202 'title' => __( 'Post Via Email' ), 203 'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress install an email with the content of your post. You must set up a secret e-mail account with POP3 access to use this, and any mail received at this address will be posted, so it’s a good idea to keep this address very secret.', 'post-by-email' ) . '</p>', 204 ) ); 201 'id' => 'options-postemail', 202 'title' => __( 'Post Via Email' ), 203 'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress install an email with the content of your post. You must set up a secret e-mail account with POP3 access to use this, and any mail received at this address will be posted, so it’s a good idea to keep this address very secret.', 'post-by-email' ) . '</p>', 204 ) 205 ); 205 206 } 206 207 … … 226 227 227 228 wp_enqueue_script( 'post-by-email-admin-js', plugins_url( 'js/admin.js', __FILE__ ), 'jquery', '', true ); 229 230 // add nonces 231 $nonces = array( 232 'logNonce' => wp_create_nonce( 'post-by-email-clear-log' ), 233 'pinNonce' => wp_create_nonce( 'post-by-email-generate-pin' ), 234 ); 235 wp_localize_script( 'post-by-email-admin-js', 'PostByEmailNonces', $nonces ); 228 236 } 229 237 -
post-by-email/trunk/class-post-by-email.php
r776219 r776563 226 226 227 227 if ( $last_checked && ! WP_DEBUG ) { 228 $log_message = __( 'Please wait at least five minutes to check mail again!', 'post-by-email' ); 228 $time_diff = __( human_time_diff( time(), time() + WP_MAIL_INTERVAL ), 'post-by-email' ); 229 $log_message = sprintf( __( 'Please wait %s to check mail again!', 'post-by-email' ), $time_diff ); 229 230 $this->save_log_message( $log_message ); 230 231 return; … … 331 332 $pin = implode( $pin ); 332 333 333 if ( $pin != $options['pin'] ) {334 if ( $pin != $options['pin'] ) { 334 335 // security check failed - move on to the next message 335 336 $log_message .= '<br />"' . $post_title . '" ' . __( 'failed PIN authentication; discarding.', 'post-by-email' ); … … 354 355 } else { // create new category 355 356 $new_category = wp_insert_term( $cat, 'category' ); 356 if ( $new_category ) {357 if ( $new_category ) { 357 358 $post_category[] = $new_category['term_id']; 358 359 } … … 392 393 $args = array( 393 394 'public' => true, 394 '_builtin' => false 395 '_builtin' => false, 395 396 ); 396 397 $registered_taxonomies = get_taxonomies( $args, 'names', 'and' ); … … 413 414 $post_info = array( 414 415 'ID' => $post_ID, 415 'post_content' => $post_content . '[gallery]' 416 'post_content' => $post_content . '[gallery]', 416 417 ); 417 418 wp_update_post( $post_info ); … … 535 536 $headerquery->headerText( array() ); 536 537 $headerlist = $this->connection->fetch( 'INBOX', $headerquery, array( 537 'ids' => $uid 538 )); 538 'ids' => $uid, 539 ) 540 ); 539 541 540 542 $headers = $headerlist->first()->getHeaderText( 0, Horde_Imap_Client_Data_Fetch::HEADER_PARSE ); … … 627 629 628 630 $list = $this->connection->fetch( 'INBOX', $query, array( 629 'ids' => $uid 630 )); 631 'ids' => $uid, 632 ) 633 ); 631 634 632 635 $part = $list->first()->getStructure(); … … 639 642 $query2 = new Horde_Imap_Client_Fetch_Query(); 640 643 $query2->bodyPart( $body_id, array( 641 'decode' => true, 642 'peek' => true 643 )); 644 'decode' => true, 645 'peek' => true, 646 ) 647 ); 644 648 645 649 $list2 = $this->connection->fetch( 'INBOX', $query2, array( 646 'ids' => $uid 647 )); 650 'ids' => $uid, 651 ) 652 ); 648 653 649 654 $message2 = $list2->first(); … … 676 681 677 682 $list = $this->connection->fetch( 'INBOX', $query, array( 678 'ids' => $uid 679 )); 683 'ids' => $uid, 684 ) 685 ); 680 686 681 687 $part = $list->first()->getStructure(); … … 695 701 $query2 = new Horde_Imap_Client_Fetch_Query(); 696 702 $query2->bodyPart( $mime_id, array( 697 'decode' => true, 698 'peek' => true 699 )); 703 'decode' => true, 704 'peek' => true, 705 ) 706 ); 700 707 701 708 $list2 = $this->connection->fetch( 'INBOX', $query2, array( 702 'ids' => $uid 703 )); 709 'ids' => $uid, 710 ) 711 ); 704 712 705 713 $message = $list2->first(); … … 757 765 try { 758 766 $this->connection->store( 'INBOX', array( 759 'add' => array( $flag ), 760 'ids' => $uids 761 ) ); 767 'add' => array( $flag ), 768 'ids' => $uids, 769 ) 770 ); 762 771 } 763 772 catch ( Horde_Imap_Client_Exception $e ) { … … 799 808 $args = array( 800 809 'public' => true, 801 '_builtin' => false 810 '_builtin' => false, 802 811 ); 803 812 $registered_taxonomies = get_taxonomies( $args, 'names', 'and' ); … … 836 845 $log = get_option( 'post_by_email_log', array() ); 837 846 838 array_unshift( $log, array( 'timestamp'=>current_time( 'timestamp' ), 'message'=>$message ) ); 847 array_unshift( $log, array( 848 'timestamp' => current_time( 'timestamp' ), 849 'message' => $message, 850 ) 851 ); 839 852 840 853 update_option( 'post_by_email_log', $log ); -
post-by-email/trunk/js/admin.js
r771317 r776563 7 7 var data = { 8 8 action: 'post_by_email_clear_log', 9 security: logNonce9 security: PostByEmailNonces['logNonce'] 10 10 }; 11 11 … … 13 13 jQuery(' table#logTable' ).hide(); 14 14 jQuery( 'a#clearLog' ).hide(); 15 } );16 } );15 } ); 16 } ); 17 17 18 18 // AJAX request for a new PIN … … 22 22 var data = { 23 23 action: 'post_by_email_generate_pin', 24 security: pinNonce24 security: PostByEmailNonces['pinNonce'] 25 25 }; 26 26 27 27 jQuery.post( ajaxurl, data, function( response ) { 28 28 jQuery( 'input#post_by_email_options\\\[pin\\\]' ).val( response ); 29 } );30 } );29 } ); 30 } ); 31 31 32 32 // tab switching … … 38 38 jQuery( 'a.nav-tab-active' ).removeClass( 'nav-tab-active' ); 39 39 jQuery( e.target ).addClass( 'nav-tab-active' ); 40 } );40 } ); 41 41 42 42 // reset advanced options to default (SSL+IMAP) … … 47 47 jQuery( 'input#post_by_email_options\\[delete_messages\\]' ).attr( 'checked', 'checked' ); 48 48 jQuery( 'input#post_by_email_options\\[delete_messages\\]' ).attr( 'disabled', false ); 49 } );49 } ); 50 50 51 51 if ( 'POP3' == jQuery( 'select#post_by_email_options\\[mailserver_protocol\\]' ).val() ) { … … 61 61 jQuery( 'input#post_by_email_options\\[delete_messages\\]' ).attr( 'disabled', false ); 62 62 } 63 } );63 } ); 64 64 65 65 // PIN tab … … 70 70 jQuery( 'tr.post-by-email-pin-settings' ).hide(); 71 71 } 72 } );72 } ); 73 73 74 } );74 } ); -
post-by-email/trunk/views/admin.php
r776219 r776563 288 288 </div> 289 289 </div> 290 291 <script type="text/javascript">292 var logNonce = "<?php echo wp_create_nonce( 'post-by-email-clear-log' ); ?>";293 var pinNonce = "<?php echo wp_create_nonce( 'post-by-email-generate-pin' ); ?>";294 </script>
Note: See TracChangeset
for help on using the changeset viewer.