diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index f32e0f14017a8f934794dfe539e13cce178d5d63..e633565c3a69fe680dd66b8692144c1647cd4665 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -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.