[CPG1.4]: Restriction of email domains [1.4.20] - Page 2 [CPG1.4]: Restriction of email domains [1.4.20] - Page 2
 

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]

Main Menu

[CPG1.4]: Restriction of email domains [1.4.20]

Started by Makc666, June 23, 2004, 09:25:14 AM

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

Makc666

Quote from: TranzNDance on March 15, 2006, 05:50:05 PM
Sounds good.

I created a new thread for 1.3.x version...
http://forum.coppermine-gallery.net/index.php?topic=29946

I added a note about 1.3.x in first post.

Hope now we can move this thread and a new one to MODS section!

Thanks!

lamama

Quote from: Makc666 on June 24, 2004, 11:16:35 AM
I am looking some one who can give me an idea how EASELY modify this mode so me can restrict not only 1 domain but multi domains...

Did you find one?

I'm looking for a mod that is able to block certain "throw-away-email"-domains (like mailinator.com) via blacklist...

Makc666

Quote from: lamama on April 12, 2006, 02:44:41 AM
Did you find one?

I'm looking for a mod that is able to block certain "throw-away-email"-domains (like mailinator.com) via blacklist...

Coppermine can block any domains you like by default!
My bad. CPG doesn't allow to block emails :-X

My sentence was not right. It must sounds:
I am looking some one who can give me an idea how EASELY modify this mode so me can allow not only 1 domain but multi domains...

Frankieloum

ok quick question I just got Coppermine installed and am trying my best to figure out how to do the email notification for my members.
From what I gather I find this section which I did
if ($CONFIG['email_comment_notification'] && !USER_IS_ADMIN ) {
                $mail_body = "<p>" . bb_decode(process_smilies($msg_body, $CONFIG['ecards_more_pic_target'])) . "</p>\n\r ".$lang_db_input_php['email_comment_body'] . " " . $CONFIG['ecards_more_pic_target'] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . $redirect;
                cpg_mail('admin', $lang_db_input_php['email_comment_subject'], make_clickable($mail_body));
            }
and then do I replace it with this?? or add this somewhere in it lol Sorry I AM SO NEW at this


// send an email to the owner of the picture
            $result = db_query("SELECT user_name,user_email FROM {$CONFIG['TABLE_PICTURES']} AS p, {$CONFIG['TABLE_USERS']} AS u WHERE u.user_id=p.owner_id and p.pid=".$pid);
            if (mysql_num_rows($result)) {
              $picture_owner_data = mysql_fetch_array($result);
              $subject = "New GJPix Comment by ".USER_NAME;
              $mail_body  = "Hi ".$user_name."!\n\n".USER_NAME." just wrote a comment on one of your photos, click the link below to read and reply to it.\n";
              $mail_body .= "http://gallery.greatestjournal.com/displayimage.php?pos=-".$pid;
              cpg_mail($picture_owner_data['user_email'], $subject, $mail_body, 'text/plain', "GJPix", 'dontreply@yourdomain.com');

            }

Makc666

##   2008-07-01 - Version 1.4.18
##      - You can select Whitelist or Blacklist mode both for registration or ecards sending check
##      - Multiply domains can now be added separated with ;
##      - You can now select whether to include domains available for registration in error messages or not
##      - You can now select whether to include domains available for sending ecards in error messages or not
##      - Updated for CPG version 1.4.18 and tested with it
##      - Fixed some errors
##      - Fixed translations

New version 1.4.18 and screenshots are in the first post!

Upgrade

Files:
The best way to upgrade from 1.4.4 to 1.4.18 is to remove version 1.4.4 and add the new code of version 1.4.18

SQL:
To upgrade database entries from 1.4.4 to 1.4.18 run throw phpMyAdmin:
INSERT INTO `cpg1418_config` ( `name` , `value` )
VALUES
('domain_email_list_reg', '0'),
('domain_email_list_ecard', '0'),
('domain_email_reg_whitelist', '0'),
('domain_email_ecard_whitelist', '1')


Important!
#   If you have a different table prefix then change this command accordingly.
#   I have used the default table prefix for Coppermine version 1.4.18!
#   You have to change value in this line: INSERT INTO `cpg1418_config` ( `name` , `value` )
#   The value is: cpg1418_config


Frankieloum

I have the new Coppermine, just installed it couple weeks ago, I cannot find the thread that had the mod to receive email notifications
Members are uploading in the Gallery and want to receive email notifications. I cannot recall where the mod is?

Joachim Müller

Then don't hijack a thread that deals with something completely different. Start a new thread on the support board instead!

Frankieloum

Quote from: Joachim Müller on July 09, 2008, 07:16:13 AM
Then don't hijack a thread that deals with something completely different. Start a new thread on the support board instead!

sorry, the title said Restriction of email domains and I thought that was for what I was needing? I am new to this and doing my best at posting in right spots. Bear with me please.
Thanks

Makc666

##   2009-04-04 - Version 1.4.20
##      - Updated file changes in ecard.php for CPG version 1.4.20

New version 1.4.20 is in the first post of this thread.

There is no need to upgrade to this one.
This is only for new installes.

The change was made bacause my code had been added between lines which were changed in 1.4.20 in ecard.php

***************
*** 68,76 ****
  $valid_email_pattern = "^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]*\.)+[a-z]{2,6}$";
  $valid_sender_email = eregi($valid_email_pattern, $sender_email);
  $valid_recipient_email = eregi($valid_email_pattern, $recipient_email);
! $invalid_email = '<font size="1">' . $lang_ecard_php['invalid_email'] . ' (' . $recipient_email . ')</font>';
! if (!$valid_sender_email && count($_POST) > 0) $sender_email_warning = $invalid_email;
! if (!$valid_recipient_email && count($_POST) > 0) $recipient_email_warning = $invalid_email;

  $gallery_url_prefix = $CONFIG['ecards_more_pic_target']. (substr($CONFIG['ecards_more_pic_target'], -1) == '/' ? '' : '/');

--- 68,79 ----
  $valid_email_pattern = "^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]*\.)+[a-z]{2,6}$";
  $valid_sender_email = eregi($valid_email_pattern, $sender_email);
  $valid_recipient_email = eregi($valid_email_pattern, $recipient_email);
! if (!$valid_sender_email && count($_POST) > 0) {
!       $sender_email_warning = '<font size="1">' . $lang_ecard_php['invalid_email'] . ' (' . $sender_email . ')</font>';
! }
! if (!$valid_recipient_email && count($_POST) > 0) {
!       $recipient_email_warning = '<font size="1">' . $lang_ecard_php['invalid_email'] . ' (' . $recipient_email . ')</font>';
! }

  $gallery_url_prefix = $CONFIG['ecards_more_pic_target']. (substr($CONFIG['ecards_more_pic_target'], -1) == '/' ? '' : '/');