Permalink
Browse files

fix(i18n): admin-created accounts now get site language instead of ad…

…min's language

Fixes #9454
  • Loading branch information...
juho-jaakkola committed Mar 8, 2016
1 parent e1647f2 commit 561bad37580406b3298f816e12956283d826c602
Showing with 8 additions and 0 deletions.
  1. +8 −0 actions/useradd.php
View
@@ -15,6 +15,10 @@
$email = get_input('email');
$name = get_input('name');
// This param is not included in the useradd form by default,
// but it allows sites to easily add the feature if necessary.
$language = get_input('language', elgg_get_config('language'));
$admin = get_input('admin');
if (is_array($admin)) {
$admin = $admin[0];
@@ -47,6 +51,10 @@
// @todo ugh, saving a guid as metadata!
$new_user->created_by_guid = elgg_get_logged_in_user_guid();
// The user language is set also by register_user(), but it defaults to
// language of the current user (admin), so we need to fix it here.
$new_user->language = $language;
$subject = elgg_echo('useradd:subject', array(), $new_user->language);
$body = elgg_echo('useradd:body', array(
$name,

0 comments on commit 561bad3

Please sign in to comment.