From bc0505db1c00dbbeac3c49a09e1c25e3c226b25c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 2 Jan 2016 12:14:58 +0000 Subject: [PATCH] set attributes only if extension was added --- lam/lib/modules/freeRadius.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lam/lib/modules/freeRadius.inc b/lam/lib/modules/freeRadius.inc index 220ccd14..bd68af11 100644 --- a/lam/lib/modules/freeRadius.inc +++ b/lam/lib/modules/freeRadius.inc @@ -603,6 +603,26 @@ class freeRadius extends baseModule { return $return; } + /** + * Returns a list of modifications which have to be made to the LDAP account. + * + * @return array list of modifications + *
This function returns an array with 3 entries: + *
array( DN1 ('add' => array($attr), 'remove' => array($attr), 'modify' => array($attr)), DN2 .... ) + *
DN is the DN to change. It may be possible to change several DNs (e.g. create a new user and add him to some groups via attribute memberUid) + *
"add" are attributes which have to be added to LDAP entry + *
"remove" are attributes which have to be removed from LDAP entry + *
"modify" are attributes which have to been modified in LDAP entry + *
"info" are values with informational value (e.g. to be used later by pre/postModify actions) + */ + function save_attributes() { + if (!in_array('radiusprofile', $this->attributes['objectClass']) && !in_array('radiusprofile', $this->orig['objectClass'])) { + // skip saving if the extension was not added/modified + return array(); + } + return parent::save_attributes(); + } + /** * In this function the LDAP account is built up. *