From: hickert Date: Wed, 5 Dec 2007 08:55:39 +0000 (+0000) Subject: Added Entry CSN check X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9d40fba87d9378d80a9343a2299c3ea3824cc6ba;p=gosa.git Added Entry CSN check - Not testet yet. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8005 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_plugin.inc b/include/class_plugin.inc index b71e576ca..528de883f 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -118,6 +118,8 @@ class plugin /* This can be set to render the tabulators in another stylesheet */ var $pl_notify= FALSE; + /* The entries CSN value, if available */ + var $entryCSN = ""; /* This variable indicates that this class can handle multiple dns at once. */ var $multiple_support = FALSE; @@ -151,6 +153,13 @@ class plugin $ldap= $this->config->get_ldap_link(); if ($dn !== NULL){ + /* Try to get entry CSN for save checks later */ + $ldap->cat($dn,array("entryCSN")); + $csn = $ldap->fetch(); + if(isset($csn['entryCSN'][0])){ + $this->entryCSN = $csn['entryCSN'][0]; + } + /* Load data to 'attrs' and save 'dn' */ if ($parent !== NULL){ $this->attrs= $parent->attrs; @@ -477,6 +486,15 @@ class plugin } + /* Check if entry CSN has changed */ + $ldap = $this->config->get_ldap_link(); + $ldap->cat($this->dn,array("entryCSN")); + $csn = $ldap->fetch(); + if(isset($csn['entryCSN'][0]) && !empty($this->entryCSN) && $this->entryCSN != $csn['entryCSN'][0]){ + $this->entryCSN = $csn['entryCSN'][0]; + $message[] = _("The object has changed since opened in GOsa. Please ensure that nobody has done serious changes that may get lost if you save this entry."); + } + return ($message); }