Skip to content

Commit

Permalink
feature:2021 change contents of the mail + add option on admin/user_list
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@12886 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Jan 14, 2012
1 parent 5ea5350 commit a412558
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 16 deletions.
2 changes: 1 addition & 1 deletion admin/themes/default/template/install.tpl
Expand Up @@ -285,7 +285,7 @@ jQuery().ready(function(){ldelim}
<br>
<label>
<input type="checkbox" name="send_password_by_mail" checked="checked">
{'Send my password by email'|@translate}
{'Send my connection settings by email'|@translate}
</label>
</td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions admin/themes/default/template/user_list.tpl
Expand Up @@ -13,6 +13,7 @@
<label>{'Password'|@translate} <input type="text" name="password"></label>
{/if}
<label>{'Email address'|@translate} <input type="text" name="email"></label>
<label>{'Send connection settings by email'|@translate} <input type="checkbox" name="send_password_by_mail" value="1" checked="checked"></label>
<label>&nbsp; <input class="submit" type="submit" name="submit_add" value="{'Submit'|@translate}"></label>
</fieldset>
</form>
Expand Down
32 changes: 32 additions & 0 deletions admin/user_list.php
Expand Up @@ -242,6 +242,38 @@ function get_filtered_user_list()
}
}

// email notification
if (
isset($_POST['submit_add'])
and count($page['errors']) == 0
and !empty($_POST['email'])
and isset($_POST['send_password_by_mail'])
)
{
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 are your connection settings', ''),
get_l10n_args('Username: %s', $_POST['login']),
get_l10n_args('Password: %s', $_POST['password']),
get_l10n_args('Email: %s', $_POST['email']),
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['email'],
array(
'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'),
'content' => l10n_args($keyargs_content),
'content_format' => 'text/plain',
)
);
}

// +-----------------------------------------------------------------------+
// | user list |
// +-----------------------------------------------------------------------+
Expand Down
7 changes: 5 additions & 2 deletions install.php
Expand Up @@ -469,15 +469,18 @@
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('Here are your connection settings', ''),
get_l10n_args('Username: %s', $admin_name),
get_l10n_args('Password: %s', $admin_pass1),
get_l10n_args('Email: %s', $admin_mail),
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',
'subject' => l10n('Just another Piwigo gallery'),
'content' => l10n_args($keyargs_content),
'content_format' => 'text/plain',
)
Expand Down
1 change: 1 addition & 0 deletions language/en_UK/admin.lang.php
Expand Up @@ -646,6 +646,7 @@
$lang['Send mail as'] = "Send mail as";
$lang['Send mail on HTML format'] = "Send mail in HTML format";
$lang['Send mail to users'] = "Send mail to users";
$lang['Send connection settings by email'] = 'Send connection settings by email';
$lang['Send'] = "Send";
$lang['Set as default language for unregistered and new users'] = 'Set as default language for unregistered and new users';
$lang['Set as default theme for unregistered and new users'] = "Set as default theme for unregistered and new users";
Expand Down
9 changes: 6 additions & 3 deletions language/en_UK/common.lang.php
Expand Up @@ -307,7 +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['Send my connection settings by email'] = 'Send my connection settings 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 All @@ -318,7 +318,7 @@
$lang['Someone requested that the password be reset for the following user account:'] = 'Someone requested that the password be reset for the following user account:';
$lang['Sort by'] = "Sort by";
$lang['Sort order'] = "Sort order";
$lang['Successfully registered, an email with your password has been sent to you. Welcome!'] = 'Successfully registered, an email with your password has been sent to you. Welcome!';
$lang['Successfully registered, you will soon receive an email with your connection settings. Welcome!'] = 'Successfully registered, you will soon receive an email with your connection settings. Welcome!';
$lang['Specials'] = "Specials";
$lang['SQL queries in'] = "SQL queries in";
$lang['stop the slideshow'] = "stop the slideshow";
Expand Down Expand Up @@ -376,7 +376,10 @@
$lang['xxlarge'] = "XXLarge";
$lang['original'] = "Original";
$lang['Thank you for registering at %s!'] = 'Thank you for registering at %s!';
$lang['Here is your password: %s'] = 'Here is your password: %s';
$lang['Here are your connection settings'] = 'Here are your connection settings';
$lang['Password: %s'] = 'Password: %s';
$lang['Username: %s'] = 'Username: %s';
$lang['Email: %s'] = 'Email: %s';
$lang['If you think you\'ve received this email in error, please contact us at %s'] = 'If you think you\'ve received this email in error, please contact us at %s';

