diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/admin/site/update_advanced.php | 3 | ||||
-rw-r--r-- | actions/admin/site/update_basic.php | 3 | ||||
-rw-r--r-- | actions/avatar/revert.php | 15 | ||||
-rw-r--r-- | actions/login.php | 13 |
4 files changed, 29 insertions, 5 deletions
diff --git a/actions/admin/site/update_advanced.php b/actions/admin/site/update_advanced.php index 7d57f78ea..12c5542e7 100644 --- a/actions/admin/site/update_advanced.php +++ b/actions/admin/site/update_advanced.php @@ -9,8 +9,7 @@ * @subpackage Administration.Site */ -if (datalist_get('default_site')) { - $site = get_entity(datalist_get('default_site')); +if ($site = elgg_get_site_entity()) { if (!($site instanceof ElggSite)) { throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite')); } diff --git a/actions/admin/site/update_basic.php b/actions/admin/site/update_basic.php index 45f00a20d..97d258b65 100644 --- a/actions/admin/site/update_basic.php +++ b/actions/admin/site/update_basic.php @@ -10,8 +10,7 @@ * @subpackage Administration.Site */ -if (datalist_get('default_site')) { - $site = get_entity(datalist_get('default_site')); +if ($site = elgg_get_site_entity()) { if (!($site instanceof ElggSite)) { throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite')); } diff --git a/actions/avatar/revert.php b/actions/avatar/revert.php new file mode 100644 index 000000000..8cff40a68 --- /dev/null +++ b/actions/avatar/revert.php @@ -0,0 +1,15 @@ +<?php +/** + * Avatar revert action + */ + +$guid = get_input('guid'); +$user = get_entity($guid); +if ($user) { + unset($user->icontime); + system_message(elgg_echo('avatar:revert:success')); +} else { + register_error(elgg_echo('avatar:revert:fail')); +} + +forward(REFERER); diff --git a/actions/login.php b/actions/login.php index c717faadd..256e78acb 100644 --- a/actions/login.php +++ b/actions/login.php @@ -46,10 +46,21 @@ if (!$user) { try { login($user, $persistent); + // re-register at least the core language file for users with language other than site default + register_translations(dirname(dirname(__FILE__)) . "/languages/"); } catch (LoginException $e) { register_error($e->getMessage()); forward(REFERER); } -system_message(elgg_echo('loginok')); +// elgg_echo() caches the language and does not provide a way to change the language. +// @todo we need to use the config object to store this so that the current language +// can be changed. Refs #4171 +if ($user->language) { + $message = elgg_echo('loginok', array(), $user->language); +} else { + $message = elgg_echo('loginok'); +} + +system_message($message); forward($forward_url); |