diff options
-rw-r--r-- | wp-admin/wpmu-edit.php | 2 | ||||
-rw-r--r-- | wp-admin/wpmu-options.php | 6 | ||||
-rw-r--r-- | wp-includes/wpmu-functions.php | 20 |
3 files changed, 24 insertions, 4 deletions
diff --git a/wp-admin/wpmu-edit.php b/wp-admin/wpmu-edit.php index 75cf095..4741691 100644 --- a/wp-admin/wpmu-edit.php +++ b/wp-admin/wpmu-edit.php @@ -15,6 +15,8 @@ switch( $_REQUEST[ 'action' ] ) { check_admin_referer('siteoptions'); update_site_option( "WPLANG", $_POST[ 'WPLANG' ] ); + if( is_email( $_POST[ 'admin_email' ] ) ) + update_site_option( "admin_email", $_POST[ 'admin_email' ] ); update_site_option( "illegal_names", split( ' ', $_POST[ 'illegal_names' ] ) ); if( $_POST[ 'limited_email_domains' ] != '' ) { update_site_option( "limited_email_domains", split( ' ', $_POST[ 'limited_email_domains' ] ) ); diff --git a/wp-admin/wpmu-options.php b/wp-admin/wpmu-options.php index 76827de..8a5bfd3 100644 --- a/wp-admin/wpmu-options.php +++ b/wp-admin/wpmu-options.php @@ -28,6 +28,12 @@ if (isset($_GET['updated'])) { <?php _e('What you would like to call this website.') ?></td> </tr> <tr valign="top"> + <th scope="row"><?php _e('Site Admin Email:') ?></th> + <td><input name="admin_email" type="text" id="admin_email" style="width: 95%" value="<?php echo stripslashes( get_site_option('admin_email') ) ?>" size="45" /> + <br /> + <?php _e('Registration and support mails will come from this address. Make it generic like "support@' . echo $current_site->domain . '" or "info@' . echo $current_site->domain . '".') ?></td> + </tr> + <tr valign="top"> <th scope="row"><?php _e('Welcome Email:') ?></th> <td><textarea name="welcome_email" id="welcome_email" rows='5' cols='45' style="width: 95%"><?php echo stripslashes( get_site_option('welcome_email') ) ?></textarea> <br /> diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index cb1ab88..1a81c68 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -1071,7 +1071,10 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_emai } else { $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; } - $message_headers = 'From: ' . stripslashes($title) . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>'; + $admin_email = get_site_option( "admin_email" ); + if( $admin_email == '' ) + $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; + $message_headers = 'From: ' . get_site_option( "site_name" ) . ' <'. $admin_email . '>'; $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://{$domain}{$path}"); // TODO: Don't hard code activation link. $subject = sprintf(__('Activate %s'), $domain.$path); @@ -1080,7 +1083,10 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_emai function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') { // Send email with activation link. - $message_headers = 'From: ' . stripslashes($user) . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>'; + $admin_email = get_site_option( "admin_email" ); + if( $admin_email == '' ) + $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; + $message_headers = 'From: ' . get_site_option( "site_name" ) . ' <'. $admin_email . '>'; $message = sprintf(__("To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n"), "http://{$_SERVER[ 'SERVER_NAME' ]}/wp-activate.php?key=$key" ); // TODO: Don't hard code activation link. $subject = sprintf(__('Activate %s'), $user); @@ -1342,7 +1348,10 @@ SITE_NAME" ) ); $welcome_email = str_replace( "PASSWORD", $password, $welcome_email ); $welcome_email = apply_filters( "update_welcome_email", $welcome_email, $blog_id, $user_id, $password, $title, $meta); - $message_headers = 'From: ' . $title . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>'; + $admin_email = get_site_option( "admin_email" ); + if( $admin_email == '' ) + $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; + $message_headers = 'From: ' . get_site_option( "site_name" ) . ' <'. $admin_email . '>'; $message = $welcome_email; if( empty( $current_site->site_name ) ) $current_site->site_name = "WordPress MU"; @@ -1373,7 +1382,10 @@ SITE_NAME" ); $welcome_email = str_replace( "USERNAME", $user->user_login, $welcome_email ); $welcome_email = str_replace( "PASSWORD", $password, $welcome_email ); - $message_headers = 'From: ' . $title . ' <support@' . $_SERVER[ 'SERVER_NAME' ] . '>'; + $admin_email = get_site_option( "admin_email" ); + if( $admin_email == '' ) + $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; + $message_headers = 'From: ' . get_site_option( "site_name" ) . ' <'. $admin_email . '>'; $message = $welcome_email; if( empty( $current_site->site_name ) ) $current_site->site_name = "WordPress MU"; |