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

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

[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 3 Guests are viewing this topic.

Makc666

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

I greatly update this mod. See pictures in attachment...

The old version 1.4.4 of this MOD for CPG 1.4.x you can find in attachments.
The old version 1.3.5 of this MOD for CPG 1.3.x you can find here:
http://forum.coppermine-gallery.net/index.php?topic=29946


##############################################################
## MOD Title: Restriction of email domains
## MOD Author: Makc666 < makc666@newmail.ru > (Maxim) http://makc666.com
## MOD Description: Restriction of email domains with Whitelist or Blacklist mode both for registration or ecards sending check
## MOD Version: 1.4.20
##
## Installation Level: (Easy)
## Installation Time: 10 Minute
## Files To Edit:
## register.php
## ecard.php
## lang/english.php
## Included Files: (n/a)
##############################################################

##############################################################
## For Security Purposes, Please Check: http://coppermine.sourceforge.net/board/index.php?topic=7243.0 for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, Coppermine will not offer support for MOD's not offered
## in our MOD-Database, located at: http://coppermine.sourceforge.net/board/index.php?board=8.0
##############################################################
## Author Notes
##
## Support http://coppermine.sourceforge.net/board/index.php?topic=7243.0
## Russian and German translations included!
## Tested on Coppermine 1.4.20 only.
##############################################################

##############################################################
## MOD History:
##
##   2004-06-21 - Version 0.0.0-1.0
##      - Project started
##
##   2004-06-24 - Version 1.3.0-1.0
##      - Initial Release
##
##   2004-07-01 - Version 1.3.0-1.1
##      - Fixed bug with activation link
##
##   2004-07-23 - Version 1.3.1-1.2
##      - No changes. Just 1.3.1 check
##
##   2004-07-23 - Version 1.3.2-1.2
##      - No changes. Just 1.3.2 check
##
##   2006-02-26 - Version 1.4.4
##      - Changed the way of MODs version pointing
##      - Rewritten for CPG version 1.4.4
##      - Fixed some errors
##      - Fixed translations
##
##   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
##
##   2009-04-04 - Version 1.4.20
##      - Updated file changes in ecard.php for CPG version 1.4.20
##
##############################################################
## Before Adding This MOD To Your Gallery, You Should Back Up All Files Related To This MOD
##############################################################

Russian and German translation included.
P.S. I used Google to translate into German, so be patient with be. If you are German, you can send we a correct one.

Screenshots:

Admins Panel:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg61.imageshack.us%2Fimg61%2F6224%2Frestrictionofemaildomaing2.png&hash=6e1f86aad1f167e1021ca208017c523ba9f340c4)

Ecard Sending:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg234.imageshack.us%2Fimg234%2F4890%2Frestrictionofemaildomaisj9.th.png&hash=c1a78236d829ad8783a099a06b94306b281efd3c)

Registration Process:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg61.imageshack.us%2Fimg61%2F5383%2Frestrictionofemaildomaicb6.th.png&hash=8910f04e6974860031a2b2fb6de585b47f85a087)

Latest version is archive Restriction_of_email_domains_[1-4-20].zip

Joachim Müller

is this a feature request for future versions or are you looking for someone to actually code this for you?

GauGau

Makc666

GauGau
I don't know how it is better to answer.
For one hand it is easy to make - 2-3 hours max.
For another hand I wanted this to be in Gallery by default in next fersions as I thinks it is a very good ided.
Also if you will code it for next version you can add it so we can add not 1one domain but 2, 3 and more.
So I thinks it is more like request.

But I will grateful if some one agree to help me to code.

Quote from: GauGau on June 23, 2004, 09:35:39 AM
is this a feature request for future versions or are you looking for someone to actually code this for you?

GauGau

Joachim Müller

I don't think such code will code into a mainstream version of coppermine, as there are only very few actually using Coppermine on their intranet, but I can see no reason why it shouldn't go into the mods section (once someone is willing to actually code it).

GauGau

Makc666

Can you than move this topic to MOD section, so I don't have to start it again...

