Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Display user email address in activation request?  (Read 7392 times)

0 Members and 1 Guest are viewing this topic.

Informator

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
    • University of Birmingham Guild Musical Theatre Group
Display user email address in activation request?
« on: February 18, 2006, 12:03:25 am »

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?
« Last Edit: February 21, 2006, 07:39:19 pm by Nibbler »
Logged
"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

  • Guest
Re: Display user email address in activation request?
« Reply #1 on: February 18, 2006, 12:19:54 am »

Register.php, find

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

Add in a new tag

Code: [Select]
                                                        $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

Code: [Select]
$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

Code: [Select]
$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.
Logged

lordprodigy

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 228
    • B514 ///
Re: Display user email address in activation request?
« Reply #2 on: February 18, 2006, 08:10:50 pm »

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:
Code: [Select]
'notify_admin_email_body' => 'A new user with the username "%s" has registered in your gallery', but I dont know what to add. thanks.
Logged

Nibbler

  • Guest
Re: Display user email address in activation request?
« Reply #3 on: February 18, 2006, 09:51:51 pm »

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

Code: [Select]
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.
Logged

lordprodigy

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 228
    • B514 ///
Re: Display user email address in activation request?
« Reply #4 on: February 18, 2006, 11:03:23 pm »

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

Nibbler

  • Guest
Re: Display user email address in activation request?
« Reply #5 on: February 18, 2006, 11:05:04 pm »

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

Informator

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
    • University of Birmingham Guild Musical Theatre Group
Re: Display user email address in activation request?
« Reply #6 on: February 19, 2006, 09:56:40 am »

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!  :)
Logged
"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

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
    • University of Birmingham Guild Musical Theatre Group
Re: Display user email address in activation request?
« Reply #7 on: February 21, 2006, 06:59:34 pm »

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!
Logged
"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
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 16 queries.