diff --git a/lam/lib/modules/hostObject.inc b/lam/lib/modules/hostObject.inc index ad1bae79..e6cd87e1 100644 --- a/lam/lib/modules/hostObject.inc +++ b/lam/lib/modules/hostObject.inc @@ -45,6 +45,15 @@ class hostObject extends baseModule { $this->autoAddObjectClasses = false; } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -56,8 +65,6 @@ class hostObject extends baseModule { $return = array(); // icon $return['icon'] = 'computer.png'; - // manages host accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _("Hosts"); // module dependencies diff --git a/lam/lib/modules/ieee802device.inc b/lam/lib/modules/ieee802device.inc index c14c4008..3c6c78e0 100644 --- a/lam/lib/modules/ieee802device.inc +++ b/lam/lib/modules/ieee802device.inc @@ -3,7 +3,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2004 - 2013 Roland Gruber + Copyright (C) 2004 - 2014 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,15 @@ $Id$ */ class ieee802device extends baseModule { + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('host')); + } + /** * Returns meta data that is interpreted by parent class * @@ -45,8 +54,6 @@ class ieee802device extends baseModule { $return = array(); // icon $return['icon'] = 'network-wired.png'; - // manages host accounts - $return["account_types"] = array("host"); // alias name $return["alias"] = _("MAC address"); // module dependencies diff --git a/lam/lib/modules/imapAccess.inc b/lam/lib/modules/imapAccess.inc index 1f58fef5..afdfc5d3 100644 --- a/lam/lib/modules/imapAccess.inc +++ b/lam/lib/modules/imapAccess.inc @@ -41,6 +41,15 @@ class imapAccess extends baseModule { /** quota limit from profile */ private $profileQuotaLimit = null; + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -50,8 +59,6 @@ class imapAccess extends baseModule { */ function get_metaData() { $return = array(); - // manages user accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _("Mailbox"); // module dependencies diff --git a/lam/lib/modules/inetLocalMailRecipient.inc b/lam/lib/modules/inetLocalMailRecipient.inc index e82e3c49..6a9f1af3 100644 --- a/lam/lib/modules/inetLocalMailRecipient.inc +++ b/lam/lib/modules/inetLocalMailRecipient.inc @@ -34,6 +34,15 @@ $Id$ */ class inetLocalMailRecipient extends baseModule { + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -45,8 +54,6 @@ class inetLocalMailRecipient extends baseModule { $return = array(); // icon $return['icon'] = 'mailBig.png'; - // manages host accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _("Mail routing"); // module dependencies diff --git a/lam/lib/modules/inetOrgPerson.inc b/lam/lib/modules/inetOrgPerson.inc index 87ce13d9..b5e37a2d 100644 --- a/lam/lib/modules/inetOrgPerson.inc +++ b/lam/lib/modules/inetOrgPerson.inc @@ -106,6 +106,15 @@ class inetOrgPerson extends baseModule implements passwordService { $this->messages['sendPasswordMail'][0] = array('ERROR', _('Account %s:') . ' inetOrgPerson_sendPasswordMail', _('This value can only be "true" or "false".')); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -117,8 +126,6 @@ class inetOrgPerson extends baseModule implements passwordService { $return = array(); // icon $return['icon'] = 'uid.png'; - // manages user accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _('Personal'); // this is a base module diff --git a/lam/lib/modules/kolabGroup.inc b/lam/lib/modules/kolabGroup.inc index e759a8ce..957e15da 100644 --- a/lam/lib/modules/kolabGroup.inc +++ b/lam/lib/modules/kolabGroup.inc @@ -50,6 +50,15 @@ class kolabGroup extends baseModule { $this->autoAddObjectClasses = false; } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('group')); + } + /** * Returns meta data that is interpreted by parent class * @@ -61,8 +70,6 @@ class kolabGroup extends baseModule { $return = array(); // icon $return['icon'] = 'kolab.png'; - // manages host accounts - $return["account_types"] = array('group'); // alias name $return["alias"] = _("Kolab"); // module dependencies diff --git a/lam/lib/modules/kolabSharedFolder.inc b/lam/lib/modules/kolabSharedFolder.inc index 8a377648..8d769fea 100644 --- a/lam/lib/modules/kolabSharedFolder.inc +++ b/lam/lib/modules/kolabSharedFolder.inc @@ -58,6 +58,15 @@ class kolabSharedFolder extends baseModule { // TODO folder type ); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('kolabSharedFolderType')); + } + /** * Returns meta data that is interpreted by parent class * @@ -69,8 +78,6 @@ class kolabSharedFolder extends baseModule { // TODO folder type $return = array(); // icon $return['icon'] = 'kolab.png'; - // manages host accounts - $return["account_types"] = array('kolabSharedFolderType'); // alias name $return["alias"] = _("Kolab shared folder"); // this is a base module diff --git a/lam/lib/modules/kolabUser.inc b/lam/lib/modules/kolabUser.inc index 31937374..81bfa112 100644 --- a/lam/lib/modules/kolabUser.inc +++ b/lam/lib/modules/kolabUser.inc @@ -56,6 +56,15 @@ class kolabUser extends baseModule { $this->autoAddObjectClasses = false; } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -67,8 +76,6 @@ class kolabUser extends baseModule { $return = array(); // icon $return['icon'] = 'kolab.png'; - // manages host accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _("Kolab"); // module dependencies diff --git a/lam/lib/modules/ldapPublicKey.inc b/lam/lib/modules/ldapPublicKey.inc index 6ac7116a..f03efc50 100644 --- a/lam/lib/modules/ldapPublicKey.inc +++ b/lam/lib/modules/ldapPublicKey.inc @@ -38,6 +38,15 @@ class ldapPublicKey extends baseModule { /** session variable for existing keys in self service */ const SESS_KEY_LIST = 'ldapPublicKey_keyList'; + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -49,8 +58,6 @@ class ldapPublicKey extends baseModule { $return = array(); // icon $return['icon'] = 'keyBig.png'; - // manages host accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _("SSH public key"); // module dependencies diff --git a/lam/lib/modules/nisMailAlias.inc b/lam/lib/modules/nisMailAlias.inc index c565e037..a1c53719 100644 --- a/lam/lib/modules/nisMailAlias.inc +++ b/lam/lib/modules/nisMailAlias.inc @@ -41,6 +41,15 @@ class nisMailAlias extends baseModule { /** display limit */ const DISPLAY_LIMIT = 50; + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('mailAlias')); + } + /** * Returns meta data that is interpreted by parent class * @@ -52,8 +61,6 @@ class nisMailAlias extends baseModule { $return = array(); // icon $return['icon'] = 'mailBig.png'; - // manages host accounts - $return["account_types"] = array("mailAlias"); // base module $return["is_base"] = true; // LDAP filter diff --git a/lam/lib/modules/nisMailAliasUser.inc b/lam/lib/modules/nisMailAliasUser.inc index 41aaf459..f00d5ccf 100644 --- a/lam/lib/modules/nisMailAliasUser.inc +++ b/lam/lib/modules/nisMailAliasUser.inc @@ -46,6 +46,15 @@ class nisMailAliasUser extends baseModule { /** alias entries to extend with new recipients (list of arrays: dn => recipients) */ private $recipientsToAdd = array(); + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -57,8 +66,6 @@ class nisMailAliasUser extends baseModule { $return = array(); // icon $return['icon'] = 'mailBig.png'; - // manages host accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _("Mail aliases"); // module dependencies diff --git a/lam/lib/modules/nisnetgroup.inc b/lam/lib/modules/nisnetgroup.inc index 66933853..fad48136 100644 --- a/lam/lib/modules/nisnetgroup.inc +++ b/lam/lib/modules/nisnetgroup.inc @@ -43,6 +43,15 @@ class nisnetgroup extends baseModule { /** group cache */ private $cachedGroupList = null; + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('netgroup')); + } + /** * Returns meta data that is interpreted by parent class * @@ -54,8 +63,6 @@ class nisnetgroup extends baseModule { $return = array(); // icon $return['icon'] = 'groupBig.png'; - // manages netgroup accounts - $return["account_types"] = array('netgroup'); // alias name $return["alias"] = _("NIS net group"); // this is a base module diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 24b1ff9a..ebdf7a6f 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -131,6 +131,15 @@ class posixAccount extends baseModule implements passwordService { $this->messages['sambaIDPoolDN'][0] = array('ERROR', _('Samba ID pool DN'), _('This is not a valid DN!')); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user', 'host')); + } + /** * Returns meta data that is interpreted by parent class * @@ -142,8 +151,6 @@ class posixAccount extends baseModule implements passwordService { $return = array(); // icon $return['icon'] = 'tux.png'; - // manages user and host accounts - $return["account_types"] = array("user", "host"); // user specific data if ($this->get_scope() == "user") { // LDAP filter diff --git a/lam/lib/modules/posixGroup.inc b/lam/lib/modules/posixGroup.inc index 45250088..500cb622 100644 --- a/lam/lib/modules/posixGroup.inc +++ b/lam/lib/modules/posixGroup.inc @@ -345,6 +345,15 @@ class posixGroup extends baseModule implements passwordService { return $return; } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('group')); + } + /** * Returns meta data that is interpreted by parent class * @@ -354,8 +363,6 @@ class posixGroup extends baseModule implements passwordService { $return = array(); // icon $return['icon'] = 'tux.png'; - // manages group accounts - $return["account_types"] = array("group"); if ($this->get_scope() == "group") { // this is a base module $return["is_base"] = true; diff --git a/lam/lib/modules/puppetClient.inc b/lam/lib/modules/puppetClient.inc index f9eae09e..50a49315 100644 --- a/lam/lib/modules/puppetClient.inc +++ b/lam/lib/modules/puppetClient.inc @@ -3,7 +3,7 @@ $Id$ This code is not yet part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2012 - 2013 Roland Gruber + Copyright (C) 2012 - 2014 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,7 +48,16 @@ class puppetClient extends baseModule { } - /** + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('host')); + } + + /** * Returns meta data that is interpreted by parent class * * @return array array with meta data @@ -57,8 +66,6 @@ class puppetClient extends baseModule { $return = array(); // icon $return['icon'] = 'puppet.png'; - // manages user accounts - $return["account_types"] = array("host"); // alias name $return["alias"] = _("Puppet"); // module dependencies diff --git a/lam/lib/modules/pykotaBillingCode.inc b/lam/lib/modules/pykotaBillingCode.inc index b2ea5b93..18735f8c 100644 --- a/lam/lib/modules/pykotaBillingCode.inc +++ b/lam/lib/modules/pykotaBillingCode.inc @@ -37,6 +37,15 @@ class pykotaBillingCode extends baseModule { /** cache for existing codes (array(dn1 => pykotaBillingCode1, dn2 => pykotaBillingCode2)) */ private $codeCache = null; + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('pykotaBillingCodeType')); + } + /** * Returns meta data that is interpreted by parent class * @@ -48,8 +57,6 @@ class pykotaBillingCode extends baseModule { $return = array(); // icon $return['icon'] = 'printerBig.png'; - // manages host accounts - $return["account_types"] = array('pykotaBillingCodeType'); // alias name $return["alias"] = _("PyKota"); // this is a base module diff --git a/lam/lib/modules/pykotaGroup.inc b/lam/lib/modules/pykotaGroup.inc index 458201b4..5ccc5577 100644 --- a/lam/lib/modules/pykotaGroup.inc +++ b/lam/lib/modules/pykotaGroup.inc @@ -69,6 +69,15 @@ class pykotaGroup extends baseModule { $this->autoAddObjectClasses = $this->isStructural(); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('group')); + } + /** * Returns meta data that is interpreted by parent class * @@ -80,8 +89,6 @@ class pykotaGroup extends baseModule { $return = array(); // icon $return['icon'] = 'printerBig.png'; - // manages host accounts - $return["account_types"] = array('group'); // alias name $return["alias"] = _("PyKota"); // this is a base module diff --git a/lam/lib/modules/pykotaPrinter.inc b/lam/lib/modules/pykotaPrinter.inc index 61e9821d..f150834e 100644 --- a/lam/lib/modules/pykotaPrinter.inc +++ b/lam/lib/modules/pykotaPrinter.inc @@ -55,6 +55,15 @@ class pykotaPrinter extends baseModule { parent::__construct($scope); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('pykotaPrinterType')); + } + /** * Returns meta data that is interpreted by parent class * @@ -66,8 +75,6 @@ class pykotaPrinter extends baseModule { $return = array(); // icon $return['icon'] = 'printerBig.png'; - // manages host accounts - $return["account_types"] = array('pykotaPrinterType'); // alias name $return["alias"] = _("PyKota"); // this is a base module diff --git a/lam/lib/modules/pykotaUser.inc b/lam/lib/modules/pykotaUser.inc index 48476b9e..fb183c93 100644 --- a/lam/lib/modules/pykotaUser.inc +++ b/lam/lib/modules/pykotaUser.inc @@ -69,6 +69,15 @@ class pykotaUser extends baseModule { $this->autoAddObjectClasses = $this->isStructural(); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -80,8 +89,6 @@ class pykotaUser extends baseModule { $return = array(); // icon $return['icon'] = 'printerBig.png'; - // manages host accounts - $return["account_types"] = array('user'); // alias name $return["alias"] = _("PyKota"); // this is a base module diff --git a/lam/lib/modules/quota.inc b/lam/lib/modules/quota.inc index eaf13ba2..b68a5aa6 100644 --- a/lam/lib/modules/quota.inc +++ b/lam/lib/modules/quota.inc @@ -63,6 +63,15 @@ class quota extends baseModule { $this->messages['upload'][0] = array('ERROR', _('Account %s:') . ' %s', _('Quota has wrong format!')); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user', 'group')); + } + /** * Returns meta data that is interpreted by parent class * @@ -74,8 +83,6 @@ class quota extends baseModule { $return = array(); // icon $return['icon'] = 'hard-driveBig.png'; - // manages user and group accounts - $return["account_types"] = array("user", "group"); // alias name $return["alias"] = _('Quota'); if ($this->get_scope() == 'group') { diff --git a/lam/lib/modules/range.inc b/lam/lib/modules/range.inc index 613e6d4a..e74da9b0 100644 --- a/lam/lib/modules/range.inc +++ b/lam/lib/modules/range.inc @@ -52,6 +52,15 @@ class range extends baseModule { /** For check, if IPs overlaped. */ public $overlaped; + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('dhcp')); + } + /** * Returns meta data that is interpreted by parent class * @@ -61,8 +70,6 @@ class range extends baseModule { */ public function get_metaData() { $return = array(); - // manages dhcp accounts - $return["account_types"] = array("dhcp"); // alias name $return["alias"] = _("Ranges"); // this is a base module diff --git a/lam/lib/modules/sambaDomain.inc b/lam/lib/modules/sambaDomain.inc index c2fb0d52..3e4a2700 100644 --- a/lam/lib/modules/sambaDomain.inc +++ b/lam/lib/modules/sambaDomain.inc @@ -34,6 +34,15 @@ $Id$ */ class sambaDomain extends baseModule { + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('smbDomain')); + } + /** * Returns meta data that is interpreted by parent class * @@ -45,8 +54,6 @@ class sambaDomain extends baseModule { $return = array(); // icon $return['icon'] = 'samba.png'; - // manages host accounts - $return["account_types"] = array("smbDomain"); // alias name $return["alias"] = _("Samba domain"); // this is a base module diff --git a/lam/lib/modules/sambaGroupMapping.inc b/lam/lib/modules/sambaGroupMapping.inc index 4fc5628f..710d2117 100644 --- a/lam/lib/modules/sambaGroupMapping.inc +++ b/lam/lib/modules/sambaGroupMapping.inc @@ -4,7 +4,7 @@ $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) Copyright (C) 2003 - 2006 Tilo Lutz - 2007 - 2013 Roland Gruber + 2007 - 2014 Roland Gruber This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -77,6 +77,15 @@ class sambaGroupMapping extends baseModule { $this->autoAddObjectClasses = false; } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('group')); + } + /** * Returns meta data that is interpreted by parent class * @@ -88,8 +97,6 @@ class sambaGroupMapping extends baseModule { $return = array(); // icon $return['icon'] = 'samba.png'; - // manages group accounts - $return["account_types"] = array("group"); // alias name $return["alias"] = _('Samba 3'); // module dependencies diff --git a/lam/lib/modules/sambaSamAccount.inc b/lam/lib/modules/sambaSamAccount.inc index c605a463..96c7c71d 100644 --- a/lam/lib/modules/sambaSamAccount.inc +++ b/lam/lib/modules/sambaSamAccount.inc @@ -122,6 +122,15 @@ class sambaSamAccount extends baseModule implements passwordService { $this->messages['profileCanMustChange'][0] = array('ERROR', _('The value for the Samba 3 field "User can/must change password" needs to be a number.')); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user', 'host')); + } + /** * Returns meta data that is interpreted by parent class * @@ -133,8 +142,6 @@ class sambaSamAccount extends baseModule implements passwordService { $return = array(); // icon $return['icon'] = 'samba.png'; - // manages user and host accounts - $return["account_types"] = array("user", "host"); // alias name $return["alias"] = _('Samba 3'); // RDN attribute diff --git a/lam/lib/modules/shadowAccount.inc b/lam/lib/modules/shadowAccount.inc index 9a13e4f9..ea82db13 100644 --- a/lam/lib/modules/shadowAccount.inc +++ b/lam/lib/modules/shadowAccount.inc @@ -67,6 +67,15 @@ class shadowAccount extends baseModule implements passwordService { $this->messages['shadow_expireDate'][0] = array('ERROR', _('Account %s:') . ' shadowAccount_expireDate', _('The expiration date is invalid.')); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -78,8 +87,6 @@ class shadowAccount extends baseModule implements passwordService { $return = array(); // icon $return['icon'] = 'keyBig.png'; - // manages user accounts - $return["account_types"] = array("user"); // alias name $return["alias"] = _('Shadow'); // module dependencies diff --git a/lam/lib/modules/systemQuotas.inc b/lam/lib/modules/systemQuotas.inc index 90ad5fd1..5c5bd7e9 100644 --- a/lam/lib/modules/systemQuotas.inc +++ b/lam/lib/modules/systemQuotas.inc @@ -34,6 +34,15 @@ $Id$ */ class systemQuotas extends baseModule { + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -45,8 +54,6 @@ class systemQuotas extends baseModule { $return = array(); // icon $return['icon'] = 'hard-driveBig.png'; - // manages host accounts - $return["account_types"] = array('user'); // alias name $return["alias"] = _("Quota"); // module dependencies diff --git a/lam/lib/modules/windowsGroup.inc b/lam/lib/modules/windowsGroup.inc index c1ec7236..3bd2243e 100644 --- a/lam/lib/modules/windowsGroup.inc +++ b/lam/lib/modules/windowsGroup.inc @@ -69,6 +69,15 @@ class windowsGroup extends baseModule { parent::__construct($scope); } + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('group')); + } + /** * Returns meta data that is interpreted by parent class * @@ -80,8 +89,6 @@ class windowsGroup extends baseModule { $return = array(); // icon $return['icon'] = 'samba.png'; - // manages host accounts - $return["account_types"] = array('group'); // this is a base module $return["is_base"] = true; // RDN attribute diff --git a/lam/lib/modules/windowsHost.inc b/lam/lib/modules/windowsHost.inc index 53cc4e35..28e32fdd 100644 --- a/lam/lib/modules/windowsHost.inc +++ b/lam/lib/modules/windowsHost.inc @@ -34,6 +34,15 @@ $Id$ */ class windowsHost extends baseModule { + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('host')); + } + /** * Returns meta data that is interpreted by parent class * @@ -45,8 +54,6 @@ class windowsHost extends baseModule { $return = array(); // icon $return['icon'] = 'samba.png'; - // manages host accounts - $return["account_types"] = array('host'); // this is a base module $return["is_base"] = true; // RDN attribute diff --git a/lam/lib/modules/windowsUser.inc b/lam/lib/modules/windowsUser.inc index 3ad8870e..b69a6255 100644 --- a/lam/lib/modules/windowsUser.inc +++ b/lam/lib/modules/windowsUser.inc @@ -57,6 +57,15 @@ class windowsUser extends baseModule implements passwordService { private $clearTextPassword; + /** + * Returns true if this module can manage accounts of the current type, otherwise false. + * + * @return boolean true if module fits + */ + public function can_manage() { + return in_array($this->get_scope(), array('user')); + } + /** * Returns meta data that is interpreted by parent class * @@ -68,8 +77,6 @@ class windowsUser extends baseModule implements passwordService { $return = array(); // icon $return['icon'] = 'samba.png'; - // manages user accounts - $return["account_types"] = array('user'); // this is a base module $return["is_base"] = true; // PHP extensions