From 2ae94931f52175f93e2471cbfe4f98ad8f84bc08 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 18 Nov 2007 10:35:56 +0000 Subject: [PATCH] added $autoAddObjectClasses --- lam/docs/devel/upgrade.htm | 63 ++++++++++++++++++++++++++++++++++++-- lam/lib/baseModule.inc | 24 +++++++++++---- 2 files changed, 78 insertions(+), 9 deletions(-) diff --git a/lam/docs/devel/upgrade.htm b/lam/docs/devel/upgrade.htm index b081999a..1d2fd428 100644 --- a/lam/docs/devel/upgrade.htm +++ b/lam/docs/devel/upgrade.htm @@ -1,40 +1,73 @@ -Upgrade nores + + Upgrade notes + + - - + + +

Upgrade notes

+

2.1.0 -> 2.2.0

+ Account lists now support to define tools. These are displayed as linked images like the edit and delete links in the list.
+ Overwrite lamList::getAdditionalTools() to use this feature.
+
+ The definition of account list options changed. The function lamList::getAdditionalTools() is no longer available. Use these functions instead: lamList::listGetAllConfigOptions() and lamList::listConfigurationChanged().
+ All options are now saved in cookies for one year.
+
+ +The baseModule class has a new protected option: $autoAddObjectClasses You can set it to false if you do not want that your module's object classes are added when creating or loading an account.
+ +
+

2.0.0 -> 2.1.0

+ Style changes:
+ + baseModule:
+   The class variable $base is no longer visible in child classes. Please use $this->getAccountContainer() to access the accountContainer object.
+
+ Several other class variables in accountContainer etc. are now private. Use the new access methods.
+
+
+

1.3.0 -> 2.0.0

+ LAM is now PHP5 only. Several variables are now private and need to be accessed via functions.
+
+
+

1.2.0 -> 1.3.0

+ New lamList function:
+ + No more lamdaemon commands via delete_attributes() and save_attributes() in account modules.
+ Please use these new functions to call lamdaemon directly:
+ +
+

1.1.x -> 1.2.0

+ API changes:
+ +
+

1.0.4 -> 1.1.0

+ API changes:
+ +
+

1.0.0 -> 1.0.2

+ New module functions:
+ + The LDAP attributes are no longer loaded by reading the LDAP schema. If your module does not implement the load_attributes() function then you have to use getManagedAttributes() or the meta data to specify them.
+
+ The class variable "triggered_messages" in baseModule was removed.
+ +
\ No newline at end of file diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index 57822b49..90739c59 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -62,6 +62,9 @@ abstract class baseModule { /** contains all error messages of a module */ protected $messages; + + /** if true, managed object classes are added when an account is created or loaded (default: true) */ + protected $autoAddObjectClasses; /** * Creates a new base module class @@ -72,6 +75,7 @@ abstract class baseModule { $this->scope = $scope; $this->load_Messages(); $this->meta = $this->get_metaData(); + $this->autoAddObjectClasses = true; // load configuration if (isset($_SESSION['config'])) $this->moduleSettings = $_SESSION['config']->get_moduleSettings(); if (isset($_SESSION['selfServiceProfile'])) $this->selfServiceSettings = $_SESSION['selfServiceProfile']->moduleSettings; @@ -95,9 +99,13 @@ abstract class baseModule { // add object classes if needed $this->attributes['objectClass'] = array(); $this->orig['objectClass'] = array(); - $objectClasses = $this->getManagedObjectClasses(); - for ($i = 0; $i < sizeof($objectClasses); $i++) { - if (!in_array($objectClasses[$i], $this->attributes['objectClass'])) $this->attributes['objectClass'][] = $objectClasses[$i]; + if ($this->autoAddObjectClasses === true) { + $objectClasses = $this->getManagedObjectClasses(); + for ($i = 0; $i < sizeof($objectClasses); $i++) { + if (!in_array($objectClasses[$i], $this->attributes['objectClass'])) { + $this->attributes['objectClass'][] = $objectClasses[$i]; + } + } } } @@ -120,9 +128,13 @@ abstract class baseModule { $this->orig['objectClass'] = array(); } // add object classes if needed - $objectClasses = $this->getManagedObjectClasses(); - for ($i = 0; $i < sizeof($objectClasses); $i++) { - if (!in_array($objectClasses[$i], $this->attributes['objectClass'])) $this->attributes['objectClass'][] = $objectClasses[$i]; + if ($this->autoAddObjectClasses === true) { + $objectClasses = $this->getManagedObjectClasses(); + for ($i = 0; $i < sizeof($objectClasses); $i++) { + if (!in_array($objectClasses[$i], $this->attributes['objectClass'])) { + $this->attributes['objectClass'][] = $objectClasses[$i]; + } + } } // load attributes $attributeNames = $this->getManagedAttributes();