From 88f1e8307f9a83b506ecae2e013125389310fed6 Mon Sep 17 00:00:00 2001 From: Jerome Bakker Date: Wed, 18 Apr 2012 15:19:34 +0200 Subject: fixes #4406: validate username for max chars --- languages/en.php | 1 + 1 file changed, 1 insertion(+) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 14df3db34..25edfa149 100644 --- a/languages/en.php +++ b/languages/en.php @@ -503,6 +503,7 @@ $english = array( 'registration:notemail' => 'The email address you provided does not appear to be a valid email address.', 'registration:userexists' => 'That username already exists', 'registration:usernametooshort' => 'Your username must be a minimum of %u characters long.', + 'registration:usernametoolong' => 'Your username is too long it can have a maximum of %u characters.', 'registration:passwordtooshort' => 'The password must be a minimum of %u characters long.', 'registration:dupeemail' => 'This email address has already been registered.', 'registration:invalidchars' => 'Sorry, your username contains the character %s which is invalid. The following characters are invalid: %s', -- cgit v1.2.3 From 7c0215018897bfb578e6116ef9d36e5edc1fe5cf Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Wed, 16 May 2012 11:27:25 -0400 Subject: Fixes #2411: Show message when upload exceeds PHP limits, and show limits in Server Info --- engine/lib/actions.php | 15 +++++++++++++-- languages/en.php | 4 ++++ views/default/admin/statistics/server/php.php | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) (limited to 'languages') diff --git a/engine/lib/actions.php b/engine/lib/actions.php index c6613e6d6..3a7c02488 100644 --- a/engine/lib/actions.php +++ b/engine/lib/actions.php @@ -273,8 +273,19 @@ function validate_action_token($visibleerrors = TRUE, $token = NULL, $ts = NULL) } else if ($visibleerrors) { register_error(elgg_echo('actiongatekeeper:tokeninvalid')); } - } else if ($visibleerrors) { - register_error(elgg_echo('actiongatekeeper:missingfields')); + } else { + if (! empty($_SERVER['CONTENT_LENGTH']) && empty($_POST)) { + // The size of $_POST or uploaded file has exceed the size limit + $error_msg = elgg_trigger_plugin_hook('action_gatekeeper:upload_exceeded_msg', 'all', array( + 'post_size' => $_SERVER['CONTENT_LENGTH'], + 'visible_errors' => $visibleerrors, + ), elgg_echo('actiongatekeeper:uploadexceeded')); + } else { + $error_msg = elgg_echo('actiongatekeeper:missingfields'); + } + if ($visibleerrors) { + register_error($error_msg); + } } return FALSE; diff --git a/languages/en.php b/languages/en.php index 7b51b0c7d..ff730a018 100644 --- a/languages/en.php +++ b/languages/en.php @@ -741,6 +741,9 @@ $english = array( 'admin:server:label:mem_avail' => 'Memory available', 'admin:server:label:mem_used' => 'Memory used', 'admin:server:error_log' => "Web server's error log", + 'admin:server:label:post_max_size' => 'POST maximum size', + 'admin:server:label:upload_max_filesize' => 'Upload maximum size', + 'admin:server:warning:post_max_too_small' => '(Note: post_max_size must be larger than this value to support uploads of this size)', 'admin:user:label:search' => "Find users:", 'admin:user:label:searchbutton' => "Search", @@ -1171,6 +1174,7 @@ You cannot reply to this email.", 'actiongatekeeper:tokeninvalid' => "We encountered an error (token mismatch). This probably means that the page you were using expired.", 'actiongatekeeper:timeerror' => 'The page you were using has expired. Please refresh and try again.', 'actiongatekeeper:pluginprevents' => 'A extension has prevented this form from being submitted.', + 'actiongatekeeper:uploadexceeded' => 'The size of file(s) uploaded exceeded the limit set by your site administrator', /** diff --git a/views/default/admin/statistics/server/php.php b/views/default/admin/statistics/server/php.php index 4a59b95fb..7c6a51383 100644 --- a/views/default/admin/statistics/server/php.php +++ b/views/default/admin/statistics/server/php.php @@ -8,6 +8,15 @@ if (!$php_log) { $php_log = elgg_echo('admin:server:error_log'); } +$post_max_size = elgg_get_ini_setting_in_bytes('post_max_size'); +$upload_max_filesize = elgg_get_ini_setting_in_bytes('upload_max_filesize'); + +$post_max_size_warning = ''; +if ($upload_max_filesize > $post_max_size) { + // @todo show a link to something like http://nigel.mcnie.name/blog/uploadmaxfilesizepostmaxsize-experimentation ? + $post_max_size_warning = elgg_echo('admin:server:warning:post_max_too_small'); +} + ?> @@ -30,4 +39,12 @@ if (!$php_log) { + + + + + + + +
:
:
:
-- cgit v1.2.3 From f848e3ada3e29c17cc5028d7d9edad8035706334 Mon Sep 17 00:00:00 2001 From: Sem Date: Thu, 17 May 2012 13:48:57 +0200 Subject: Refs #4396. No revert, remove. --- actions/avatar/remove.php | 34 ++++++++++++++++++++++++++++++++++ actions/avatar/revert.php | 34 ---------------------------------- engine/lib/users.php | 2 +- languages/en.php | 7 ++++--- views/default/core/avatar/upload.php | 12 ++++++------ 5 files changed, 45 insertions(+), 44 deletions(-) create mode 100644 actions/avatar/remove.php delete mode 100644 actions/avatar/revert.php (limited to 'languages') diff --git a/actions/avatar/remove.php b/actions/avatar/remove.php new file mode 100644 index 000000000..cd38e456a --- /dev/null +++ b/actions/avatar/remove.php @@ -0,0 +1,34 @@ + $size_info) { + $file = new ElggFile(); + $file->owner_guid = $guid; + $file->setFilename("profile/{$guid}{$name}.jpg"); + $filepath = $file->getFilenameOnFilestore(); + if (!$file->delete()) { + elgg_log("Avatar file remove failed. Remove $filepath manually, please.", 'WARNING'); + } + } + + // Remove crop coords + unset($user->x1); + unset($user->x2); + unset($user->y1); + unset($user->y2); + + // Remove icon + unset($user->icontime); + system_message(elgg_echo('avatar:remove:success')); +} else { + register_error(elgg_echo('avatar:remove:fail')); +} + +forward(REFERER); diff --git a/actions/avatar/revert.php b/actions/avatar/revert.php deleted file mode 100644 index bc84e9298..000000000 --- a/actions/avatar/revert.php +++ /dev/null @@ -1,34 +0,0 @@ - $size_info) { - $file = new ElggFile(); - $file->owner_guid = $guid; - $file->setFilename("profile/{$guid}{$name}.jpg"); - $filepath = $file->getFilenameOnFilestore(); - if (!$file->delete()) { - elgg_log("Avatar file revert failed. Remove $filepath manually, please.", 'WARNING'); - } - } - - // Revert crop coords - unset($user->x1); - unset($user->x2); - unset($user->y1); - unset($user->y2); - - // Revert icon - unset($user->icontime); - system_message(elgg_echo('avatar:revert:success')); -} else { - register_error(elgg_echo('avatar:revert:fail')); -} - -forward(REFERER); diff --git a/engine/lib/users.php b/engine/lib/users.php index e209f2c38..7d427e743 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1556,7 +1556,7 @@ function users_init() { elgg_register_action('friends/remove'); elgg_register_action('avatar/upload'); elgg_register_action('avatar/crop'); - elgg_register_action('avatar/revert'); + elgg_register_action('avatar/remove'); elgg_register_action('profile/edit'); elgg_register_action('friends/collections/add'); diff --git a/languages/en.php b/languages/en.php index 7b51b0c7d..4fa7506e8 100644 --- a/languages/en.php +++ b/languages/en.php @@ -367,7 +367,7 @@ $english = array( 'avatar:preview' => 'Preview', 'avatar:upload' => 'Upload a new avatar', 'avatar:current' => 'Current avatar', - 'avatar:revert' => 'Revert your avatar to the default icon', + 'avatar:remove' => 'Remove your avatar and set the default icon', 'avatar:crop:title' => 'Avatar cropping tool', 'avatar:upload:instructions' => "Your avatar is displayed throughout the site. You can change it as often as you'd like. (File formats accepted: GIF, JPG or PNG)", 'avatar:create:instructions' => 'Click and drag a square below to match how you want your avatar cropped. A preview will appear in the box on the right. When you are happy with the preview, click \'Create your avatar\'. This cropped version will be used throughout the site as your avatar.', @@ -376,8 +376,8 @@ $english = array( 'avatar:resize:fail' => 'Resize of the avatar failed', 'avatar:crop:success' => 'Cropping the avatar succeeded', 'avatar:crop:fail' => 'Avatar cropping failed', - 'avatar:revert:success' => 'Reverting the avatar succeeded', - 'avatar:revert:fail' => 'Avatar revert failed', + 'avatar:remove:success' => 'Removing the avatar succeeded', + 'avatar:remove:fail' => 'Avatar remove failed', 'profile:edit' => 'Edit profile', 'profile:aboutme' => "About me", @@ -861,6 +861,7 @@ $english = array( 'new' => 'New', 'add' => 'Add', 'create' => 'Create', + 'remove' => 'Remove', 'revert' => 'Revert', 'site' => 'Site', diff --git a/views/default/core/avatar/upload.php b/views/default/core/avatar/upload.php index 29aa59c9c..6f9124192 100644 --- a/views/default/core/avatar/upload.php +++ b/views/default/core/avatar/upload.php @@ -12,12 +12,12 @@ $user_avatar = elgg_view('output/img', array( $current_label = elgg_echo('avatar:current'); -$revert_button = ''; +$remove_button = ''; if ($vars['entity']->icontime) { - $revert_button = elgg_view('output/url', array( - 'text' => elgg_echo('revert'), - 'title' => elgg_echo('avatar:revert'), - 'href' => 'action/avatar/revert?guid=' . elgg_get_page_owner_guid(), + $remove_button = elgg_view('output/url', array( + 'text' => elgg_echo('remove'), + 'title' => elgg_echo('avatar:remove'), + 'href' => 'action/avatar/remove?guid=' . elgg_get_page_owner_guid(), 'is_action' => true, 'class' => 'elgg-button elgg-button-cancel mll', )); @@ -39,7 +39,7 @@ $image = <<$current_label
$user_avatar -$revert_button +$remove_button HTML; $body = << Date: Sat, 2 Jun 2012 10:23:49 -0400 Subject: Refs #2411 removed in warning as it was causing a display issue in server info table --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index ff730a018..406179940 100644 --- a/languages/en.php +++ b/languages/en.php @@ -743,7 +743,7 @@ $english = array( 'admin:server:error_log' => "Web server's error log", 'admin:server:label:post_max_size' => 'POST maximum size', 'admin:server:label:upload_max_filesize' => 'Upload maximum size', - 'admin:server:warning:post_max_too_small' => '(Note: post_max_size must be larger than this value to support uploads of this size)', + 'admin:server:warning:post_max_too_small' => '(Note: post_max_size must be larger than this value to support uploads of this size)', 'admin:user:label:search' => "Find users:", 'admin:user:label:searchbutton' => "Search", -- cgit v1.2.3 From d06b10d5f084aceecdd302036697212a8d8d08e5 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 11:28:32 -0400 Subject: Fixes #2424 confirmation message when deleting multiple messages --- languages/en.php | 1 + mod/messages/views/default/forms/messages/process.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 6c06d70b5..1865f6ecd 100644 --- a/languages/en.php +++ b/languages/en.php @@ -938,6 +938,7 @@ $english = array( */ 'deleteconfirm' => "Are you sure you want to delete this item?", + 'deleteconfirm:plural' => "Are you sure you want to delete these items?", 'fileexists' => "A file has already been uploaded. To replace it, select it below:", /** diff --git a/mod/messages/views/default/forms/messages/process.php b/mod/messages/views/default/forms/messages/process.php index f86c3217a..cb30792e9 100644 --- a/mod/messages/views/default/forms/messages/process.php +++ b/mod/messages/views/default/forms/messages/process.php @@ -19,10 +19,12 @@ echo $messages; echo ''; echo '
'; + echo elgg_view('input/submit', array( 'value' => elgg_echo('delete'), 'name' => 'delete', - 'class' => 'elgg-button-delete', + 'class' => 'elgg-button-delete elgg-requires-confirmation', + 'title' => elgg_echo('deleteconfirm:plural'), )); if ($vars['folder'] == "inbox") { -- cgit v1.2.3 From 0792a587b24f47d9e3755eaca0398d263c223aab Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 11:48:25 -0400 Subject: added 2 missing language strings for profile editing - thanks to webgalli for reporting these --- languages/en.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 1865f6ecd..a40baa61a 100644 --- a/languages/en.php +++ b/languages/en.php @@ -412,6 +412,8 @@ $english = array( 'profile:explainchangefields' => "You can replace the existing profile fields with your own using the form below. \n\n Give the new profile field a label, for example, 'Favorite team', then select the field type (eg. text, url, tags), and click the 'Add' button. To re-order the fields drag on the handle next to the field label. To edit a field label - click on the label's text to make it editable. \n\n At any time you can revert back to the default profile set up, but you will lose any information already entered into custom fields on profile pages.", 'profile:editdefault:success' => 'New profile field added', 'profile:editdefault:fail' => 'Default profile could not be saved', + 'profile:field_too_long' => 'Cannot save your profile information because the "%s" section is too long.', + 'profile:noaccess' => "You do not have permission to edit this profile.", /** -- cgit v1.2.3 From 2f4ca1e52663ae9c991408e2035217a810b0e7a1 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 15:09:59 -0400 Subject: fixed typo for friends activity string --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index a40baa61a..d7de34015 100644 --- a/languages/en.php +++ b/languages/en.php @@ -813,7 +813,7 @@ $english = array( */ 'river:all' => 'All Site Activity', 'river:mine' => 'My Activity', - 'river:friends' => 'Friends Activty', + 'river:friends' => 'Friends Activity', 'river:select' => 'Show %s', 'river:comments:more' => '+%u more', 'river:generic_comment' => 'commented on %s %s', -- cgit v1.2.3 From 7c18f2d39699fa298227d87ac531305de296c747 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 2 Jun 2012 16:08:16 -0400 Subject: Refs #4406 fixed grammar in error message --- languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 81852107b..f1de1f202 100644 --- a/languages/en.php +++ b/languages/en.php @@ -505,7 +505,7 @@ $english = array( 'registration:notemail' => 'The email address you provided does not appear to be a valid email address.', 'registration:userexists' => 'That username already exists', 'registration:usernametooshort' => 'Your username must be a minimum of %u characters long.', - 'registration:usernametoolong' => 'Your username is too long it can have a maximum of %u characters.', + 'registration:usernametoolong' => 'Your username is too long. It can have a maximum of %u characters.', 'registration:passwordtooshort' => 'The password must be a minimum of %u characters long.', 'registration:dupeemail' => 'This email address has already been registered.', 'registration:invalidchars' => 'Sorry, your username contains the character %s which is invalid. The following characters are invalid: %s', -- cgit v1.2.3 From eb9f207972cf4ebeec71cf7e3a0e762df5d4c40a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 15 Jun 2012 22:55:21 -0400 Subject: Fixes #4496, #4500 Refs #2814 Add consistent error message when content does not exist or user does not have access --- languages/en.php | 2 +- mod/blog/languages/en.php | 1 - mod/blog/lib/blog.php | 2 +- mod/bookmarks/pages/bookmarks/view.php | 4 ++++ mod/file/pages/file/view.php | 4 ++++ mod/pages/pages/pages/view.php | 1 + mod/thewire/pages/thewire/view.php | 4 ++-- 7 files changed, 13 insertions(+), 5 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index f1de1f202..ae874a550 100644 --- a/languages/en.php +++ b/languages/en.php @@ -239,7 +239,7 @@ $english = array( 'pageownerunavailable' => 'Warning: The page owner %d is not accessible!', 'viewfailure' => 'There was an internal failure in the view %s', 'changebookmark' => 'Please change your bookmark for this page', - 'noaccess' => 'This content has been removed, is invalid, or you do not have permission to view it.', + 'noaccess' => 'The content you were trying to view has been removed or you do not have permission to view it.', 'error:missing_data' => 'There was some data missing in your request', 'error:default' => 'Oops...something went wrong.', diff --git a/mod/blog/languages/en.php b/mod/blog/languages/en.php index e1930b916..5248a6f51 100644 --- a/mod/blog/languages/en.php +++ b/mod/blog/languages/en.php @@ -41,7 +41,6 @@ $english = array( 'blog:message:saved' => 'Blog post saved.', 'blog:error:cannot_save' => 'Cannot save blog post.', 'blog:error:cannot_write_to_container' => 'Insufficient access to save blog to group.', - 'blog:error:post_not_found' => 'This post has been removed, is invalid, or you do not have permission to view it.', 'blog:messages:warning:draft' => 'There is an unsaved draft of this post!', 'blog:edit_revision_notice' => '(Old version)', 'blog:message:deleted_post' => 'Blog post deleted.', diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 286fe1832..9d6cb37e7 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -22,7 +22,7 @@ function blog_get_page_content_read($guid = NULL) { $return['filter'] = ''; if (!elgg_instanceof($blog, 'object', 'blog')) { - $return['content'] = elgg_echo('blog:error:post_not_found'); + $return['content'] = elgg_echo('noaccess'); return $return; } diff --git a/mod/bookmarks/pages/bookmarks/view.php b/mod/bookmarks/pages/bookmarks/view.php index 2439d2ee8..c819b8b41 100644 --- a/mod/bookmarks/pages/bookmarks/view.php +++ b/mod/bookmarks/pages/bookmarks/view.php @@ -6,6 +6,10 @@ */ $bookmark = get_entity(get_input('guid')); +if (!$bookmark) { + register_error(elgg_echo('noaccess')); + forward(''); +} $page_owner = elgg_get_page_owner_entity(); diff --git a/mod/file/pages/file/view.php b/mod/file/pages/file/view.php index a571c9d68..ec51b30e6 100644 --- a/mod/file/pages/file/view.php +++ b/mod/file/pages/file/view.php @@ -6,6 +6,10 @@ */ $file = get_entity(get_input('guid')); +if (!$file) { + register_error(elgg_echo('noaccess')); + forward(''); +} $owner = elgg_get_page_owner_entity(); diff --git a/mod/pages/pages/pages/view.php b/mod/pages/pages/pages/view.php index 9bfd67a12..6b9d03f49 100644 --- a/mod/pages/pages/pages/view.php +++ b/mod/pages/pages/pages/view.php @@ -8,6 +8,7 @@ $page_guid = get_input('guid'); $page = get_entity($page_guid); if (!$page) { + register_error(elgg_echo('noaccess')); forward(); } diff --git a/mod/thewire/pages/thewire/view.php b/mod/thewire/pages/thewire/view.php index f45f94bfe..1818e725a 100644 --- a/mod/thewire/pages/thewire/view.php +++ b/mod/thewire/pages/thewire/view.php @@ -5,8 +5,8 @@ $post = get_entity(get_input('guid')); if (!$post) { - // @todo need special handling for not getting access to entity (check for existence, access) - forward(); + register_error(elgg_echo('noaccess')); + forward(''); } $owner = $post->getOwnerEntity(); if (!$owner) { -- cgit v1.2.3 From cfd0169e52aa9dcbfde5148ad3d6b89684e6bb28 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 17 Jun 2012 09:34:47 -0400 Subject: Fixes #4422 pulling in Ismayil's changes so that we use the module view for settings --- languages/en.php | 2 +- .../core/settings/account/default_access.php | 24 +++------ views/default/core/settings/account/email.php | 24 +++------ views/default/core/settings/account/language.php | 29 ++++------ views/default/core/settings/account/name.php | 29 +++++----- .../core/settings/account/notifications.php | 45 ++++++---------- views/default/core/settings/account/password.php | 54 ++++++++----------- .../core/settings/statistics/numentities.php | 63 ++++++++++------------ views/default/core/settings/statistics/online.php | 48 +++++++++++------ 9 files changed, 137 insertions(+), 181 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index ae874a550..e9c333041 100644 --- a/languages/en.php +++ b/languages/en.php @@ -452,7 +452,7 @@ $english = array( * Notifications */ 'notifications:usersettings' => "Notification settings", - 'notifications:methods' => "Please specify which methods you want to permit.", + 'notifications:methods' => "Select your notification methods.", 'notification:method:email' => 'Email', 'notifications:usersettings:save:ok' => "Your notification settings were successfully saved.", diff --git a/views/default/core/settings/account/default_access.php b/views/default/core/settings/account/default_access.php index e33211460..690f2714a 100644 --- a/views/default/core/settings/account/default_access.php +++ b/views/default/core/settings/account/default_access.php @@ -12,22 +12,14 @@ if (elgg_get_config('allow_user_default_access')) { if (false === ($default_access = $user->getPrivateSetting('elgg_default_access'))) { $default_access = elgg_get_config('default_access'); } -?> -
-
-

