aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2012-01-14 13:08:43 +0000
committermistic100 <mistic@piwigo.org>2012-01-14 13:08:43 +0000
commit5ea5350deb37777e815248488fd49699c18ab9e2 (patch)
tree5470bfcb5d8ccb7fca0ca07e9bd7448206cf5225
parent34a70eceec0cdfed0203e4bee816256faa8c0294 (diff)
feature:2021 email notification on user creation, add checkboxes on register and install pages
git-svn-id: http://piwigo.org/svn/trunk@12885 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/themes/default/template/install.tpl14
-rw-r--r--install.php41
-rw-r--r--language/en_UK/common.lang.php1
-rw-r--r--language/fr_CA/common.lang.php3
-rw-r--r--language/fr_FR/common.lang.php3
-rw-r--r--register.php44
-rw-r--r--themes/default/template/register.tpl6
7 files changed, 66 insertions, 46 deletions
diff --git a/admin/themes/default/template/install.tpl b/admin/themes/default/template/install.tpl
index d0796677a..5fbdcd5b6 100644
--- a/admin/themes/default/template/install.tpl
+++ b/admin/themes/default/template/install.tpl
@@ -278,11 +278,15 @@ jQuery().ready(function(){ldelim}
<tr>
<td>{'Options'|@translate}</options>
<td colspan="2">
-<label>
-<input type="checkbox" name="newsletter_subscribe"{if $F_NEWSLETTER_SUBSCRIBE} checked="checked"{/if}>
-<span class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</span>
-</label>
-<br>
+ <label>
+ <input type="checkbox" name="newsletter_subscribe"{if $F_NEWSLETTER_SUBSCRIBE} checked="checked"{/if}>
+ <span class="cluetip" title="{'Piwigo Announcements Newsletter'|@translate}|{'Keep in touch with Piwigo project, subscribe to Piwigo Announcement Newsletter. You will receive emails when a new release is available (sometimes including a security bug fix, it\'s important to know and upgrade) and when major events happen to the project. Only a few emails a year.'|@translate|@htmlspecialchars|@nl2br}">{'Subscribe %s to Piwigo Announcements Newsletter'|@translate|@sprintf:$EMAIL}</span>
+ </label>
+ <br>
+ <label>
+ <input type="checkbox" name="send_password_by_mail" checked="checked">
+ {'Send my password by email'|@translate}
+ </label>
</td>
</tr>
</table>
diff --git a/install.php b/install.php
index 2084d8f08..9bbaa6157 100644
--- a/install.php
+++ b/install.php
@@ -461,25 +461,28 @@ else
log_user($user['id'], false);
// email notification
- include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
-
- $keyargs_content = array(
- get_l10n_args('Hello %s,', $admin_name),
- get_l10n_args('Welcome to your new installation of Piwigo!', ''),
- get_l10n_args('', ''),
- get_l10n_args('Here is your password: %s', $admin_pass1),
- get_l10n_args('', ''),
- get_l10n_args('Don\'t hesitate to consult our forums for any help: %s', PHPWG_URL),
- );
-
- pwg_mail(
- $admin_mail,
- array(
- 'subject' => 'Just another Piwigo gallery',
- 'content' => l10n_args($keyargs_content),
- 'content_format' => 'text/plain',
- )
- );
+ if (isset($_POST['send_password_by_mail']))
+ {
+ include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+
+ $keyargs_content = array(
+ get_l10n_args('Hello %s,', $admin_name),
+ get_l10n_args('Welcome to your new installation of Piwigo!', ''),
+ get_l10n_args('', ''),
+ get_l10n_args('Here is your password: %s', $admin_pass1),
+ get_l10n_args('', ''),
+ get_l10n_args('Don\'t hesitate to consult our forums for any help: %s', PHPWG_URL),
+ );
+
+ pwg_mail(
+ $admin_mail,
+ array(
+ 'subject' => 'Just another Piwigo gallery',
+ 'content' => l10n_args($keyargs_content),
+ 'content_format' => 'text/plain',
+ )
+ );
+ }
}
}
if (count($errors) != 0)
diff --git a/language/en_UK/common.lang.php b/language/en_UK/common.lang.php
index b16ba9898..995d92c60 100644
--- a/language/en_UK/common.lang.php
+++ b/language/en_UK/common.lang.php
@@ -307,6 +307,7 @@ $lang['Search'] = "Search";
$lang['search'] = "search";
$lang['searched words : %s'] = "searched words : %s";
$lang['Sent by'] = "Sent by";
+$lang['Send my password by email'] = 'Send my password by email';
$lang['set as album representative'] = "set as album thumbnail";
$lang['Show file metadata'] = "Show file metadata";
$lang['Show number of comments'] = "Show number of comments";
diff --git a/language/fr_CA/common.lang.php b/language/fr_CA/common.lang.php
index 4535e734a..c522eaa3e 100644
--- a/language/fr_CA/common.lang.php
+++ b/language/fr_CA/common.lang.php
@@ -371,6 +371,7 @@ $lang['Hello %s,'] = 'Bonjour %s,';
$lang['Thank you for registering at %s!'] = 'Merci pour votre inscription sur %s !';
$lang['Here is your password: %s'] = 'Votre mot de passe est : %s';
$lang['If you think you\'ve received this email in error, please contact us at %s'] = 'Si vous pensez avoir reçu cet email par erreur, veuillez nous contacter %s';
-$lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription terminée, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
+$lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription réussie, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
+$lang['Send my password by email'] = 'Recevoir mon mot de passe par email';
?> \ No newline at end of file
diff --git a/language/fr_FR/common.lang.php b/language/fr_FR/common.lang.php
index 049f81eb4..b08dbc254 100644
--- a/language/fr_FR/common.lang.php
+++ b/language/fr_FR/common.lang.php
@@ -307,6 +307,7 @@ $lang['search'] = 'recherche';
$lang['Search'] = 'Recherche';
$lang['searched words : %s'] = 'mots recherchés : %s';
$lang['Sent by'] = 'Envoyé par';
+$lang['Send my password by email'] = 'Recevoir mon mot de passe par email';
$lang['set as album representative'] = 'Choisir comme représentante de cet album';
$lang['Show file metadata'] = 'Montrer les méta-données du fichier';
$lang['Show number of comments'] = 'Montrer le nombre de commentaires';
@@ -317,7 +318,7 @@ $lang['slideshow'] = 'diaporama';
$lang['Someone requested that the password be reset for the following user account:'] = 'Quelqu\'un a demandé le renouvellement de votre mot de passe pour l\'utilisateur suivant :';
$lang['Sort by'] = 'Trier selon';
$lang['Sort order'] = 'Ordre de tri';
-$lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription terminée, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
+$lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Inscription réussie, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
$lang['Specials'] = 'Spéciales';
$lang['SQL queries in'] = 'requêtes SQL en';
$lang['stop the slideshow'] = 'arrêter le diaporama';
diff --git a/register.php b/register.php
index 93f962391..67736e7af 100644
--- a/register.php
+++ b/register.php
@@ -60,30 +60,34 @@ if (isset($_POST['submit']))
if (count($page['errors']) == 0)
{
// email notification
- include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
-
- $keyargs_content = array(
- get_l10n_args('Hello %s,', $_POST['login']),
- get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']),
- get_l10n_args('', ''),
- get_l10n_args('Here is your password: %s', $_POST['password']),
- get_l10n_args('', ''),
- get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()),
- );
-
- pwg_mail(
- $_POST['mail_address'],
- array(
- 'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'),
- 'content' => l10n_args($keyargs_content),
- 'content_format' => 'text/plain',
- )
- );
+ if (isset($_POST['send_password_by_mail']) and isset($_POST['mail_address']))
+ {
+ include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
+
+ $keyargs_content = array(
+ get_l10n_args('Hello %s,', $_POST['login']),
+ get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']),
+ get_l10n_args('', ''),
+ get_l10n_args('Here is your password: %s', $_POST['password']),
+ get_l10n_args('', ''),
+ get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()),
+ );
+
+ pwg_mail(
+ $_POST['mail_address'],
+ array(
+ 'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'),
+ 'content' => l10n_args($keyargs_content),
+ 'content_format' => 'text/plain',
+ )
+ );
+
+ $_SESSION['page_infos'][] = l10n('Successfully registered, an email with your password has been sent to you. Welcome!');
+ }
// log user and redirect
$user_id = get_userid($_POST['login']);
log_user($user_id, false);
- $_SESSION['page_infos'][] = l10n('Successfully registered, an email with your password has been sent to you. Welcome!');
redirect(make_index_url());
}
$registration_post_key = get_ephemeral_key(2);
diff --git a/themes/default/template/register.tpl b/themes/default/template/register.tpl
index e1ecfffc5..851e4d150 100644
--- a/themes/default/template/register.tpl
+++ b/themes/default/template/register.tpl
@@ -46,6 +46,12 @@
({'useful when password forgotten'|@translate})
{/if}
</li>
+ <li>
+ <span class="property">
+ <label for="send_password_by_mail">{'Send my password by email'|@translate}</label>
+ </span>
+ <input type="checkbox" name="send_password_by_mail" id="send_password_by_mail" value="1" checked="checked">
+ </li>
</ul>
</fieldset>