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] 2   Go Down

Author Topic: [CPG1.4]: Restriction of email domains [1.4.20]  (Read 84255 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
[CPG1.4]: Restriction of email domains [1.4.20]
« on: June 23, 2004, 09:25:14 am »

[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:
(http://img61.imageshack.us/img61/6224/restrictionofemaildomaing2.png)

Ecard Sending:
(http://img234.imageshack.us/img234/4890/restrictionofemaildomaisj9.th.png)

Registration Process:
(http://img61.imageshack.us/img61/5383/restrictionofemaildomaicb6.th.png)

Latest version is archive Restriction_of_email_domains_[1-4-20].zip
« Last Edit: February 04, 2009, 08:09:16 pm by Makc666 »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: /REQ/ only one email domain for registration and ecards.
« Reply #1 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
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: /REQ/ only one email domain for registration and ecards.
« Reply #2 on: June 23, 2004, 10:10:44 am »

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.

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

GauGau
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: /REQ/ only one email domain for registration and ecards.
« Reply #3 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
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: /REQ/ only one email domain for registration and ecards.
« Reply #4 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...

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
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: /REQ/ only one email domain for registration and ecards.
« Reply #5 on: June 23, 2004, 12:41:09 pm »

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

You have to find code:
Code: [Select]
   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:

Code: [Select]
$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:
Code: [Select]
INSERT INTO `cpg130_config` ( `name` , `value` )
VALUES (
'emaildomain', 'your_emaildomain.com'
);
« Last Edit: June 23, 2004, 12:53:19 pm by Makc666 »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: /REQ/ only one email domain for registration and ecards.
« Reply #6 on: June 23, 2004, 12:47:07 pm »

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',
« Last Edit: June 23, 2004, 12:54:53 pm by Makc666 »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: /REQ/ only one email domain for registration and ecards.
« Reply #7 on: June 23, 2004, 03:17:39 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: /REQ/ only one email domain for registration and ecards.
« Reply #8 on: June 23, 2004, 06:02:24 pm »

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
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: /REQ/ only one email domain for registration and ecards.
« Reply #9 on: June 24, 2004, 11:16:35 am »

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
Ìîæåòå ïîïðîñèòü ó ìåíÿ ïåðåâîä ýòîãî ìîäà ÷åðåç ïðèâàò...
« Last Edit: April 13, 2006, 12:36:08 am by Makc666 »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: [CPG1.3]: Restriction of email domains [1.3.0-1.1]
« Reply #10 on: June 30, 2004, 10:09:57 pm »

##   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:

Code: [Select]
#
#-----[ 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;
    }   
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: [CPG1.3]: Restriction of email domains [1.3.0-1.1]
« Reply #11 on: April 27, 2005, 06:59:44 am »

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!
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #12 on: February 27, 2006, 01:25:12 am »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #13 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
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #14 on: February 27, 2006, 06:59:55 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #15 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.
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #16 on: March 14, 2006, 02:06:40 pm »

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
(http://forum.coppermine-gallery.net/Themes/default/images/post/cpg13-14.gif)

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #17 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?
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #18 on: March 15, 2006, 05:41:22 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.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: [CPG1.4]: Restriction of email domains [1.4.4]
« Reply #19 on: March 15, 2006, 05:50:05 pm »

Sounds good.
Logged
Pages: [1] 2   Go Up
 

Page created in 0.035 seconds with 19 queries.