From dce60b43126dcaa38e6845ae45e09db87aa7e229 Mon Sep 17 00:00:00 2001 From: Sem Date: Tue, 17 Jul 2012 02:46:53 +0200 Subject: Refs #4643. Added unlock upgrade action. --- languages/en.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 18d0c88d9..159867e2f 100644 --- a/languages/en.php +++ b/languages/en.php @@ -1047,6 +1047,9 @@ Once you have logged in, we highly recommend that you change your password. 'upgrading' => 'Upgrading...', 'upgrade:db' => 'Your database was upgraded.', 'upgrade:core' => 'Your Elgg installation was upgraded.', + 'upgrade:unlock' => 'Unlock upgrade', + 'upgrade:unlock:confirm' => "Somebody is performing an upgrade. You should cancel and wait until upgrade is done. Are you sure you want to continue?", + 'upgrade:unlock:success' => "Upgrade unlocked suscessfully.", 'upgrade:unable_to_upgrade' => 'Unable to upgrade.', 'upgrade:unable_to_upgrade_info' => 'This installation cannot be upgraded because legacy views -- cgit v1.2.3 From 22e8d9be4582b78a500382e14046a653a14e3f43 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sun, 16 Dec 2012 17:26:03 -0500 Subject: Refs #4643. Cleanup for the upgrade lock. --- engine/lib/upgrade.php | 20 ++++++++++++-------- languages/en.php | 3 ++- upgrade.php | 5 +++-- views/default/widgets/control_panel/content.php | 10 ++-------- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'languages') diff --git a/engine/lib/upgrade.php b/engine/lib/upgrade.php index 7f55c4cba..f4f4b16f5 100644 --- a/engine/lib/upgrade.php +++ b/engine/lib/upgrade.php @@ -313,7 +313,9 @@ function elgg_upgrade_bootstrap_17_to_18() { } /** - * Locks a mutual execution of upgrade + * Creates a table {prefix}upgrade_lock that is used as a mutex for upgrades. + * + * @see _elgg_upgrade_lock() * * @return bool * @access private @@ -323,24 +325,26 @@ function _elgg_upgrade_lock() { if (!_elgg_upgrade_is_locked()) { // lock it - insert_data("create table {$CONFIG->dbprefix}locked (id INT)"); - error_log('Upgrade continue running'); + insert_data("create table {$CONFIG->dbprefix}upgrade_lock (id INT)"); + elgg_log('Locked for upgrade.', 'NOTICE'); return true; } - error_log('Upgrade is locked'); + elgg_log('Cannot lock for upgrade: already locked.', 'WARNING'); return false; } /** - * Unlocks upgrade for new upgrade executions + * Unlocks upgrade. + * + * @see _elgg_upgrade_lock() * * @access private */ function _elgg_upgrade_unlock() { global $CONFIG; - delete_data("drop table {$CONFIG->dbprefix}locked"); - error_log('Upgrade unlocks itself'); + delete_data("drop table {$CONFIG->dbprefix}upgrade_lock"); + elgg_log('Upgrade unlocked.', 'NOTICE'); } /** @@ -352,7 +356,7 @@ function _elgg_upgrade_unlock() { function _elgg_upgrade_is_locked() { global $CONFIG, $DB_QUERY_CACHE; - $is_locked = count(get_data("show tables like '{$CONFIG->dbprefix}locked'")); + $is_locked = count(get_data("show tables like '{$CONFIG->dbprefix}upgrade_lock'")); // Invalidate query cache if ($DB_QUERY_CACHE) { diff --git a/languages/en.php b/languages/en.php index 159867e2f..f1a1d650b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -1048,7 +1048,8 @@ Once you have logged in, we highly recommend that you change your password. 'upgrade:db' => 'Your database was upgraded.', 'upgrade:core' => 'Your Elgg installation was upgraded.', 'upgrade:unlock' => 'Unlock upgrade', - 'upgrade:unlock:confirm' => "Somebody is performing an upgrade. You should cancel and wait until upgrade is done. Are you sure you want to continue?", + 'upgrade:unlock:confirm' => "The database is locked for another upgrade. Running concurrent upgrades is dangerous. You should only continue if you know there is not another upgrade running. Unlock?", + 'upgrade:locked' => "Cannot upgrade. Another upgrade is running. To clear the upgrade lock, visit the Admin section.", 'upgrade:unlock:success' => "Upgrade unlocked suscessfully.", 'upgrade:unable_to_upgrade' => 'Unable to upgrade.', 'upgrade:unable_to_upgrade_info' => diff --git a/upgrade.php b/upgrade.php index a58fcdc96..c5f158c61 100644 --- a/upgrade.php +++ b/upgrade.php @@ -9,6 +9,8 @@ * new version of the script. Deleting the script is not a requirement and * leaving it behind does not affect the security of the site. * + * Upgrades use a table {db_prefix}upgrade_lock as a mutex to prevent concurrent upgrades. + * * @package Elgg.Core * @subpackage Upgrade */ @@ -20,9 +22,9 @@ define('UPGRADING', 'upgrading'); require_once(dirname(__FILE__) . "/engine/start.php"); if (get_input('upgrade') == 'upgrade') { - // prevent someone from running the upgrade script in parallel (see #4643) if (!_elgg_upgrade_lock()) { + register_error(elgg_echo('upgrade:locked')); forward(); } @@ -40,7 +42,6 @@ if (get_input('upgrade') == 'upgrade') { elgg_invalidate_simplecache(); elgg_reset_system_cache(); - // critical region has past _elgg_upgrade_unlock(); } else { diff --git a/views/default/widgets/control_panel/content.php b/views/default/widgets/control_panel/content.php index e6763d851..a348d612f 100644 --- a/views/default/widgets/control_panel/content.php +++ b/views/default/widgets/control_panel/content.php @@ -12,13 +12,7 @@ elgg_register_menu_item('admin_control_panel', array( )); // @todo Move in this in ElggUpgradeManager::isLocked() when #4682 fixed -global $CONFIG, $DB_QUERY_CACHE; -$is_locked = count(get_data("show tables like '{$CONFIG->dbprefix}locked'")); -// Invalidate query cache -if ($DB_QUERY_CACHE) { - $DB_QUERY_CACHE->clear(); - elgg_log("Query cache invalidated", 'NOTICE'); -} +$is_locked = _elgg_upgrade_is_locked(); if (!$is_locked) { elgg_register_menu_item('admin_control_panel', array( @@ -33,7 +27,7 @@ if (!$is_locked) { 'text' => elgg_echo('upgrade:unlock'), 'href' => 'action/admin/site/unlock_upgrade', 'is_action' => true, - 'link_class' => 'elgg-button elgg-button-delete', + 'link_class' => 'elgg-button elgg-button-action', 'confirm' => elgg_echo('upgrade:unlock:confirm'), )); } -- cgit v1.2.3 From 3cfc0d3c2b5b4aaaa94179060370e1fe34668464 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 19 Jan 2013 09:36:27 -0500 Subject: Fixes #4982 adds confirm dialog to profile field reset --- CHANGES.txt | 14 +++++++++++++- languages/en.php | 3 ++- views/default/admin/appearance/profile_fields.php | 12 ++++++++++-- views/default/forms/profile/fields/reset.php | 12 ------------ 4 files changed, 25 insertions(+), 16 deletions(-) delete mode 100644 views/default/forms/profile/fields/reset.php (limited to 'languages') diff --git a/CHANGES.txt b/CHANGES.txt index acfb7055e..8687b3d2a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,15 @@ +Version 1.8.13 +(January xx, 2013 from https://github.com/Elgg/Elgg/tree/1.8) + Contributing Developers: + * Cash Costello + * Cristo Rabani + + Security Fixes: + + Enhancements: + * Added confirm dialog for resetting profile fields (adds language string profile:resetdefault:confirm) + + Version 1.8.12 (January 4th, 2013 from https://github.com/Elgg/Elgg/tree/1.8) Contributing Developers: @@ -7,7 +19,6 @@ Version 1.8.12 * Matt Beckett * Paweł Sroka * Sem - * Srokap * Steve Clay Bugfixes: @@ -34,6 +45,7 @@ Version 1.8.12 * Twitter: Login with twitter supports persistent login and correctly forwards after login. + Version 1.8.11 (December 5th, 2012 from https://github.com/Elgg/Elgg/tree/1.8) diff --git a/languages/en.php b/languages/en.php index f3acc50ee..00a825b4d 100644 --- a/languages/en.php +++ b/languages/en.php @@ -405,7 +405,8 @@ $english = array( 'profile:editdefault:delete:fail' => 'Removed default profile item field failed', 'profile:editdefault:delete:success' => 'Profile field deleted', 'profile:defaultprofile:reset' => 'Profile fields reset to the system default', - 'profile:resetdefault' => 'Reset default profile', + 'profile:resetdefault' => 'Reset profile fields to system defaults', + 'profile:resetdefault:confirm' => 'Are you sure you want to delete your custom profile fields?', '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', diff --git a/views/default/admin/appearance/profile_fields.php b/views/default/admin/appearance/profile_fields.php index 91d14b874..f1d78c19f 100644 --- a/views/default/admin/appearance/profile_fields.php +++ b/views/default/admin/appearance/profile_fields.php @@ -5,12 +5,20 @@ $add = elgg_view_form('profile/fields/add', array('class' => 'elgg-form-settings'), array()); $list = elgg_view('admin/appearance/profile_fields/list'); -$reset = elgg_view_form('profile/fields/reset', array(), array()); + +$reset = elgg_view('output/confirmlink', array( + 'text' => elgg_echo('reset'), + 'href' => 'action/profile/fields/reset', + 'title' => elgg_echo('profile:resetdefault'), + 'confirm' => elgg_echo('profile:resetdefault:confirm'), + 'class' => 'elgg-button elgg-button-cancel', + 'is_trusted' => 'true', +)); $body = <<<__HTML $add $list -$reset +
$reset
__HTML; echo $body; diff --git a/views/default/forms/profile/fields/reset.php b/views/default/forms/profile/fields/reset.php deleted file mode 100644 index c0bb1b7f4..000000000 --- a/views/default/forms/profile/fields/reset.php +++ /dev/null @@ -1,12 +0,0 @@ -'; -$params = array( - 'value' => elgg_echo('profile:resetdefault'), - 'class' => 'elgg-button-cancel', -); -echo elgg_view('input/submit', $params); -echo ''; -- cgit v1.2.3 From 6fed7f5286a839cd81d038df8a7988a388d82f2b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 19 Jan 2013 10:18:02 -0500 Subject: standardise on American spelling of licence --- 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 00a825b4d..02e6eeb68 100644 --- a/languages/en.php +++ b/languages/en.php @@ -689,7 +689,7 @@ $english = array( 'admin:plugins:label:author' => "Author", 'admin:plugins:label:copyright' => "Copyright", 'admin:plugins:label:categories' => 'Categories', - 'admin:plugins:label:licence' => "Licence", + 'admin:plugins:label:licence' => "License", 'admin:plugins:label:website' => "URL", 'admin:plugins:label:repository' => "Code", 'admin:plugins:label:bugtracker' => "Report issue", -- cgit v1.2.3 From 9f2b42a75768b6da60b94ae7fadc8b3d8dd29526 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 25 Jan 2013 17:17:12 -0500 Subject: adds missing language string --- languages/en.php | 1 + 1 file changed, 1 insertion(+) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 02e6eeb68..125e2358f 100644 --- a/languages/en.php +++ b/languages/en.php @@ -664,6 +664,7 @@ $english = array( 'admin:notices:could_not_delete' => 'Could not delete notice.', + 'item:object:admin_notice' => 'Admin notice', 'admin:options' => 'Admin options', -- cgit v1.2.3 From d33d3521485138551d95d4c4187eb46a90ae4d9d Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 26 Jan 2013 10:27:23 -0500 Subject: Defines river:comment:object:default - taken from PR 438 --- CHANGES.txt | 9 ++++++++- languages/en.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'languages') diff --git a/CHANGES.txt b/CHANGES.txt index 105d60f72..8b8838e71 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,14 +1,21 @@ Version 1.8.13 -(January xx, 2013 from https://github.com/Elgg/Elgg/tree/1.8) +(January 29, 2013 from https://github.com/Elgg/Elgg/tree/1.8) Contributing Developers: * Cash Costello + * Juho Jaakkola * Kevin Jardine * Krzysztof Różalski + * Steve Clay Security Fixes: Bugfixes: * CLI usages with walled garden fixed + * Upgrading from < 1.8 to 1.8 fixed + * Default widgets fixed + * Quotes in object titles no longer result in "qout" in URLs + * List of my groups is ordered now + * Language string river:comment:object:default is defined now Enhancements: * Added confirm dialog for resetting profile fields (adds language string profile:resetdefault:confirm) diff --git a/languages/en.php b/languages/en.php index 125e2358f..78f37ab63 100644 --- a/languages/en.php +++ b/languages/en.php @@ -1141,7 +1141,7 @@ If you requested this, click on the link below. Otherwise ignore this email. 'comments:count' => "%s comments", - 'riveraction:annotation:generic_comment' => '%s commented on %s', + 'river:comment:object:default' => '%s commented on %s', 'generic_comments:add' => "Leave a comment", 'generic_comments:post' => "Post comment", -- cgit v1.2.3 From 0853342ae55328e2744a15aa1a8f37852ad76604 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 26 Jan 2013 10:33:51 -0500 Subject: fixed comment language for brief display of comments - made it easier to translate - taken from PR 438 --- languages/en.php | 1 + views/default/annotation/generic_comment.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'languages') diff --git a/languages/en.php b/languages/en.php index 78f37ab63..353896047 100644 --- a/languages/en.php +++ b/languages/en.php @@ -1155,6 +1155,7 @@ If you requested this, click on the link below. Otherwise ignore this email. 'generic_comment:failure' => "An unexpected error occurred when adding your comment.", 'generic_comment:none' => 'No comments', 'generic_comment:title' => 'Comment by %s', + 'generic_comment:on' => '%s on %s', 'generic_comment:email:subject' => 'You have a new comment!', 'generic_comment:email:body' => "You have a new comment on your item \"%s\" from %s. It reads: diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index 9891510e0..22a8d9211 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -55,13 +55,13 @@ HTML; //@todo need link to actual comment! - $on = elgg_echo('on'); + $commented_on = elgg_echo('generic_comment:on', array($commenter_link, $entity_link)); $excerpt = elgg_get_excerpt($comment->value, 80); $body = << - $commenter_link $on $entity_link ($friendlytime): $excerpt + $commented_on ($friendlytime): $excerpt HTML; -- cgit v1.2.3