Display user email address in activation request? Display user email address in activation request?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Display user email address in activation request?

Started by Informator, February 18, 2006, 12:03:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Informator

Hi,

I run a gallery for a student society, whereby I only want to grant full CPG access to users who are already members of the society. They identify themselves in other ways via email address, which ATM I am manually checking against the database. But CPG doesn't display the user email address, just their username. Is there any way I can modify the activation request to include the users email address?
"Accept everything about yourself - and I mean everything. You are you and that is the beginning and the end - no apologies, no regrets." -Clark Moustakas

Nibbler

Register.php, find


                                                        $template_vars = array(
                                                                        '{SITE_NAME}' => $CONFIG['gallery_name'],
                                                                        '{USER_NAME}' => $user_name,
                                                                        '{ACT_LINK}' => $act_link,
                                                        );


Add in a new tag


                                                        $template_vars = array(
                                                                        '{SITE_NAME}' => $CONFIG['gallery_name'],
                                                                        '{USER_NAME}' => $user_name,
                                                                        '{ACT_LINK}' => $act_link,
                                                                        '{EMAIL}' => $email

                                                        );


Edit your lang file (eg. lang/english.php), find


$lang_register_approve_email = <<<EOT
A new user with the username "{USER_NAME}" has registered in your gallery.

In order to activate the account, you need to click on the link below or copy and paste it in your web browser.

<a href="{ACT_LINK}">{ACT_LINK}</a>

EOT;


Add in a new tag


$lang_register_approve_email = <<<EOT
A new user with the username "{USER_NAME}" and email "{EMAIL}" has registered in your gallery.

In order to activate the account, you need to click on the link below or copy and paste it in your web browser.

<a href="{ACT_LINK}">{ACT_LINK}</a>

EOT;


That should work.

lordprodigy

I like this. However I dont have authorisations on but would like to see the email of the person registered in the admin notification. I assume its the same thing and I need to edit this: 'notify_admin_email_body' => 'A new user with the username "%s" has registered in your gallery', but I dont know what to add. thanks.

Nibbler

Add in an extra %s into that string, and then add a new param to the sprintf

cpg_mail('admin', sprintf($lang_register_php_def['notify_admin_email_subject'], $CONFIG['gallery_name']), sprintf($lang_register_php_def['notify_admin_email_body'], $user_name, $email));

Change the order of the params to sprintf to match the order of the %s in the lang var.

lordprodigy

Thank you Nibbler. works great, as you said. I have tested the authorisation email and it works too, so you can mark this solved!

Nibbler

Just because you hijacked a thread and got an answer doesn't mean the thread is solved. ;)

Informator

As it happens, I have tried the above by editing the file remotely and it hasn't worked just yet. But I am not at my current system so will have to wait until tonight when I get back and actually have a proper poke around. Results later - stand by!  :)
"Accept everything about yourself - and I mean everything. You are you and that is the beginning and the end - no apologies, no regrets." -Clark Moustakas

Informator

Hi, sorry for the delay. I can confirm that the above has worked absolutely perfectly. Many thanks to Nibbler for such a fast and useful response!
"Accept everything about yourself - and I mean everything. You are you and that is the beginning and the end - no apologies, no regrets." -Clark Moustakas