diff --git a/include/class_CopyPasteHandler.inc b/include/class_CopyPasteHandler.inc index fb0fb71c450d147f5e7c77b96d3a66f0a8cb7351..914e88f68e9d8b45aea043e24815430b1fd7e620 100644 --- a/include/class_CopyPasteHandler.inc +++ b/include/class_CopyPasteHandler.inc @@ -167,18 +167,7 @@ class CopyPasteHandler return array(); } - if (isset($entry['type'])) { - $entry['object'] = objects::open($entry['dn'], $entry['type']); - } else { - trigger_error('Call to deprecated tabs constructor'); - // old way - $tab_c = $entry['tab_class']; - $tab_o = $entry['tab_object']; - $tab_a = $entry['tab_acl_category']; - - // Deprecated - $entry['object'] = new $tab_c(NULL, $config->data['TABS'][$tab_o], $entry['dn'], $tab_a); - } + $entry['object'] = objects::open($entry['dn'], $entry['type']); $entry['object']->set_acl_base($base); if ($entry['parent'] !== NULL) { diff --git a/include/class_SnapshotDialogs.inc b/include/class_SnapshotDialogs.inc index 47e142f742a06ac9184226e0fa5fa9325ceb863f..d21a770a378d1bbf04e2460cee4453ebb6a7534b 100644 --- a/include/class_SnapshotDialogs.inc +++ b/include/class_SnapshotDialogs.inc @@ -46,7 +46,7 @@ class SnapshotCreateDialog extends simplePlugin ); } - function __construct ($unused, $dn, $parent, $aclCategory) + function __construct ($dn, $parent, $aclCategory) { parent::__construct(); $this->attributesAccess['description']->setInLdap(FALSE); @@ -191,7 +191,7 @@ class SnapshotRestoreDialog extends simplePlugin ); } - function __construct ($unused, $dn, $parent, $global, $aclCategory) + function __construct ($dn, $parent, $global, $aclCategory) { parent::__construct(); $this->object_dn = $dn; diff --git a/include/class_management.inc b/include/class_management.inc index 7d10d0766a68d9053cc69e2d6c2359da08c009c0..db34df9105bf5196cbd5775346e213050884bcd4 100644 --- a/include/class_management.inc +++ b/include/class_management.inc @@ -483,7 +483,7 @@ class management } $aclCategory = $this->aclCategory; if ($this->ui->allow_snapshot_create($this->dn, $aclCategory)) { - $this->dialogObject = new SnapshotCreateDialog(NULL, $this->dn, $this, $aclCategory); + $this->dialogObject = new SnapshotCreateDialog($this->dn, $this, $aclCategory); $this->dialogObject->set_acl_base($this->dn); } else { msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to create a snapshot for %s.'), $this->dn), @@ -566,7 +566,7 @@ class management if ($this->ui->allow_snapshot_restore($this->dn, $aclCategory)) { @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'Snaptshot restoring initiated!'); $this->snapHandler->setSnapshotBases($bases); - $this->dialogObject = new SnapshotRestoreDialog(NULL, $this->dn, $this, !count($target), $aclCategory); + $this->dialogObject = new SnapshotRestoreDialog($this->dn, $this, !count($target), $aclCategory); $this->dialogObject->set_acl_base($this->dn); } else { msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to restore a snapshot for %s.'), $this->dn), diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 91e874634f8f27a0b39066334361ab6aec0c2c8b..d782eacfe4d86ee452452160e3eabc44327020ad 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -35,7 +35,7 @@ class plugin * * \sa tab */ - var $parent = NULL; + public $parent = NULL; /*! \brief Mark plugin as account @@ -116,10 +116,10 @@ class plugin * * \sa plugin() */ - function __construct ($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL) { global $config; - /* Configuration is fine, allways */ + $this->dn = $dn; // Ensure that we've a valid acl_category set. diff --git a/include/password-methods/class_password-methods.inc b/include/password-methods/class_password-methods.inc index 1531a89be75c089ad8b682ad64f67fa3b42887ff..fc3e484b2cff93e6cb6d92f7d5489d4d22ce797e 100644 --- a/include/password-methods/class_password-methods.inc +++ b/include/password-methods/class_password-methods.inc @@ -173,7 +173,7 @@ class passwordMethod lock_ssh_account($mode, $attrs, $modify); // (Un)lock the account by modifying the password hash. - $pwdClass = new user(NULL, $dn); + $pwdClass = new user($dn); $pwdClass->callHook('PRE'.$mode, array(), $ret); if ($mode == 'LOCK') { diff --git a/include/simpleplugin/class_multiPlugin.inc b/include/simpleplugin/class_multiPlugin.inc index db93dbd18369fef2fa43b1b8291cf9de2d6c446c..d33427545eb72b415811e87a47cc4ff24ee59824 100644 --- a/include/simpleplugin/class_multiPlugin.inc +++ b/include/simpleplugin/class_multiPlugin.inc @@ -37,10 +37,10 @@ class multiPlugin extends simplePlugin return array(); } - function __construct ($unused = NULL, $dn = NULL, $parent = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL) { global $config; - parent::__construct($unused, $dn, $parent); + parent::__construct($dn, $object, $parent, FALSE); $plInfos = pluglist::pluginInfos(get_class($this)); @@ -50,7 +50,7 @@ class multiPlugin extends simplePlugin continue; } $name = $plug['CLASS']; - $this->plugin[$name] = new $name($unused, $dn, $parent); + $this->plugin[$name] = new $name($dn, $object, $parent); /* Acl base && category configuration, these settings will be overloaded in main.inc, @@ -80,11 +80,6 @@ class multiPlugin extends simplePlugin $display .= back_to_main(); return $display; } - } else { - foreach ($this->plugin as &$plug) { - $plug->parent = $this->parent; - } - unset($plug); } /* Execude objects */ diff --git a/include/simpleplugin/class_simpleManagement.inc b/include/simpleplugin/class_simpleManagement.inc index 8bae7079049f9b002dfe6d1c3e1cd059c04d35b0..630a3ce94b1d6f8d2737ac31d29fb8d7171026a5 100644 --- a/include/simpleplugin/class_simpleManagement.inc +++ b/include/simpleplugin/class_simpleManagement.inc @@ -745,7 +745,7 @@ class simpleManagement extends management } $aclCategory = $config->data['OBJECTS'][$this->getType($this->dn)]['aclCategory']; if ($this->ui->allow_snapshot_create($this->dn, $aclCategory)) { - $this->dialogObject = new SnapshotCreateDialog(NULL, $this->dn, $this, $aclCategory); + $this->dialogObject = new SnapshotCreateDialog($this->dn, $this, $aclCategory); $this->dialogObject->set_acl_base($this->dn); } else { msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to create a snapshot for %s.'), $this->dn), @@ -796,7 +796,7 @@ class simpleManagement extends management if ($this->ui->allow_snapshot_restore($this->dn, $aclCategory)) { @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'Snaptshot restoring initiated!'); $this->snapHandler->setSnapshotBases($bases); - $this->dialogObject = new SnapshotRestoreDialog(NULL, $this->dn, $this, !count($target), $aclCategory); + $this->dialogObject = new SnapshotRestoreDialog($this->dn, $this, !count($target), $aclCategory); $this->dialogObject->set_acl_base($this->dn); } else { msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to restore a snapshot for %s.'), $this->dn), diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index 02f6f0c2e97918f85e5a2a5797b95fedb05f7b10..9f7a2fd5a1d0a6477697ecddbe9b95d48379b517 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -78,9 +78,13 @@ class simplePlugin extends plugin * \param array $attributesInfo An attributesInfo array, if NULL, getAttributesInfo will be used. * */ - function __construct ($unused = NULL, $dn = NULL, $object = NULL, $attributesInfo = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE, $attributesInfo = NULL) { global $config; + + $this->parent = $parent; + $this->mainTab = $mainTab; + if ($attributesInfo === NULL) { $attributesInfo = $this->getAttributesInfo(); } @@ -115,7 +119,7 @@ class simplePlugin extends plugin } // We call plugin constructor - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object); $this->setTemplate($this->is_template); @@ -476,7 +480,7 @@ class simplePlugin extends plugin $class = get_class($this); $attrsWrapper = new stdClass(); $attrsWrapper->attrs = $this->group_attrs; - $group = new $class(NULL, $this->group_attrs['dn'], $attrsWrapper); + $group = new $class($this->group_attrs['dn'], $attrsWrapper, $this->parent, $this->mainTab); $smarty = get_smarty(); $group->renderAttributes(TRUE); @@ -747,7 +751,7 @@ class simplePlugin extends plugin * * \param string $entry_dn the dn of the object to show/edit * - * \param string $tabs the tab class to use (or TRUE to use tabs, FALSE to show directly the plugin class) + * \param string $tabs TRUE to use tabs, FALSE to show directly the plugin class * * \param boolean $edit_mode wether or not this plugin can be edited * @@ -757,14 +761,11 @@ class simplePlugin extends plugin static function mainInc ($classname, $entry_dn, $tabs = FALSE, $edit_mode = TRUE, $objectType = FALSE) { global $remove_lock, $cleanup, $display, $config, $plug, $ui; - if ($tabs === TRUE) { - $tabs = 'tabs'; // Default tab class - } $plInfo = pluglist::pluginInfos($classname); $plIcon = (isset($plInfo['plIcon'])?$plInfo['plIcon']:'plugin.png'); $plHeadline = $plInfo['plTitle']; - if (($tabs !== FALSE) && ($objectType === FALSE)) { + if ($objectType === FALSE) { $key = key($plInfo['plObjectType']); if (is_numeric($key)) { $key = $plInfo['plObjectType'][$key]; @@ -779,6 +780,12 @@ class simplePlugin extends plugin $plCategory = $key; } + $mainTab = FALSE; + if (!$tabs) { + $infos = objects::infos($objectType); + $mainTab = (reset($config->data['TABS'][$infos['tabGroup']])['CLASS'] == $classname); + } + $lock_msg = ""; if ($edit_mode) { /* Remove locks created by this plugin */ @@ -803,7 +810,7 @@ class simplePlugin extends plugin /* Create account object on demand */ if (!session::is_set($classname) || (isset($_GET['reset']) && $_GET['reset'] == 1)) { if ($tabs) { - $account = new $tabs($objectType, $entry_dn); + $account = objects::open($entry_dn, $objectType); if ($edit_mode) { foreach ($account->by_object as &$obj) { $obj->setNeedEditMode(TRUE); @@ -811,7 +818,7 @@ class simplePlugin extends plugin unset($obj); } } else { - $account = new $classname(NULL, $entry_dn); + $account = new $classname($entry_dn, NULL, NULL, $mainTab); $account->set_acl_category($plCategory); if ($edit_mode) { $account->setNeedEditMode(TRUE); diff --git a/include/simpleplugin/class_simpleService.inc b/include/simpleplugin/class_simpleService.inc index 044325e0f0a4c9024232146c1124040c22a8a1ab..c27bfb6c520ba24052b4493ab967812a5ce284f5 100644 --- a/include/simpleplugin/class_simpleService.inc +++ b/include/simpleplugin/class_simpleService.inc @@ -40,12 +40,12 @@ class simpleService extends simplePlugin { * \param array $attributesInfo An attributesInfo array, if NULL, getAttributesInfo will be used. * */ - function __construct($unused, $dn, $object = NULL, $attributesInfo = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $attributesInfo = NULL) { - parent::__construct($unused, $dn, $object, $attributesInfo); + /* $object is the instance of serverService in this case, we set it as parent */ + parent::__construct($dn, $object, $object, FALSE, $attributesInfo); $plInfos = pluglist::pluginInfos(get_class($this)); $this->DisplayName = $plInfos['plShortName']; - $this->parent = $object; /* $object is the instance of serverService in this case */ } /*! \brief This function display the service and return the html code diff --git a/include/simpleplugin/class_simpleTabs.inc b/include/simpleplugin/class_simpleTabs.inc index 7cde64cbcc9ae9d334ff3e5ca2646636193b9a79..fab7190d45079495145136617f1d7a8f11fefd18 100644 --- a/include/simpleplugin/class_simpleTabs.inc +++ b/include/simpleplugin/class_simpleTabs.inc @@ -70,6 +70,7 @@ class simpleTabs } $this->objectType = $type; } else { + trigger_error('deprecated call to old tabclass constructor'); /* Deprecated, used by old management classes */ //$config_object = func_get_arg(0); // ignored $data = func_get_arg(1); @@ -100,15 +101,14 @@ class simpleTabs $this->by_name[$tab['CLASS']] = $tab['NAME']; if ($baseobject === NULL) { - $baseobject = new $tab['CLASS'](NULL, $this->dn, $attrs_object); + $baseobject = new $tab['CLASS']($this->dn, $attrs_object, $this, TRUE); $this->by_object[$tab['CLASS']] = $baseobject; $this->baseclass = $tab['CLASS']; } else { - $this->by_object[$tab['CLASS']] = new $tab['CLASS'](NULL, $this->dn, $baseobject); + $this->by_object[$tab['CLASS']] = new $tab['CLASS']($this->dn, $baseobject, $this, FALSE); } $this->read_only |= $this->by_object[$tab['CLASS']]->read_only; - $this->by_object[$tab['CLASS']]->parent = &$this; $this->by_object[$tab['CLASS']]->set_acl_category($this->acl_category); } unset($tab); @@ -145,12 +145,11 @@ class simpleTabs continue; } if ($baseobject === NULL) { - $baseobject = new $class(NULL, $this->dn); + $baseobject = new $class($this->dn, NULL, $this, TRUE); $this->by_object[$name] = $baseobject; } else { - $this->by_object[$name] = new $class(NULL, $this->dn, $baseobject); + $this->by_object[$name] = new $class($this->dn, $baseobject, $this, FALSE); } - $this->by_object[$name]->parent = &$this; $this->by_object[$name]->set_acl_category($this->acl_category); } } @@ -459,8 +458,7 @@ class simpleTabs } $this->by_name[$tab['CLASS']] = $tab['NAME']; - $this->by_object[$tab['CLASS']] = new $tab['CLASS'](NULL, $this->dn, $baseobject); - $this->by_object[$tab['CLASS']]->parent = &$this; + $this->by_object[$tab['CLASS']] = new $tab['CLASS']($this->dn, $baseobject, $this, FALSE); $this->by_object[$tab['CLASS']]->set_acl_category($this->acl_category); } } diff --git a/plugins/addons/dashboard/class_dashBoard.inc b/plugins/addons/dashboard/class_dashBoard.inc index 28e4b6e2d052e5d4b8d41fe2b25ba2b2699d696a..2aa0e7300d5f644a2e4385428c07ab88141501f6 100644 --- a/plugins/addons/dashboard/class_dashBoard.inc +++ b/plugins/addons/dashboard/class_dashBoard.inc @@ -52,9 +52,9 @@ class dashboard extends simplePlugin ); } - function __construct($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->stats = $this->overview_stats(); } diff --git a/plugins/addons/dashboard/class_dashBoardUsers.inc b/plugins/addons/dashboard/class_dashBoardUsers.inc index c8e6c2b2f628600a5f04949e7f53c6ba613da4a7..8efebea97c3f5d29c803555ad033af4f787791b2 100644 --- a/plugins/addons/dashboard/class_dashBoardUsers.inc +++ b/plugins/addons/dashboard/class_dashBoardUsers.inc @@ -53,9 +53,9 @@ class dashboardUsers extends simplePlugin ); } - function __construct($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->users_stats = $this->computeUsersStats(); $this->groups_stats = $this->computeGroupsStats(); diff --git a/plugins/admin/acl/class_aclAssignment.inc b/plugins/admin/acl/class_aclAssignment.inc index 033c27ada6c24b661d543ad0d918bd47bafccb63..36119d9c416ded3f2f8f2f27044c1ff734d549a0 100644 --- a/plugins/admin/acl/class_aclAssignment.inc +++ b/plugins/admin/acl/class_aclAssignment.inc @@ -20,8 +20,6 @@ class aclAssignmentDialogWindow extends simplePlugin { - protected $mainTab = TRUE; - static function plInfo() { return array( @@ -63,9 +61,9 @@ class aclAssignmentDialogWindow extends simplePlugin ); } - function __construct ($unused, $value, $isContainer = FALSE) + function __construct ($value, $isContainer = FALSE) { - parent::__construct($unused); + parent::__construct(NULL, NULL, NULL, TRUE); if ($isContainer) { $this->attributesAccess['aclMode']->setDefaultValue('subtree'); } else { @@ -144,7 +142,7 @@ class ACLsAssignmentDialog extends GenericDialog $isContainer = TRUE; } $this->attribute = $attribute; - $this->dialog = new $this->dialogClass(NULL, $acl, $isContainer); + $this->dialog = new $this->dialogClass($acl, $isContainer); $this->dialog->set_acl_base($simplePlugin->acl_base); $this->initialAclValue = $acl; } @@ -292,9 +290,9 @@ class aclAssignment extends simplePlugin ); } - function __construct ($unused, $dn = NULL, $object = NULL, $attributesInfo = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { - parent::__construct ($unused, $dn, $object); + parent::__construct ($dn, $object, $parent, $mainTab); $this->attributesInfo['main']['name'] = sprintf(_('Assignments on object or subtree %s'), $this->dn); } diff --git a/plugins/admin/aclrole/class_aclRole.inc b/plugins/admin/aclrole/class_aclRole.inc index eeaa46d86f5579816c277835c39126e705df71fc..e5e8bafb703000377101b37d788ba359f687b0a4 100644 --- a/plugins/admin/aclrole/class_aclRole.inc +++ b/plugins/admin/aclrole/class_aclRole.inc @@ -70,7 +70,6 @@ class ACLsAttribute extends DialogOrderedArrayAttribute class aclRole extends simplePlugin { var $objectclasses = array('top','gosaRole'); - var $mainTab = TRUE; static function plInfo() { @@ -119,12 +118,5 @@ class aclRole extends simplePlugin ), ); } - - function __construct ($unused, $dn = NULL, $object = NULL) - { - parent::__construct($unused, $dn, $object); - - $this->attributesAccess['cn']->setUnique(TRUE); - } } ?> diff --git a/plugins/admin/departments/class_department.inc b/plugins/admin/departments/class_department.inc index e391d218cd8603bb5569906efae0342d29d535d1..2966e464126fc201b180ea29df66d41b50b045b5 100644 --- a/plugins/admin/departments/class_department.inc +++ b/plugins/admin/departments/class_department.inc @@ -26,7 +26,6 @@ class department extends simplePlugin /* Do not append the structural object classes here, they are added dynamically in the constructor */ var $objectclasses = array("top", "gosaDepartment"); var $structuralOC = array("organizationalUnit"); - var $mainTab = TRUE; static function plInfo() { @@ -120,7 +119,7 @@ class department extends simplePlugin return $attributesInfo; } - function __construct ($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { global $config; /* Add the default structural object class if this is a new entry */ @@ -143,7 +142,7 @@ class department extends simplePlugin } $this->objectclasses = array_unique($this->objectclasses); - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $categoriesList = $config->get_cfg_value('DepartmentCategories', array()); diff --git a/plugins/admin/groups/class_group.inc b/plugins/admin/groups/class_group.inc index 0ee216b390b7d28f7608140edc087f56ae0584da..92e122ee5c3b9daf087289c19c2ecdbd9344114c 100644 --- a/plugins/admin/groups/class_group.inc +++ b/plugins/admin/groups/class_group.inc @@ -22,7 +22,6 @@ class group extends simplePlugin { - var $mainTab = TRUE; var $objectclasses = array('posixGroup'); static function plInfo() @@ -107,9 +106,9 @@ class group extends simplePlugin ); } - function __construct ($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->attributesAccess['trustMode']->setInLdap(FALSE); $this->attributesAccess['trustMode']->setManagedAttributes( diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index db31ef92b6ffbb584e099e5e7ab5b9df997276ce..fc08a87d281a696b54d195a235af4636a60fdbef 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -79,7 +79,7 @@ class groupManagement extends simpleManagement if (class_available($plug['CLASS'])) { $name = $plug['CLASS']; - $grouptabs[$name] = new $name(NULL, $dn); + $grouptabs[$name] = new $name($dn); } } } diff --git a/plugins/admin/groups/class_ogroup.inc b/plugins/admin/groups/class_ogroup.inc index 11323322e77b6dc7e762432ba6607c65b2f7cded..c6dc0dd5bbd45afd5c3ddf871e86dfbf51593c7d 100644 --- a/plugins/admin/groups/class_ogroup.inc +++ b/plugins/admin/groups/class_ogroup.inc @@ -130,7 +130,6 @@ class ObjectSelectDialog extends GenericSelectDialog class ogroup extends simplePlugin { - var $mainTab = TRUE; var $objectclasses = array('groupOfNames', 'gosaGroupOfNames'); var $used_workstations = array(); @@ -229,10 +228,10 @@ class ogroup extends simplePlugin ); } - function __construct ($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { global $config; - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->attributesAccess['trustMode']->setInLdap(FALSE); $this->attributesAccess['trustMode']->setManagedAttributes( diff --git a/plugins/admin/groups/class_roleGeneric.inc b/plugins/admin/groups/class_roleGeneric.inc index ebf8189a05fd1328e1271d7161ca40cff1a0053b..14e67142079ddaf99182f7daaf149c4efa071a32 100644 --- a/plugins/admin/groups/class_roleGeneric.inc +++ b/plugins/admin/groups/class_roleGeneric.inc @@ -47,8 +47,6 @@ class RoleMembersAttribute extends UsersAttribute class roleGeneric extends simplePlugin { - var $mainTab = TRUE; - var $objectclasses = array('organizationalRole'); static function plInfo() @@ -109,14 +107,5 @@ class roleGeneric extends simplePlugin ) ); } - - /*! - * \brief Constructor - */ - function __construct($unused, $dn = NULL, $object = NULL) - { - parent::__construct($unused, $dn, $object); - $this->attributesAccess['cn']->setUnique(TRUE); - } } ?> diff --git a/plugins/admin/groups/tabs_ogroups.inc b/plugins/admin/groups/tabs_ogroups.inc index 91481464f05b77972f2a4cd16a80ba8bde61a7a1..5f658be1c689cd94187d0a210e6ecbd67825cd5a 100644 --- a/plugins/admin/groups/tabs_ogroups.inc +++ b/plugins/admin/groups/tabs_ogroups.inc @@ -107,16 +107,15 @@ class ogrouptabs extends simpleTabs_noSpecial function addTab ($class) { - @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class, "Adding tab "); + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class, 'Adding tab '); $plInfos = pluglist::pluginInfos($class); - $this->by_name["$class"] = $plInfos['plShortName']; - if (isset($this->removed_tabs["$class"])) { - $this->by_object["$class"] = $this->removed_tabs["$class"]; - unset($this->removed_tabs["$class"]); + $this->by_name[$class] = $plInfos['plShortName']; + if (isset($this->removed_tabs[$class])) { + $this->by_object[$class] = $this->removed_tabs[$class]; + unset($this->removed_tabs[$class]); } else { - $this->by_object["$class"] = new $class(NULL, $this->dn, $this->getBaseObject()); - $this->by_object["$class"]->parent = &$this; - $this->by_object["$class"]->set_acl_category($this->acl_category); + $this->by_object[$class] = new $class($this->dn, $this->getBaseObject(), $this, FALSE); + $this->by_object[$class]->set_acl_category($this->acl_category); } } diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index 2b7952677ce88b6d449286f88c1a59e7754698d9..a348ee8e4935a9d247a81d242231f84b2761c4ec 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -225,7 +225,7 @@ class userManagement extends simpleManagement if (class_available($plug['CLASS'])) { $name = $plug['CLASS']; - $usertabs[$name] = new $name($config, $dn); + $usertabs[$name] = new $name($dn); } } } diff --git a/plugins/config/class_configInLdap.inc b/plugins/config/class_configInLdap.inc index f2c45f023988c5af592689ca7e57acec7b8fe61f..9a3fffede0f5168134989bc1431fc0a5e2a28eeb 100644 --- a/plugins/config/class_configInLdap.inc +++ b/plugins/config/class_configInLdap.inc @@ -49,7 +49,6 @@ class DebugLevelAttribute extends SetAttribute class configInLdap extends simplePlugin { var $objectclasses = array("fusionDirectoryConf"); - var $mainTab = TRUE; static function plInfo() { @@ -465,7 +464,7 @@ class configInLdap extends simplePlugin ); } - function __construct($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE, $attributesInfo = NULL) { global $config; $attributesInfo = self::getAttributesInfo(); @@ -481,7 +480,7 @@ class configInLdap extends simplePlugin $methods = $methods['name']; $attributesInfo['password']['attrs'][0]->setChoices($methods); - parent::__construct($unused, $dn, $object, $attributesInfo); + parent::__construct($dn, $object, $parent, $mainTab, $attributesInfo); $this->fusionConfigMd5 = md5_file(CACHE_DIR."/".CLASS_CACHE); diff --git a/plugins/config/class_mainPluginsConfig.inc b/plugins/config/class_mainPluginsConfig.inc index 4234effd38b5ce8f13f2d5a159aa70f4e4ad13f9..9ad54bd5bceab82afa8eddc9f3a75f0476054983 100644 --- a/plugins/config/class_mainPluginsConfig.inc +++ b/plugins/config/class_mainPluginsConfig.inc @@ -60,10 +60,5 @@ class mainPluginsConfig extends simplePlugin ), ); } - - function __construct($unused, $dn = NULL, $object = NULL) - { - parent::__construct($unused, $dn, $object); - } } ?> diff --git a/plugins/config/class_recoveryConfig.inc b/plugins/config/class_recoveryConfig.inc index 319c30288500c8545c2c533a89935bc0653debac..6b0782e6e4162a48061e6c11b32285f951a1abf4 100644 --- a/plugins/config/class_recoveryConfig.inc +++ b/plugins/config/class_recoveryConfig.inc @@ -117,7 +117,7 @@ class recoveryConfig extends simplePlugin ); } - function __construct($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { global $config; // Check if token branch is here @@ -134,7 +134,7 @@ class recoveryConfig extends simplePlugin fusiondirectory_log("Created token branch ".$tokenBranch); } - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->attributesAccess['fdPasswordRecoveryActivated']->setManagedAttributes( array( diff --git a/plugins/config/main.inc b/plugins/config/main.inc index 224117a82cb44ff93436f8fe1ebe45f7f988d685..e08f0ab898c61d16020623e080a04d11a274616b 100644 --- a/plugins/config/main.inc +++ b/plugins/config/main.inc @@ -18,5 +18,5 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -simplePlugin::mainInc('configInLdap', CONFIGRDN.$config->current['BASE'], 'tabs_configInLdap'); +simplePlugin::mainInc('configInLdap', CONFIGRDN.$config->current['BASE'], TRUE); ?> diff --git a/plugins/generic/references/class_reference.inc b/plugins/generic/references/class_reference.inc index 0a5ef4ad779e909d0136bbb653084e7ffd15a96b..a9ca0aa781be4553f5f6d78dd8dbcfd873a8aad8 100644 --- a/plugins/generic/references/class_reference.inc +++ b/plugins/generic/references/class_reference.inc @@ -51,9 +51,9 @@ class reference extends simplePlugin ); } - function __construct($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->refs = NULL; } diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index b4e18999059aa986fc0103bac8c8349865d6bdcd..2c93bfc59165273477957c68d3944322e9a48a1a 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -267,7 +267,6 @@ class PostalAddressAttribute extends TextAreaAttribute class user extends simplePlugin { var $objectclasses = array('inetOrgPerson','organizationalPerson','person'); - var $mainTab = TRUE; private $was_locked; @@ -446,9 +445,9 @@ class user extends simplePlugin ); } - function __construct ($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->attributesAccess['uid']->setUnique('whole'); $this->attributesAccess['uid']->setDisabled($this->initially_was_account && !$this->is_template); diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 73cbff2cf661b3abd2b951560322bec51f1ab05a..0f352161191a3229e711ea52bf91f57a02fd964b 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -204,10 +204,10 @@ class posixAccount extends simplePlugin ); } - function __construct ($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { global $config; - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->attributesAccess['gecos']->setVisible(FALSE); diff --git a/plugins/personal/roles/class_userRoles.inc b/plugins/personal/roles/class_userRoles.inc index 8435931b03febc790a38fe9efa8ff9bf1c4d34ba..5c2307c0b7889639b706b9a798a65e19f2ed2c27 100644 --- a/plugins/personal/roles/class_userRoles.inc +++ b/plugins/personal/roles/class_userRoles.inc @@ -68,9 +68,9 @@ class userRoles extends simplePlugin ); } - function __construct ($unused, $dn = NULL, $object = NULL) + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) { - parent::__construct($unused, $dn, $object); + parent::__construct($dn, $object, $parent, $mainTab); $this->ignore_account = FALSE; /* Groups handling */