Emails being sent to old admin Emails being sent to old admin
 

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

Emails being sent to old admin

Started by maddogprod, August 04, 2016, 03:41:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

maddogprod

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

gmc

Perhaps the simple answer? Check your gallery config under General Settings...
3rd entry is Gallery administrator email...
As the doc says:
QuoteThis 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.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

maddogprod

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.

Αndré

Quote from: maddogprod on August 04, 2016, 03:41:20 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.

maddogprod

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

Αndré

Quote from: maddogprod on August 17, 2016, 07:18:50 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.

maddogprod

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!

Αndré

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 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.

maddogprod

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.

Αndré

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

maddogprod

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

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?

Αndré

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.

maddogprod

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.


gmc

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_:
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.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

maddogprod

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

gmc

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...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

maddogprod

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.

Αndré

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.

maddogprod

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

Αndré

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.