aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/configuration.php3
-rw-r--r--include/functions_user.inc.php5
-rw-r--r--install/config.sql1
-rw-r--r--install/db/62-database.php51
-rw-r--r--language/en_UK.iso-8859-1/admin.lang.php1
-rw-r--r--language/en_UK.iso-8859-1/help/configuration.html6
-rw-r--r--language/fr_FR.iso-8859-1/admin.lang.php1
-rw-r--r--language/fr_FR.iso-8859-1/help/configuration.html6
-rw-r--r--template/yoga/admin/configuration.tpl20
9 files changed, 80 insertions, 14 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index 01eb474e8..7e0b2a9c3 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -49,10 +49,11 @@ else
}
$main_checkboxes = array(
+ 'allow_user_registration',
+ 'obligatory_user_mail_address',
'rate',
'rate_anonymous',
'email_admin_on_new_user',
- 'allow_user_registration',
'email_admin_on_picture_uploaded',
);
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index d9e63c437..036f842d9 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -31,9 +31,10 @@
// If the mail address doesn't correspond, an error message is returned.
function validate_mail_address( $mail_address )
{
- global $lang;
+ global $lang, $conf;
- if ( $mail_address == '' )
+ if (empty($mail_address) and
+ !($conf['obligatory_user_mail_address'] and in_array(script_basename(), array('register', 'profile'))))
{
return '';
}
diff --git a/install/config.sql b/install/config.sql
index eea554e22..8d7db0307 100644
--- a/install/config.sql
+++ b/install/config.sql
@@ -23,3 +23,4 @@ INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_n
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_comment','false','Send an email to the administrators when a valid comment is entered');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_comment_validation','false','Send an email to the administrators when a comment requires validation');
INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('email_admin_on_picture_uploaded','false','Send an email to the administrators when a picture is uploaded');
+INSERT INTO phpwebgallery_config (param,value,comment) VALUES ('obligatory_user_mail_address','false','Mail address is obligatory for users');
diff --git a/install/db/62-database.php b/install/db/62-database.php
new file mode 100644
index 000000000..d1288ca5f
--- /dev/null
+++ b/install/db/62-database.php
@@ -0,0 +1,51 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file : $Id$
+// | last update : $Date$
+// | last modifier : $Author$
+// | revision : $Revision$
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+$upgrade_description = 'Add obligatory_user_mail config';
+
+include_once(PHPWG_ROOT_PATH.'include/constants.php');
+
+// +-----------------------------------------------------------------------+
+// | Upgrade content |
+// +-----------------------------------------------------------------------+
+
+$query = "
+INSERT INTO ".CONFIG_TABLE." (param,value,comment) VALUES ('obligatory_user_mail_address','false','Mail address is obligatory for users');
+";
+pwg_query($query);
+
+echo
+"\n"
+.'"'.$upgrade_description.'"'.' ended'
+."\n"
+;
+
+?>
diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php
index 47d3c2137..1b026ae72 100644
--- a/language/en_UK.iso-8859-1/admin.lang.php
+++ b/language/en_UK.iso-8859-1/admin.lang.php
@@ -616,4 +616,5 @@ $lang['display_thumbnail_hoverbox'] = 'Hoverbox display';
$lang['Thumbnails'] = 'Thumbnails';
$lang['Guest cannot be deleted'] = 'Guest cannot be deleted';
$lang['Default user cannot be deleted'] = 'Default user cannot be deleted';
+$lang['obligatory_user_mail_address'] = 'Mail address is obligatory for all users';
?>
diff --git a/language/en_UK.iso-8859-1/help/configuration.html b/language/en_UK.iso-8859-1/help/configuration.html
index 6dc4c67bc..4f658173d 100644
--- a/language/en_UK.iso-8859-1/help/configuration.html
+++ b/language/en_UK.iso-8859-1/help/configuration.html
@@ -24,6 +24,10 @@ page.</li>
maintenance. Only administrator users will be able to reach the
gallery.</li>
+ <li><strong>Allow user registration</strong>: Registration is free for all.</li>
+
+ <li><strong>Mail address is obligatory for all users</strong>: Mail address will checked on registration or profile update except if the action is done on administration part.</li>
+
<li><strong>Rating</strong>: Picture rating feature is enabled.</li>
<li><strong>Rating by guests</strong>: Even non registered users can
@@ -31,8 +35,6 @@ rate images.</li>
<li><strong>Email admins when a new user registers</strong>: Administrators will be received mail for each registration.</li>
- <li><strong>Allow user registration</strong>: Registration is free for all.</li>
-
<li><strong>Email adminis when a picture is uploaded</strong>: Administrators will be received mail for each picture uploaded by a user.</li>
</ul>
diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php
index b2086b96c..ae88c0403 100644
--- a/language/fr_FR.iso-8859-1/admin.lang.php
+++ b/language/fr_FR.iso-8859-1/admin.lang.php
@@ -617,4 +617,5 @@ $lang['display_thumbnail_hoverbox'] = 'Affichage lors du survol';
$lang['Thumbnails'] = 'Miniatures';
$lang['Guest cannot be deleted'] = 'L\'invité ne peut pas être supprimé';
$lang['Default user cannot be deleted'] = 'L\'utilisateur par défaut ne peut pas être supprimé';
+$lang['obligatory_user_mail_address'] = 'L\'adresse mail est obligatoire pour tous les utilisateurs';
?>
diff --git a/language/fr_FR.iso-8859-1/help/configuration.html b/language/fr_FR.iso-8859-1/help/configuration.html
index 50d2575d8..2af9f696f 100644
--- a/language/fr_FR.iso-8859-1/help/configuration.html
+++ b/language/fr_FR.iso-8859-1/help/configuration.html
@@ -24,6 +24,10 @@ pages.</li>
galerie pour maintenance. Seul les administrateurs pourront accéder à la
galerie.</li>
+ <li><strong>Permettre l'enregistrement des utilisateurs</strong>: L'inscription est libre pour tous.</li>
+
+ <li><strong>L'adresse mail est obligatoire pour tous les utilisateurs</strong>: L'adresse mail sera vérifié lors des inscriptions ou de la mise à jour des profils sauf si l'action est effectuée dans la partie administration.</li>
+
<li><strong>Notation</strong>: La notation des photos est possible.</li>
<li><strong>Notation par les visiteurs</strong>: Même les utilisateurs
@@ -31,8 +35,6 @@ non enregistrés peuvent noter les images.</li>
<li><strong>Notifier les administrateurs lors de l'inscription d'un utilisateur</strong>: Les administrateurs recevront un courriel à chaque inscription.</li>
- <li><strong>Permettre l'enregistrement des utilisateurs</strong>: L'inscription est libre pour tous.</li>
-
<li><strong>Notifier les administrateurs quand une image est téléchargée</strong>: Les administrateurs recevront un courriel à chaque image mis à disposition par un utilisateur.</li>
</ul>
diff --git a/template/yoga/admin/configuration.tpl b/template/yoga/admin/configuration.tpl
index 2df05e936..a2a435342 100644
--- a/template/yoga/admin/configuration.tpl
+++ b/template/yoga/admin/configuration.tpl
@@ -43,6 +43,19 @@
<fieldset id="mainConfCheck">
<ul>
+ <li>
+ <label for="allow_user_registration">
+ <span class="property">{lang:Allow user registration}</span>
+ <input type="checkbox" name="allow_user_registration" id="allow_user_registration" {main.ALLOW_USER_REGISTRATION} />
+ </label>
+ </li>
+
+ <li>
+ <label for="obligatory_user_mail_address">
+ <span class="property">{lang:obligatory_user_mail_address}</span>
+ <input type="checkbox" name="obligatory_user_mail_address" id="obligatory_user_mail_address" {main.OBLIGATORY_USER_MAIL_ADDRESS} />
+ </label>
+ </li>
<li>
<span class="property">{lang:Rating}</span>
@@ -55,13 +68,6 @@
</li>
<li>
- <label for="allow_user_registration">
- <span class="property">{lang:Allow user registration}</span>
- <input type="checkbox" name="allow_user_registration" id="allow_user_registration" {main.ALLOW_USER_REGISTRATION} />
- </label>
- </li>
-
- <li>
<label>
<span class="property">{lang:Email administrators when a new user registers}</span>
<input type="checkbox" name="email_admin_on_new_user" {main.EMAIL_ADMIN_ON_NEW_USER} />