-
-
-

- : - 'default_access', 'value' => $default_access)); + $title = elgg_echo('default_access:settings'); + $content = elgg_echo('default_access:label') . ': '; + $content .= elgg_view('input/access', array( + 'name' => 'default_access', + 'value' => $default_access, + )); - ?> -

-
-
- -
-
-

-
-
-

- : - 'email', 'value' => $user->email)); - ?> -

-
-
- 'email', + 'value' => $user->email, + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/language.php b/views/default/core/settings/account/language.php index 3a992966f..b36057422 100644 --- a/views/default/core/settings/account/language.php +++ b/views/default/core/settings/account/language.php @@ -9,23 +9,12 @@ $user = elgg_get_page_owner_entity(); if ($user) { -?> -
-
-

-
-
-

- : - 'language', - 'value' => $user->language, - 'options_values' => get_installed_translations() - )); - ?> -

-
-
- 'language', + 'value' => $user->language, + 'options_values' => get_installed_translations() + )); + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/account/name.php b/views/default/core/settings/account/name.php index f719a84de..e356146a3 100644 --- a/views/default/core/settings/account/name.php +++ b/views/default/core/settings/account/name.php @@ -7,20 +7,15 @@ */ $user = elgg_get_page_owner_entity(); -?> -
-
-

-
-
-