Quote from: GauGau on June 23, 2004, 10:15:23 AM
I don't think such code will code into a mainstream version of coppermine, as there are only very few actually using Coppermine on their intranet, but I can see no reason why it shouldn't go into the mods section (once someone is willing to actually code it).

GauGau

Makc666

So... Here I am...
I code out the part for register.php...

You have to find code:
   if (!eregi("^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$", $email)) $error .= '<li>' . $lang_register_php['err_invalid_email'];

   if ($error != '') return false;


and replace it with:

$sql = "SELECT value " . "FROM {$CONFIG['TABLE_CONFIG']} " . "WHERE name = '" . addslashes(emaildomain) . "'";
$res=db_query($sql);
$res1=@mysql_fetch_row($res);
print_r($res1);
$emaildomain=$res1[0];
echo($emaildomain);
         
if (!eregi("^[_\.0-9a-z\-]+@$emaildomain", $email)) $error .= '<li>' . sprintf($lang_register_php['err_invalid_emaildomain'], $emaildomain);

       mysql_free_result($res);

   if ($error != '') return false;


Than in your SQL base insert this code:
INSERT INTO `cpg130_config` ( `name` , `value` )
VALUES (
'emaildomain', 'your_emaildomain.com'
);

Makc666

In english*.php files find
 'err_invalid_email' => 'Email address is invalid',

after add:

  'err_invalid_emaildomain' => 'Email domain is invalid - you can register only in @%s domain',

Makc666

I made this mode up to 90%...
Some test and more options and I will post it here as Beta 0.1 =)

Joachim Müller

Quote from: Makc666 on June 23, 2004, 10:43:31 AM
Can you than move this topic to MOD section, so I don't have to start it again...
Mod requests won't go into the mods board - only finished mods go there (a dev team member will move this posting once it actually is a mod).
Please finish your mod fully and post detailed instructions - the rest will come naturally (moving to proper board).

GauGau

Makc666

GauGau

I finished the mod. It is in first message... You can move it to proper section...

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

For Russian users
Ìîæåòå ïîïðîñèòü ó ìåíÿ ïåðåâîä ýòîãî ìîäà ÷åðåç ïðèâàò...

Makc666

##   2004-07-01 - Version 1.3.0-1.1
##      - Fixed bug with activation link

If you already made changes to register.php, take a clean one and remade all changes again!

I changed all section:

#
#-----[ FIND ]------------------------------------------
#

    if ($password == $user_name) $error .= '<li>' . $lang_register_php['err_uname_pass_diff'];
    if ($password != $password_again) $error .= '<li>' . $lang_register_php['err_password_mismatch'];

    if (!eregi("^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$", $email)) $error .= '<li>' . $lang_register_php['err_invalid_email'];

    if ($error != '') return false;

#
#-----[ REPLACE WITH ]------------------------------------------
#

    if ($password == $user_name) $error .= '<li>' . $lang_register_php['err_uname_pass_diff'];
    if ($password != $password_again) $error .= '<li>' . $lang_register_php['err_password_mismatch'];

    if ($CONFIG['requires_domain_email_reg']) {

$sql = "SELECT value " . "FROM {$CONFIG['TABLE_CONFIG']} " . "WHERE name = '" . addslashes(domain_email_reg) . "'";
$res=db_query($sql);
$res1=@mysql_fetch_row($res);
$domain_email_reg=$res1[0];

if (!eregi("^[_\.0-9a-z\-]+@$domain_email_reg", $email)) $error .= sprintf('<li>' . $lang_register_php['err_invalid_domain_email_reg'], $domain_email_reg);

        mysql_free_result($res);

    if ($error != '') return false;

    } else {

    if (!eregi("^[_\.0-9a-z\-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$", $email)) $error .= '<li>' . $lang_register_php['err_invalid_email'];

    if ($error != '') return false;
    }   

Makc666

I hope that some day this modofication will be remade/improve by coppermine team and added to the gallery, so there will both options - list of allowed email domains - list of blocked email domains!

