Skip to content

Commit

Permalink
Fixed #8868: AuditLog plugin : Can't create new user
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed Mar 18, 2014
1 parent 3a5ede3 commit 594e050
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions plugins/AuditLog/AuditLog.php
Expand Up @@ -106,25 +106,28 @@ public function beforeUserSave()
{
$oUserData=$this->getEvent()->get('model');
$oCurrentUser=$this->api->getCurrentUser();

$aNewValues=$oUserData->getAttributes();
if (!isset($oUserData->uid))
{
$sAction='create';
$aOldValues=array();
// Indicate the password has changed but assign fake hash
$aNewValues['password']=hash('md5','67890');
}
else
{
$oOldUser=$this->api->getUser($oUserData->uid);
$sAction='update';
$aOldValues=$oOldUser->getAttributes();

// If the password has changed then indicate that it has changed but assign fake hashes
if ($aNewValues['password']!=$aOldValues['password'])
{
$aOldValues['password']=hash('md5','12345');
$aNewValues['password']=hash('md5','67890');
};
}
$aNewValues=$oUserData->getAttributes();

// If the password has changed then indicate that it has changed but assign fake hashes
if ($aNewValues['password']!=$aOldValues['password'])
{
$aOldValues['password']=hash('md5','12345');
$aNewValues['password']=hash('md5','67890');
};

if (count(array_diff_assoc($aNewValues,$aOldValues)))
{
Expand Down

0 comments on commit 594e050

Please sign in to comment.