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 @@ + 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. maintenance. Only administrator users will be able to reach the gallery. +