Skip to content

Commit

Permalink
[#MODX-2407] Fixed issue where user settings were not respected in co…
Browse files Browse the repository at this point in the history
…nnectors in mgr
  • Loading branch information
Shaun McCormick committed Oct 8, 2010
1 parent 5d587f6 commit ccc81bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions connectors/index.php
Expand Up @@ -40,6 +40,7 @@
/* initialize the proper context */
$ctx = isset($_REQUEST['ctx']) && !empty($_REQUEST['ctx']) ? $_REQUEST['ctx'] : 'mgr';
$modx->initialize($ctx);
if ($ctx != 'mgr') $modx->getUser($ctx,true);
if (defined('MODX_REQP') && MODX_REQP === false) {
} else if (!$modx->context->checkPolicy('load')) { die(); }

Expand Down
1 change: 1 addition & 0 deletions core/docs/changelog.txt
Expand Up @@ -4,6 +4,7 @@ development release, and is only shown to give an idea of what's currently in th

MODx Revolution 2.0.4-pl
====================================
- [#MODX-2407] Fixed issue where user settings were not respected in connectors in mgr
- [#MODX-2279] Fix bad AJAX response if database does not exist or can't be created during setup
- [#MODX-2404] Fixed issue with auto_menuindex and multiple contexts
- [#MODX-2354] Fixed issue with image TV loading incorrect URL in thumbnail preview on initial load
Expand Down
7 changes: 5 additions & 2 deletions core/model/modx/modx.class.php
Expand Up @@ -874,9 +874,11 @@ public function sendUnauthorizedPage($options = null) {
* Get the current authenticated User and assigns it to the modX instance.
*
* @param string $contextKey An optional context to get the user from.
* @param boolean $forceLoadSettings If set to true, will load settings
* regardless of whether the user has an authenticated context or not.
* @return modUser The user object authenticated for the request.
*/
public function getUser($contextKey= '') {
public function getUser($contextKey= '',$forceLoadSettings = false) {
if ($contextKey == '') {
if ($this->context !== null) {
$contextKey= $this->context->get('key');
Expand All @@ -889,7 +891,7 @@ public function getUser($contextKey= '') {
}
}
if ($this->user !== null && is_object($this->user)) {
if ($this->user->hasSessionContext($contextKey)) {
if ($this->user->hasSessionContext($contextKey) || $forceLoadSettings) {
if (isset ($_SESSION["modx.{$contextKey}.user.config"])) {
$this->_userConfig= $_SESSION["modx.{$contextKey}.user.config"];
} else {
Expand Down Expand Up @@ -925,6 +927,7 @@ public function getUser($contextKey= '') {
)
);
}
ksort($this->config);
$this->toPlaceholders($this->user->get(array('id','username')),'modx.user');
return $this->user;
}
Expand Down

0 comments on commit ccc81bb

Please sign in to comment.