aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/themes/default/template/install.tpl2
-rw-r--r--admin/themes/default/template/user_list.tpl1
-rw-r--r--admin/user_list.php32
3 files changed, 34 insertions, 1 deletions
diff --git a/admin/themes/default/template/install.tpl b/admin/themes/default/template/install.tpl
index 5fbdcd5b6..58928fb45 100644
--- a/admin/themes/default/template/install.tpl
+++ b/admin/themes/default/template/install.tpl
@@ -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>
diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl
index 62f488769..4458f9792 100644
--- a/admin/themes/default/template/user_list.tpl
+++ b/admin/themes/default/template/user_list.tpl
@@ -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>
diff --git a/admin/user_list.php b/admin/user_list.php
index 33c3485f1..425c3c698 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -242,6 +242,38 @@ else if ($conf['double_password_type_in_admin'] == false)
}
}
+// 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 |
// +-----------------------------------------------------------------------+