?>
4 changes: 3 additions & 1 deletion language/fr_CA/admin.lang.php
Expand Up @@ -843,5 +843,7 @@
$lang['If no HD is available and if the current websize is bigger than resize dimensions, Piwigo will move it as HD and create a downsized websize photo from it.'] = 'Si la HD n\'est pas disponible et que la version actuelle de la taille web est plus grande que les dimensions ci-dessous, alors Piwigo la considérera comme HD et créera la nouvelle taille web à partir de celle-ci.';
$lang['An error has occured during upgrade.'] = 'Une erreur est survenue pendant la mise à jour.';
$lang['An error has occured during extract. Please check files permissions of your piwigo installation.<br><a href="%s">Click here to show log error</a>.'] = 'Impossible d\'extraire les fichiers. Veuillez vérifier les permissions des fichiers de votre installation.<br><a href="%s">Cliquez ici pour voir le rapport d\'erreur</a>.';
$lang['Piwigo cannot retrieve upgrade file from server'] = 'Piwigo ne peut pas récupérer le fichier de mise à jour depuis le serveur';
$lang['Piwigo cannot retrieve upgrade file from server'] = 'Piwigo ne peut pas récupérer le fichier de mise à jour depuis le serveur';
$lang['Send connection settings by email'] = 'Envoyer les identifiants par email';

?>
9 changes: 6 additions & 3 deletions language/fr_CA/common.lang.php
Expand Up @@ -369,9 +369,12 @@
$lang['Username modification'] = 'Modification du nom d\'utilisateur';
$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['Here are your connection settings'] = 'Voici vos identifiants';
$lang['Password: %s'] = 'Mot de passe : %s';
$lang['Username: %s'] = 'Nom d\'utilisateur : %s';
$lang['Email: %s'] = 'Email: %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 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';
$lang['Successfully registered, you will soon receive an email with your connection settings. Welcome!'] = 'Inscription réussie, vous recevrez bientôt un email avec vos identifiants. Bienvenue !';
$lang['Send my connection settings by email'] = 'Recevoir mes identifiants par email';

?>
2 changes: 2 additions & 0 deletions language/fr_FR/admin.lang.php
Expand Up @@ -843,4 +843,6 @@
$lang['Resize after upload'] = 'Redimensionner après transfert';
$lang['Photo Sizes'] = 'Tailles de photo';
$lang['Original Size'] = 'Taille originale';
$lang['Send connection settings by email'] = 'Envoyer les identifiants par email';

?>
9 changes: 6 additions & 3 deletions language/fr_FR/common.lang.php
Expand Up @@ -307,7 +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['Send my connection settings by email'] = 'Recevoir mes identifiants 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 @@ -318,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 réussie, un email avec votre mot de passe vient de vous être envoyé. Bienvenue !';
$lang['Successfully registered, you will soon receive an email with your connection settings. Welcome!'] = 'Inscription réussie, vous recevrez bientôt un email avec vos identifiants. Bienvenue !';
$lang['Specials'] = 'Spéciales';
$lang['SQL queries in'] = 'requêtes SQL en';
$lang['stop the slideshow'] = 'arrêter le diaporama';
Expand Down Expand Up @@ -369,7 +369,10 @@
$lang['Your password has been reset'] = 'Votre mot de passe a été réinitialisé';
$lang['original'] = "Original";
$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['Here are your connection settings'] = 'Voici vos identifiants';
$lang['Password: %s'] = 'Mot de passe : %s';
$lang['Username: %s'] = 'Nom d\'utilisateur : %s';
$lang['Email: %s'] = 'Email: %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';

?>
7 changes: 5 additions & 2 deletions register.php
Expand Up @@ -68,7 +68,10 @@
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('Here are your connection settings', ''),
get_l10n_args('Username: %s', $_POST['login']),
get_l10n_args('Password: %s', $_POST['password']),
get_l10n_args('Email: %s', $_POST['mail_address']),
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()),
);
Expand All @@ -82,7 +85,7 @@
)
);

$_SESSION['page_infos'][] = l10n('Successfully registered, an email with your password has been sent to you. Welcome!');
$_SESSION['page_infos'][] = l10n('Successfully registered, you will soon receive an email with your connection settings. Welcome!');
}

// log user and redirect
Expand Down
2 changes: 1 addition & 1 deletion themes/default/template/register.tpl
Expand Up @@ -48,7 +48,7 @@
</li>
<li>
<span class="property">
<label for="send_password_by_mail">{'Send my password by email'|@translate}</label>
<label for="send_password_by_mail">{'Send my connection settings by email'|@translate}</label>
</span>
<input type="checkbox" name="send_password_by_mail" id="send_password_by_mail" value="1" checked="checked">
</li>
Expand Down

0 comments on commit a412558

Please sign in to comment.