- : - 'name', 'value' => $user->name)); - ?> -

-
-
- 'guid', 'value' => $user->guid)); +if ($user) { + $title = elgg_echo('user:name:label'); + $content = elgg_echo('name') . ': '; + $content .= elgg_view('input/text', array( + 'name' => 'name', + 'value' => $user->name, + )); + echo elgg_view_module('info', $title, $content); + + // need the user's guid to make sure the correct user gets updated + echo elgg_view('input/hidden', array('name' => 'guid', 'value' => $user->guid)); +} diff --git a/views/default/core/settings/account/notifications.php b/views/default/core/settings/account/notifications.php index 51292b2c9..c212b3886 100644 --- a/views/default/core/settings/account/notifications.php +++ b/views/default/core/settings/account/notifications.php @@ -9,33 +9,20 @@ global $NOTIFICATION_HANDLERS; $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid()); -?> -
-
-

-
-
+$title = elgg_echo('notifications:usersettings'); -

+$rows = ''; - - $v) { -?> - - - - - - -
: - $v) { if ($notification_settings->$k) { $val = "yes"; } else { $val = "no"; } - - echo elgg_view('input/radio', array( + + $radio = elgg_view('input/radio', array( 'name' => "method[$k]", 'value' => $val, 'options' => array( @@ -44,12 +31,14 @@ $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid ), )); -?> -
-

-
\ No newline at end of file + $cells = '' . elgg_echo("notification:method:$k") . ': '; + $cells .= "$radio"; + + $rows .= "$cells"; +} + + +$content = elgg_echo('notifications:methods'); +$content .= "$rows
"; + +echo elgg_view_module('info', $title, $content); diff --git a/views/default/core/settings/account/password.php b/views/default/core/settings/account/password.php index a80f3df6b..4857034b2 100644 --- a/views/default/core/settings/account/password.php +++ b/views/default/core/settings/account/password.php @@ -1,45 +1,33 @@ -
-
-

-
-
- guid == elgg_get_logged_in_user_guid()) { - ?> -

- : - 'current_password')); - ?> -

