Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions administrator/components/com_users/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ protected function allowEdit($data = array(), $key = 'id')
return parent::allowEdit($data, $key);
}

/**
* Override parent cancel to redirect when using status edit account.
*
* @param string $key The name of the primary key of the URL variable.
*
* @return boolean True if access level checks pass, false otherwise.
*
* @since __DEPLOY_VERSION__
*/
public function cancel($key = null)
{
$result = parent::cancel();

if ($return = $this->input->get('return', '', 'BASE64'))
{
$this->app->redirect(base64_decode($return));
}

return $result;
}

/**
* Method to run batch operations.
*
Expand Down
4 changes: 4 additions & 0 deletions administrator/components/com_users/tmpl/user/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
Expand All @@ -18,6 +19,8 @@
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('script', 'com_users/admin-users-user.min.js', array('version' => 'auto', 'relative' => true));

$input = Factory::getApplication()->input;

// Get the form fieldsets.
$fieldsets = $this->form->getFieldsets();
$settings = array();
Expand Down Expand Up @@ -105,5 +108,6 @@
</fieldset>

<input type="hidden" name="task" value="">
<input type="hidden" name="return" value="<?php echo $input->getCmd('return'); ?>">
<?php echo HTMLHelper::_('form.token'); ?>
</form>
3 changes: 2 additions & 1 deletion administrator/modules/mod_status/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@
<span class="fa fa-user-o" aria-hidden="true"></span>
<?php echo $user->name; ?>
</div>
<?php $route = 'index.php?option=com_users&amp;task=user.edit&amp;id=' . $user->id; ?>
<?php $uri = Uri::getInstance(); ?>
<?php $route = 'index.php?option=com_users&task=user.edit&id=' . $user->id . '&return=' . base64_encode($uri); ?>
<a class="dropdown-item" href="<?php echo Route::_($route); ?>">
<?php echo Text::_('MOD_STATUS_EDIT_ACCOUNT'); ?></a>
<a class="dropdown-item" href="<?php echo Route::_('index.php?option=com_login&task=logout&'
Expand Down