diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2013-07-29 11:42:02 -0300 |
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2013-07-29 11:42:02 -0300 |
| commit | bb3c9a26bb75c76c5934d327548bf08606467b9f (patch) | |
| tree | 26760aa866799fc70683ef6845bf54fb17bdc955 /engine/lib/actions.php | |
| parent | 2feedf39f6484879333a7b77fdc3c184150db8c7 (diff) | |
| parent | 398572fd96c72b363fd5a252fb9cbe1cecab1e04 (diff) | |
| download | elgg-bb3c9a26bb75c76c5934d327548bf08606467b9f.tar.gz elgg-bb3c9a26bb75c76c5934d327548bf08606467b9f.tar.bz2 | |
Merge branch 'floxglove-3' into saravea
Conflicts:
.gitmodules
Diffstat (limited to 'engine/lib/actions.php')
| -rw-r--r-- | engine/lib/actions.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/engine/lib/actions.php b/engine/lib/actions.php index 53b185dea..f78ca63df 100644 --- a/engine/lib/actions.php +++ b/engine/lib/actions.php @@ -65,12 +65,11 @@ function action($action, $forwarder = "") { // @todo REMOVE THESE ONCE #1509 IS IN PLACE. // Allow users to disable plugins without a token in order to // remove plugins that are incompatible. - // Login and logout are for convenience. + // Logout for convenience. // file/download (see #2010) $exceptions = array( 'admin/plugins/disable', 'logout', - 'login', 'file/download', ); @@ -252,10 +251,20 @@ function validate_action_token($visibleerrors = TRUE, $token = NULL, $ts = NULL) register_error(elgg_echo('actiongatekeeper:pluginprevents')); } } else if ($visibleerrors) { - register_error(elgg_echo('actiongatekeeper:timeerror')); + // this is necessary because of #5133 + if (elgg_is_xhr()) { + register_error(elgg_echo('js:security:token_refresh_failed', array(elgg_get_site_url()))); + } else { + register_error(elgg_echo('actiongatekeeper:timeerror')); + } } } else if ($visibleerrors) { - register_error(elgg_echo('actiongatekeeper:tokeninvalid')); + // this is necessary because of #5133 + if (elgg_is_xhr()) { + register_error(elgg_echo('js:security:token_refresh_failed', array(elgg_get_site_url()))); + } else { + register_error(elgg_echo('actiongatekeeper:tokeninvalid')); + } } } else { if (! empty($_SERVER['CONTENT_LENGTH']) && empty($_POST)) { |