- + $title = elgg_echo('user:set:password'); -

- : - 'password')); - ?> -

+ // only make the admin user enter current password for changing his own password. + $admin = ''; + if (!elgg_is_admin_logged_in() || elgg_is_admin_logged_in() && $user->guid == elgg_get_logged_in_user_guid()) { + $admin .= elgg_echo('user:current_password:label') . ': '; + $admin .= elgg_view('input/password', array('name' => 'current_password')); + $admin = "

$admin

"; + } -

- : 'password2')); - ?> -

-
-
- 'password')); + $password = "

$password

"; + + $password2 = elgg_echo('user:password2:label') . ': '; + $password2 .= elgg_view('input/password', array('name' => 'password2')); + $password2 = "

$password2

"; + + $content = $admin . $password . $password2; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics/numentities.php b/views/default/core/settings/statistics/numentities.php index 245fd67be..ce1705a2e 100644 --- a/views/default/core/settings/statistics/numentities.php +++ b/views/default/core/settings/statistics/numentities.php @@ -10,42 +10,35 @@ $entity_stats = get_entity_statistics(elgg_get_logged_in_user_guid()); if ($entity_stats) { -?> -
-
-

-
-
- - $entry) { - foreach ($entry as $a => $b) { + $rows = ''; + foreach ($entity_stats as $k => $entry) { + foreach ($entry as $a => $b) { - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + // This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - if ($a == "__base__") { - $a = elgg_echo("item:{$k}"); - if (empty($a)) { - $a = $k; - } - } else { - $a = elgg_echo("item:{$k}:{$a}"); - if (empty($a)) { - $a = "$k $a"; - } - } - echo <<< END - - - - -END; + if ($a == "__base__") { + $a = elgg_echo("item:{$k}"); + if (empty($a)) { + $a = $k; + } + } else { + $a = elgg_echo("item:{$k}:{$a}"); + if (empty($a)) { + $a = "$k $a"; } } - ?> -
{$a}:{$b}
-
-
- + {$a}: + {$b} + +END; + } + } + + $title = elgg_echo('usersettings:statistics:label:numentities'); + $content = "$rows
"; + + echo elgg_view_module('info', $title, $content); +} diff --git a/views/default/core/settings/statistics/online.php b/views/default/core/settings/statistics/online.php index 65db42cb1..ce7ff35fb 100644 --- a/views/default/core/settings/statistics/online.php +++ b/views/default/core/settings/statistics/online.php @@ -1,6 +1,6 @@ time_created; } -?> -
-
-

-
-
- - - - - -
name; ?>
email; ?>
time_created); ?>
-
-
\ No newline at end of file +$label_name = elgg_echo('usersettings:statistics:label:name'); +$label_email = elgg_echo('usersettings:statistics:label:email'); +$label_member_since = elgg_echo('usersettings:statistics:label:membersince'); +$label_last_login = elgg_echo('usersettings:statistics:label:lastlogin'); + +$time_created = date("r", $user->time_created); +$last_login = date("r", $logged_in); + +$title = elgg_echo('usersettings:statistics:yourdetails'); + +$content = <<<__HTML + + + + + + + + + + + + + + + + + +
$label_name$user->name
$label_email$user->email
$label_member_since$time_created
$label_last_login$last_login
+__HTML; + +echo elgg_view_module('info', $title, $content); -- cgit v1.2.3