Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
The numeric file mounts of a user were overridden by the real paths (…
Browse files Browse the repository at this point in the history
…see #5083)
  • Loading branch information
leofeyer committed Nov 30, 2012
1 parent 37fa3a3 commit 361e858
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
7 changes: 7 additions & 0 deletions system/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Contao Open Source CMS Changelog
================================

Version 3.0.2 (201X-XX-XX)
--------------------------

### Fixed
The numeric file mounts of a user were overridden by the real paths (see #5083).


Version 3.0.1 (2012-11-29)
--------------------------

Expand Down
15 changes: 13 additions & 2 deletions system/modules/core/classes/BackendUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@ public function isAllowed($int, $row)
}


/**
* Restore the original numeric file mounts (see #5083)
*/
public function save()
{
$filemounts = $this->filemounts;
$this->arrData['filemounts'] = $this->arrFilemountIds;
parent::save();
$this->filemounts = $filemounts;
}


/**
* Set all user properties from a database record
*/
Expand Down Expand Up @@ -342,8 +354,7 @@ protected function setUserFromDb()
{
$value = deserialize($objGroup->$field, true);

// The new page/file picker can return integers instead of arrays,
// so use empty() instead of is_array() and deserialize(true) here
// The new page/file picker can return integers instead of arrays, so use empty() instead of is_array() and deserialize(true) here
if (!empty($value))
{
$this->$field = array_merge((is_array($this->$field) ? $this->$field : (($this->$field != '') ? array($this->$field) : array())), $value);
Expand Down
5 changes: 2 additions & 3 deletions system/modules/core/classes/FrontendUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,12 @@ public function findBy($strColumn, $varValue)

/**
* Restore the original group membership
* @param boolean
*/
public function save($blnForceInsert=false)
public function save()
{
$groups = $this->groups;
$this->arrData['groups'] = $this->arrGroups;
parent::save($blnForceInsert);
parent::save();
$this->groups = $groups;
}

Expand Down
1 change: 0 additions & 1 deletion system/modules/core/widgets/FileSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ public function generate()
}
else
{

// Show a custom path (see #4926)
if ($GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['eval']['path'] != '')
{
Expand Down

0 comments on commit 361e858

Please sign in to comment.