Verified Commit 8db3eea0 authored by dockx thibault's avatar dockx thibault
Browse files

:ambulance: Fix(Snapshots) - issues resolved when creating from template

Resolves issue when applying and creating from template.
Showing with 7 additions and 12 deletions
+7 -12
......@@ -273,14 +273,15 @@ class user extends simplePlugin
$filename = './plugins/users/images/default.jpg';
$fd = fopen($filename, 'rb');
$this->attributesAccess['jpegPhoto']->setPlaceholder(fread($fd, filesize($filename)));
$this->was_locked = $this->attributesAccess['userPassword']->isLocked();
// Verification is snapshot is enabled and automatic.
// Note : string values are stored in that array.
if (isset($config->current['ENABLEAUTOMATICSNAPSHOTS']) && isset($config->current['ENABLESNAPSHOTS'])) {
if (strtolower($config->current['ENABLEAUTOMATICSNAPSHOTS']) === 'true' && strtolower($config->current['ENABLESNAPSHOTS']) === 'true') {
$this->generateAutomaticSnapshot();
// Do not apply automatic snap on templates nor if the DN is not yet processed (new creation from template)
if ($this->is_template !== TRUE && $this->dn !== 'new') {
// Verification is snapshot is enabled and automatic.
if (isset($config->current['ENABLEAUTOMATICSNAPSHOTS']) && isset($config->current['ENABLESNAPSHOTS'])) {
if (strtolower($config->current['ENABLEAUTOMATICSNAPSHOTS']) === 'true' && strtolower($config->current['ENABLESNAPSHOTS']) === 'true') {
$this->generateAutomaticSnapshot();
}
}
}
}
......@@ -395,12 +396,6 @@ class user extends simplePlugin
return parent::post_save();
}
// public function verifyLastSnapshotMD5 () : BOOL
// {
//
// }
/**
* @return void
* Note : Create a snapshot of current data before save, verifying if data have changed before taking a snap.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment