Skip to content

Commit

Permalink
feature:2021 email notification on user creation, add checkboxes on r…
Browse files Browse the repository at this point in the history
…egister and install pages

git-svn-id: http://piwigo.org/svn/trunk@12885 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Jan 14, 2012
1 parent 34a70ec commit 5ea5350
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 46 deletions.
14 changes: 9 additions & 5 deletions admin/themes/default/template/install.tpl
Expand Up @@ -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>
Expand Down
41 changes: 22 additions & 19 deletions install.php
Expand Up @@ -461,25 +461,28 @@
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)
Expand Down
1 change: 1 addition & 0 deletions language/en_UK/common.lang.php
Expand Up @@ -307,6 +307,7 @@
$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";
Expand Down
3 changes: 2 additions & 1 deletion language/fr_CA/common.lang.php
Expand Up @@ -371,6 +371,7 @@
$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';

?>
3 changes: 2 additions & 1 deletion language/fr_FR/common.lang.php
Expand Up @@ -307,6 +307,7 @@
$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';
Expand All @@ -317,7 +318,7 @@
$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';
Expand Down
44 changes: 24 additions & 20 deletions register.php
Expand Up @@ -60,30 +60,34 @@
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);
Expand Down
6 changes: 6 additions & 0 deletions themes/default/template/register.tpl
Expand Up @@ -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>
Expand Down

0 comments on commit 5ea5350

Please sign in to comment.