[Bb-trac] [bbPress] #799: bbPress should notify admin upon new user registration (has fix)

bbPress bb-trac at lists.bbpress.org
Sun Mar 2 16:42:08 GMT 2008


#799: bbPress should notify admin upon new user registration (has fix)
----------------------------+-----------------------------------------------
 Reporter:  _ck_            |       Owner:       
     Type:  enhancement     |      Status:  new  
 Priority:  normal          |   Milestone:  0.8.4
Component:  Administration  |     Version:       
 Severity:  normal          |    Keywords:       
----------------------------+-----------------------------------------------
 I've made this into a plugin (awaiting approval) but why not put it into
 the core:

 {{{
 add_action('bb_new_user', 'new_user_notification');

 function new_user_notification($user_id=0) {
         if (!$user_id) {$user_id=bb_get_current_user_info( 'id' );}
         $user=bb_get_user($user_id);

         $message  = sprintf(__('New user registration on %s:'),
 bb_get_option('name')) . "\r\n\r\n";
         $message .= sprintf(__('Username: %s'),
 stripslashes($user->user_login)) . "\r\n\r\n";
         $message .= sprintf(__('E-mail: %s'),
 stripslashes($user->user_email)) . "\r\n\r\n";

         $message .= sprintf(__('Agent: %s'),
 substr(stripslashes($_SERVER["HTTP_USER_AGENT"]),0,80)) . "\r\n\r\n";
         $message .= sprintf(__('IP: %s'), $_SERVER['REMOTE_ADDR']) .
 "\r\n\r\n";

         $message .= sprintf(__('Profile: %s'),
 get_user_profile_link($user_id)) . "\r\n\r\n";

         @bb_mail(bb_get_option('admin_email') , sprintf(__('[%s] New User
 Registration'), bb_get_option('name')), $message, '' );
 }
 }}}

-- 
Ticket URL: <http://trac.bbpress.org/ticket/799>
bbPress <http://bbpress.org/>
Innovative forum development


More information about the Bb-trac mailing list