From 162a76a7e05314b9340b74c0cd8c70bc9d5d47fa Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Tue, 24 Nov 2009 12:09:29 +0000 Subject: [PATCH] do not save attributes if extension is not yet added --- lam/lib/modules/asteriskAccount.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lam/lib/modules/asteriskAccount.inc b/lam/lib/modules/asteriskAccount.inc index e9aa341a..4964b194 100644 --- a/lam/lib/modules/asteriskAccount.inc +++ b/lam/lib/modules/asteriskAccount.inc @@ -244,6 +244,24 @@ class asteriskAccount extends baseModule implements passwordService { return $errors; } + /** + * 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 + */ + function save_attributes() { + if (!in_array('AsteriskSIPUser', $this->attributes['objectClass'])) { + return array(); + } + return $this->getAccountContainer()->save_module_attributes($this->attributes, $this->orig); + } + /** * Returns a list of PDF entries */