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

Commit

Permalink
Consider the save_callback of the password field in tl_user when …
Browse files Browse the repository at this point in the history
…a back end user is forced to change his password (see #5138)
  • Loading branch information
leofeyer committed Jan 28, 2013
1 parent 06b0f24 commit c680e7f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Contao Open Source CMS Changelog
Version 2.11.9 (2013-XX-XX)
---------------------------

### Fixed
Consider the `save_callback` of the password field in `tl_user` when a back end
user is forced to change his password (see #5138).

### Fixed
Do not group standalone lightbox elements on HTML5 pages (see #3742).

Expand Down
12 changes: 12 additions & 0 deletions contao/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ public function run()
}
else
{
$this->loadDataContainer('tl_user');

// Trigger the save_callback
if (is_array($GLOBALS['TL_DCA']['tl_user']['fields']['password']['save_callback']))
{
foreach ($GLOBALS['TL_DCA']['tl_user']['fields']['password']['save_callback'] as $callback)
{
$this->import($callback[0]);
$pw = $this->$callback[0]->$callback[1]($pw);
}
}

$strSalt = substr(md5(uniqid(mt_rand(), true)), 0, 23);
$strPassword = sha1($strSalt . $pw);

Expand Down

0 comments on commit c680e7f

Please sign in to comment.