summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9cfdba4)
raw | patch | inline | side by side (parent: 9cfdba4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Dec 2007 10:39:16 +0000 (10:39 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Dec 2007 10:39:16 +0000 (10:39 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8008 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_tabs.inc | patch | blob | history | |
include/functions.inc | patch | blob | history |
diff --git a/include/class_tabs.inc b/include/class_tabs.inc
index 7e9c593a109d8e3cd5dda6a78002df51bec14c87..c54739fb6c2b5d9c2f0e69c10479bac763001ac1 100644 (file)
--- a/include/class_tabs.inc
+++ b/include/class_tabs.inc
var $by_object= array();
var $SubDialog = false;
+ var $entryCSN = "";
+
function tabs(&$config, $data, $dn, $acl_category= "")
{
/* Save dn */
$baseobject= NULL;
+ $this->entryCSN = getEntryCSN($dn);
+
foreach ($data as &$tab){
$this->by_name[$tab['CLASS']]= $tab['NAME'];
function save_object($save_current= FALSE)
{
+ /* Update entry CSN if it is empty. */
+ if(empty($this->entryCSN)){
+ $this->entryCSN = getEntryCSN($this->dn);
+ }
+
/* Save last tab */
if ($this->last != ""){
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
$current_set = FALSE;
+ /* Check entryCSN */
+ $current_csn = getEntryCSN($this->dn);
+ if($current_csn != $this->entryCSN && !empty($this->entryCSN) && !empty($current_csn)){
+ $this->entryCSN = $current_csn;
+ $messages[] = _("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.");
+ }
+
/* Check all plugins */
foreach ($this->by_object as $key => &$obj){
if ($obj->is_account || $ignore_account || $obj->ignore_account){
$obj->pl_notify= FALSE;
}
}
+ $messages = array_unique($messages);
return ($messages);
}
function save($ignore_account= FALSE)
{
/* Save all plugins */
+ $this->entryCSN = "";
foreach ($this->by_object as $key => &$obj){
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,
$key, "Saving");
}
}
}
-
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/include/functions.inc b/include/functions.inc
index 2ed6b9be5a7aeca1884e73e7850e60294ced0f03..812715bf0976fc3b6562992c913f89e77a413124 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
+function getEntryCSN($dn)
+{
+ global $config;
+ if(empty($dn) || !is_object($config)){
+ return("");
+ }
+
+ /* Get attribute that we should use as serial number */
+ if(isset($config->current['UNIQ_IDENTIFIER'])){
+ $attr = $config->current['UNIQ_IDENTIFIER'];
+ }elseif(isset($config->data['MAIN']['UNIQ_IDENTIFIER'])){
+ $attr = $config->data['MAIN']['UNIQ_IDENTIFIER'];
+ }
+ if(!empty($attr)){
+ $ldap = $config->get_ldap_link();
+ $ldap->cat($dn,array($attr));
+ $csn = $ldap->fetch();
+ if(isset($csn[$attr][0])){
+ return($csn[$attr][0]);
+ }
+ }
+ return("");
+}
+
/* This function returns the offset for the default timezone.
* $stamp is used to detect summer or winter time.
* In case of PHP5, the integrated timezone functions are used.