| Author |
Post |
|
|
#1 Mon Mar 19, 2007 9:01 pm
|
|
Member
Registered: Mar 2007
Posts: 10
|
I'm working on a forum for a client which will use admin activation of new members. UseBB 1.0.5 supports this nicely, but when a new user registers there is no email notification sent to the admin. Perhaps there's an option I missed? Meanwhile I made a small change that bcc's the "Account awaiting activation" email to the admin. Around line 1142 of accounts/functions.php I found: if ( !empty($bcc_email) ) $headers[] = 'Bcc: '.$bcc_email; $headers[] = 'Date: '.date('r'); $headers[] = 'Message-Id: '.sprintf("<%s.%s>", substr(md5(time()), 4, 10), $from_email); $headers[] = 'X-Mailer: UseBB';
And changed it to: if (stristr($subject,"Account awaiting activation")) $bcc_email = $this->get_config('admin_email'); if ( !empty($bcc_email) ) $headers[] = 'Bcc: '.$bcc_email; $headers[] = 'Date: '.date('r'); $headers[] = 'Message-Id: '.sprintf("<%s.%s>", substr(md5(time()), 4, 10), $from_email); $headers[] = 'X-Mailer: UseBB';
Just the first two lines are added. If there's a built-in way of getting admin notification of new registration I'd appreciated hearing. I'd prefer not to alter the source if possible. Thanks!
|
|
|
#2 Mon Mar 19, 2007 10:25 pm
|
|
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
|
You should add the BCC parameter in the usebb_mail() call in the register page, now you have this implemented in a very dirty way and it will only work when the language is set to English.
|
|
|
#3 Tue Mar 20, 2007 1:31 am
|
|
Member
Registered: Mar 2007
Posts: 10
|
Well I started to do it there, then I saw that in functions.php the usebb_mail() function sets $bcc_email=''. I didn't understand why that was, so I decided to leave it alone.
|
|
|
#4 Tue Mar 20, 2007 4:41 pm
|
|
Member
Registered: Mar 2007
Posts: 27
|
Is it possible to get a mail as admin for new member-registrations? (not for activation, only as information)
|
|
|
#5 Tue Mar 20, 2007 6:47 pm
|
|
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
|
sleddog wrote Well I started to do it there, then I saw that in functions.php the usebb_mail() function sets $bcc_email=''. I didn't understand why that was, so I decided to leave it alone.
$bcc_email='' is a way to make function parameters optional in PHP. The correct solution is to change line 235-238 of sources/panel_register.php to: $functions->usebb_mail($lang['AdminActivationEmailSubject'], $lang['AdminActivationEmailBody'], array( 'account_name' => stripslashes($_POST['user']), 'password' => $_POST['passwd1'] ), $functions->get_config('board_name'), $functions->get_config('admin_email'), $_POST['email'], $functions->get_config('admin_email')); « Last edit by Dietrich on Tue Mar 20, 2007 6:51 pm. »
|
|
|
#6 Tue Mar 20, 2007 6:50 pm
|
|
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
|
Christiane wrote Is it possible to get a mail as admin for new member-registrations? (not for activation, only as information)
This is not possible out of the box, just change line 242-245 to: $functions->usebb_mail($lang['RegistrationEmailSubject'], $lang['RegistrationEmailBody'], array( 'account_name' => stripslashes($_POST['user']), 'password' => $_POST['passwd1'] ), $functions->get_config('board_name'), $functions->get_config('admin_email'), $_POST['email'], $functions->get_config('admin_email')); Note, these code changes remain unsupported and you will have to reapply them when updating!
|
|
|
#7 Tue Mar 20, 2007 6:56 pm
|
|
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
|
I merged two topics about nearly the same code change, and moved this to Resources since the solution in the original post was far from ideal.
|
|
|
#8 Tue Mar 20, 2007 11:23 pm
|
|
Member
Registered: Mar 2007
Posts: 10
|
Dietrich wrote $bcc_email='' is a way to make function parameters optional in PHP.
I didn't know that, now I understand. Thanks for taking the time for this -- it's appreciated.
|
|
|
#9 Wed Mar 21, 2007 8:47 am
|
|
Member
Registered: Mar 2007
Posts: 27
|
For my understanding: In which way do the codes in #5 und #6 differ and whats the code i've to use?
|
|
|
#10 Wed Mar 21, 2007 1:44 pm
|
|
Member
Registered: Mar 2007
Posts: 10
|
The first (post #5) is for when the board is set for administrator approval of new registrations.
The second is for when admin approval is not required. That's what you want I think.
Note the difference in the first line of each code bit.
|
|
|
#11 Wed Mar 21, 2007 1:46 pm
|
|
Member
Registered: Mar 2007
Posts: 10
|
Dietrich wrote I merged two topics about nearly the same code change, and moved this to Resources since the solution in the original post was far from ideal.
OK, OK, I get the point! 
|
|
|
#12 Thu Mar 22, 2007 9:23 pm
|
|
Member
Registered: Mar 2007
Posts: 27
|
I've tried #6 but its not running. Or have i also to change according ro #5?
|
|
|
#13 Fri Mar 23, 2007 8:54 pm
|
|
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
|
You will need to add $functions->get_config('admin_email') to the other usebb_mail() call as well, depending on what your configuration is set to and thus which code block is executed.
|
|
|
#14 Thu Jun 28, 2007 10:42 pm
|
|
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
|
Applied the code in post #5 (Admin approval) and works great! I wonder if I can also apply what's in #6 if ever I change to Email activation without interfering with the #5 code? Gene
|
|
|
#15 Fri Jun 29, 2007 11:39 am
|
|
Developer
Registered: Apr 2004
Posts: 2202
Location: Belgium
|
There shouldn't be a problem applying these changes, however I do not guarantee they also work with later versions. All these mods remain unsupported.
|
|
|
#16 Fri Jun 29, 2007 4:44 pm
|
|
Member
Registered: Jun 2007
Posts: 122
Location: Gatineau, QC, Canada
|
Dietrich wrote There shouldn't be a problem applying these changes, however I do not guarantee they also work with later versions. All these mods remain unsupported.
#5 works great on ver. 1.6... Gene
|