Makc666

New version is posted.
Updated for 1.4.* tree.
Tested in 1.4.4!
See first post of the topic!

Joachim Müller

Don't render threads useless - this thread dealt with cpg1.3.x. Instead of editing out everything that has been said for cpg1.3.x, you should have started a new thread that explains your mod for cpg1.4.x. Moving this thread from the mods board to the coding discussion board.
Start two new threads in boards where you can post: one that deals with cpg1.3.x, one that deals with cpg1.4.x

Makc666

Quote from: GauGau on February 27, 2006, 08:46:15 AM
Don't render threads useless - this thread dealt with cpg1.3.x. Instead of editing out everything that has been said for cpg1.3.x, you should have started a new thread that explains your mod for cpg1.4.x. Moving this thread from the mods board to the coding discussion board.
Start two new threads in boards where you can post: one that deals with cpg1.3.x, one that deals with cpg1.4.x
1. I don't want to continue support for 1.3.x version.

2. There is no 1.3.x version in Downloads: http://sourceforge.net/project/showfiles.php?group_id=89658

3. There is words in all versions of my MOD:
## For Security Purposes, Please Check: http://coppermine.sourceforge.net/board/index.php?topic=7243.0 for the
## latest version of this MOD.

I don't want that number of the MOD's TOPIC was changed!!!
No one never, on all forum connected with MODs never change MOD's topic numbers.
And you want me to create a new topic. This is unreal and wrong!

4. Support for cpg1.3.x running out!
You wrote this one your self:
Quote from: GauGau on February 22, 2006, 03:49:30 PM
Support for cpg1.3.x is running out, we strongly encourage everybody to upgrade to the most recent stable version of coppermine.

I attach MOD's archive for version 1.3.x in the first post!

Joachim Müller

currently, cpg1.3.x goes supported, although support is running out. If you don't want to support a cpg1.3.x mod that you made, that's fine. Others may still want to use it as-is. This thread is a mess, no use fiddling with it imo.

Makc666

Quote from: GauGau on March 14, 2006, 07:33:52 AM
currently, cpg1.3.x goes supported, although support is running out. If you don't want to support a cpg1.3.x mod that you made, that's fine. Others may still want to use it as-is. This thread is a mess, no use fiddling with it imo.
I don't see any support for this mod in 1.3.x
It works there and there is no problems there.

Sorry, GauGau, but on this forum in
Modifications/Add-Ons/Hacks
you have MODs marked as
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fforum.coppermine-gallery.net%2FThemes%2Fdefault%2Fimages%2Fpost%2Fcpg13-14.gif&hash=333d74a61e1cf1478d8973d90163878cd42c3deb)

So there can be other MODs for CPG1.3.x and CPG1.4.x at once.

Why my MOD can't be so, I can't understand...

Joachim Müller

Yes, we used to label mods that way if one and the same code can be used for both versions. If code differs, we (the dev team) agreed to have different threads. The reason for this is ease of use for users who are reluctant to browse a whole, multi-page thread just to see a note on page 8 from someone who posts what changes are needed to make mod X actually work with cpg-version Y.

Look, this discussion is leading nowhere - why don't you do as suggested and have two threads: one for cpg1.3.x and one for cpg1.4.x?

Makc666

Quote from: GauGau on March 14, 2006, 07:07:35 PM
Yes, we used to label mods that way if one and the same code can be used for both versions. If code differs, we (the dev team) agreed to have different threads. The reason for this is ease of use for users who are reluctant to browse a whole, multi-page thread just to see a note on page 8 from someone who posts what changes are needed to make mod X actually work with cpg-version Y.

Look, this discussion is leading nowhere - why don't you do as suggested and have two threads: one for cpg1.3.x and one for cpg1.4.x?

GauGau
I understand your position.
Can we make it this way.
This thread will be for 1.4.x version.
For 1.3.x version I will start a new thread.
And in first post of this thread I will point a URL for thread relevant for 1.3.x version.

Will this be alright?
Thanks.

Tranz