Advanced search  

News:

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

Pages: [1] 2   Go Down

Author Topic: Emails being sent to old admin  (Read 4871 times)

0 Members and 1 Guest are viewing this topic.

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Emails being sent to old admin
« on: August 04, 2016, 03:41:20 pm »

This is kind of baffling. An old admin who was changed to "Registered" rather than "Admin" still gets email notifications. I'm checked, changed him back and forth several times, and he's not Category 1 (Admin). Why is he still getting those and what can I do to stop it?

THANKS
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 723
    • GMC Design Photo Gallery
Re: Emails being sent to old admin
« Reply #1 on: August 06, 2016, 03:25:59 pm »

Perhaps the simple answer? Check your gallery config under General Settings...
3rd entry is Gallery administrator email...
As the doc says:
Quote
This email address must not be confused with the email address that correlates to the email address of the gallery administrator's user account. Those email addresses can be identical, but they don't necessarilly have to.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #2 on: August 06, 2016, 05:10:57 pm »

That's not it. Nor is the general email in that space (photos@) being forwarded.

The emails go to each of the three admins PLUS this person who used to be an admin but isn't anymore.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15386
Re: Emails being sent to old admin
« Reply #3 on: August 12, 2016, 02:39:19 pm »

gets email notifications

Which kind of notifications? Please post some examples. Additionally, check if the former admin isn't assigned to the admin group as secondary/additional group.
Logged

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #4 on: August 17, 2016, 07:18:50 pm »

He gets "A new user with the username "xyz" has registered in your gallery." He might also be getting them when they upload a photo, I'm not certain.

He's Registered only. Not an admin. How could he be assigned to a secondary group? See the attachment
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15386
Re: Emails being sent to old admin
« Reply #5 on: August 22, 2016, 08:11:10 pm »

He gets "A new user with the username "xyz" has registered in your gallery."

This is how get the admin email addresses for such emails:
Code: (register.php) [Select]
        if (UDB_INTEGRATION == 'coppermine') {
            // get default language in which to inform the admins
            $result = cpg_db_query("SELECT user_id, user_email, user_language FROM {$CONFIG['TABLE_USERS']} WHERE user_group = 1");
            while ( ($row = mysql_fetch_assoc($result)) ) {
                if (!empty($row['user_email'])) {
                    $admins[$row['user_id']] = array('email' => $row['user_email'], 'lang' => $row['user_language']);
                }
            }
        } else {
            //@todo: is it possible to get the language from bridged installs?
            $admins[] = array('email' => $CONFIG['gallery_admin_email'], 'lang' => 'english');
        }

As it seems your gallery is unbridged, that user must be in user_group "1", though Coppermine says something different. I'd like to have a closer look at this issue. I'd need access to the MySQL database of your Coppermine gallery. If you agree, I'll send you my contact information.
Logged

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #6 on: August 22, 2016, 10:00:15 pm »

I can do that if you want. I've attached a db screenshot. The user in question is highlighted in YELLOW. He's definitely user_group 2!
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15386
Re: Emails being sent to old admin
« Reply #7 on: August 22, 2016, 11:40:16 pm »

Weird. Is there maybe an email forwarder for some of the current admins, which redirects to the old admin email address?

Next step would be to debug the content of $admins. Please add
Code: [Select]
print_r($admins);die(); below the above mentioned code, register a new test user and have a look at the output after submitting the form.
Logged

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #8 on: August 22, 2016, 11:53:08 pm »

No forwarders. I checked and double checked since that was the obvious thing.

Should the new test user be a regular user or an admin? Tons of new users have been added since this person and they don't get the notices.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15386
Re: Emails being sent to old admin
« Reply #9 on: August 23, 2016, 12:06:38 am »

It doesn't matter, as we only want to see the content of the array of admins which has been prepared.
Logged

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #10 on: August 23, 2016, 12:25:12 am »

Here's what I get. Maildrop99 is the one that shouldn't be there.

Code: [Select]
Array ( [2] => Array ( [email] => maildrop99@gmail.com [lang] => english ) [8] => Array ( [email] => jamesgcampbellsf@gmail.com [lang] => english ) )
And I just searched the db....as you'd expect there's only one instance of this email address being used and he's the one that was changed to group 2.

I've looked through the settings and haven't found it, but is there someplace I might have missed where he could be specified to receive this along with the other admin?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15386
Re: Emails being sent to old admin
« Reply #11 on: August 23, 2016, 12:36:51 am »

Maybe there's some kind of SQL query cache enabled in your MySQL server, I don't know. We could adjust the query to exclude user_id 2,but that would just be a workaround.
Logged

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #12 on: August 23, 2016, 12:49:40 am »

I'd say the cache could be possible but this has been happening for a couple of years, believe it or not. He keeps getting upset because he's still getting them when he shouldn't and I tell him to set up email filters.

I just looked through all the settings again. I also searched the entire db and there's only one instance of that email address, and that's his user info.

W...T...F!?

I'd delete him and re-add him except he has lots of photos in there and I don't want them to be disconnected from him.

Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 723
    • GMC Design Photo Gallery
Re: Emails being sent to old admin
« Reply #13 on: August 23, 2016, 03:24:37 am »

OK... so let's eliminate the database...
Using a tool like PHPMyAdmin, issue the following SQL using your correct table prefix of course in place of cpg_:
Code: [Select]
SELECT user_id, user_group, user_email, user_language FROM cpg_users WHERE user_group = 1(I added user_group to the SELECT CPG issues just to see it in output... Of course expect to see only '1' there based on WHERE clause.

If that returns his email...

From the screen shot - looks like the array should have contained users 1 and 8... instead the array showed 2 and 8.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #14 on: August 23, 2016, 03:30:15 am »

Attached is what it returned, which is correct. These are the three admins. he's not in the list....
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 723
    • GMC Design Photo Gallery
Re: Emails being sent to old admin
« Reply #15 on: August 23, 2016, 03:35:33 am »

To quote you... W...T...F!?  lol...

CPG isn't just going to dream up his email...
Any mods made to CPG code?  Could the email have been hardcoded someplace in past?
I don't see a link to your gallery - so can't see the release you are running...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #16 on: August 23, 2016, 04:10:31 am »

I don't think there are any mods....I set it up originally a few years ago as an annual photo contest.

The gallery is here: http://belvederecommunityfoundation.com/photocontest/index.php?cat=7

It's version 1.5.20. Old, yes....

There are no Installed Plugins

thanks for sticking with me on this....I'm baffled.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15386
Re: Emails being sent to old admin
« Reply #17 on: August 23, 2016, 07:00:01 am »

Please upgrade to the latest Coppermine version (currently cpg1.5.42) and try again. If it still doesn't work, we'll apply a workaround.
Logged

maddogprod

  • Coppermine newbie
  • Offline Offline
  • Posts: 18
Re: Emails being sent to old admin
« Reply #18 on: August 23, 2016, 05:22:32 pm »

I was going to do that but my concern is the photo contest is live now (it's only a couple of months each year) and I'm nervous about updating problems while it's live. Is this a pretty safe update to make? I'm pretty sure the only changed files are in the template.

Thoughts?

THANKS
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15386
Re: Emails being sent to old admin
« Reply #19 on: August 23, 2016, 05:33:37 pm »

Create a copy of your gallery (files and database) and test the update on a local web server (e.g. XAMPP). You could also run the SQL queries and check the result on your local server before and after the upgrade to the latest Coppermine version.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.018 seconds with 20 queries.