diff --git a/contrib/fusiondirectory.conf b/contrib/fusiondirectory.conf index 040a9c4e64ffbe3161c5d305a0bf4c39e1c777d3..93a4da293bdcd8d19207a53d55bb3f0161d62b90 100644 --- a/contrib/fusiondirectory.conf +++ b/contrib/fusiondirectory.conf @@ -44,25 +44,6 @@ <plugin acl="faxreport/faxreport:self,faxreport" class="faxreport" /> <plugin acl="fonreport/fonreport:self,fonreport" class="fonreport" /> </section> - - <!-- Section to enable quick self service shortcuts for the logged in user --> - <section name="My account"> - <plugin acl="users/user:self" class="user" /> - <plugin acl="users/posixAccount:self" class="posixAccount" /> - <plugin acl="users/environment:self" class="environment" /> - <plugin acl="users/quotaAccount:self" class="quotaAccount" /> - <plugin acl="users/mailAccount:self" class="mailAccount" /> - <plugin acl="users/sambaAccount:self" class="sambaAccount" /> - <plugin acl="users/supannAccount:self" class="supannAccount" /> - <plugin acl="users/netatalkAccount:self" class="netatalkAccount" /> - <plugin acl="users/connectivity:self" class="connectivity" /> - <plugin acl="users/gofaxAccount:self" class="gofaxAccount" /> - <plugin acl="users/phoneAccount:self" class="phoneAccount" /> - <plugin acl="users/nagiosAccount:self" class="nagiosAccount" /> - <plugin acl="users/novaAccount:self" class="novaAccount" /> - <plugin acl="users/scalixAccount:self" class="scalixAccount" /> - <plugin acl="users/password:self" class="password" /> - </section> </menu> <!-- Tab definitions ******************************************************* diff --git a/include/class_config.inc b/include/class_config.inc index 4d966d2cd10988db6e151dd0eb1b8bcaead0b1d2..92050651a27328219e2911e7a7be1ed43a5bf894 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -1290,14 +1290,18 @@ class config { if (isset($plInfo['plSection'])) { $section = $plInfo['plSection']; $acl = $plInfo['plCategory']; - if (is_array($acl)) { - $key = key($acl); - if (is_numeric($key)) { - $acl = join(',', $acl); - } else { - $acl = join(',', array_keys($acl)); - } + if (!is_array($acl)) { + $acl = array($acl); + } + $key = key($acl); + if (!is_numeric(key($acl))) { + $acl = array_keys($acl); } + if (isset($plInfo['plSelfModify']) && $plInfo['plSelfModify']) { + $acl[] = $acl[0].'/'.$class.':self'; + } + $acl = join(',', $acl); + if (is_array($section)) { $section = key($section); $this->data['SECTIONS'][$section] = $plInfo['plSection'][$section]; @@ -1309,20 +1313,20 @@ class config { if (!empty($acl)) { $attrs['ACL'] = $acl; } - if ($section == "personal") { - $attrs['ACL'] = 'users/'.$class.':self'; - } $this->data['MENU'][$section][] = $attrs; } } $this->data['SECTIONS']["personal"] = array('name' => _('My account'), 'priority' => 20); - if (!isset($this->data['MENU']["personal"])) { - $this->data['MENU']["personal"] = array(); - } + $personal = array(); foreach ($this->data['TABS']['USERTABS'] as $tab) { - $this->data['MENU']["personal"][] = array('CLASS' => $tab['CLASS'], 'ACL' => 'users/'.$tab['CLASS'].':self'); + $personal[] = array('CLASS' => $tab['CLASS'], 'ACL' => 'users/'.$tab['CLASS'].':self'); + } + if (!isset($this->data['MENU']["personal"])) { + $this->data['MENU']["personal"] = $personal; + } else { + $this->data['MENU']["personal"] = array_merge($personal, $this->data['MENU']["personal"]); } - usort($this->data['SECTIONS'], + uasort($this->data['SECTIONS'], function ($a, $b) { if ($a['priority'] == $b['priority']) { diff --git a/plugins/personal/password/class_password.inc b/plugins/personal/password/class_password.inc index fc6f25718e3ec5982f70dd3f4a62eaf8fb1b5411..033b38d58c741e2951a6af6bfd5b59e688bbb9a3 100644 --- a/plugins/personal/password/class_password.inc +++ b/plugins/personal/password/class_password.inc @@ -22,38 +22,33 @@ class password extends plugin { - /* Definitions */ - var $plHeadline = "Password"; - var $plDescription = "Change user password"; - - var $proposal = ""; - var $proposalEnabled = FALSE; + var $proposal = ""; + var $proposalEnabled = FALSE; var $proposalSelected = FALSE; var $forcedHash = NULL; - - function password(&$config, $dn= NULL, $parent= NULL) + function password(&$config, $dn = NULL, $parent = NULL) { - plugin::plugin($config, $dn, $parent); + plugin::plugin($config, $dn, $parent); - // Try to generate a password proposal, if this is successfull - // then preselect the proposal usage. - $this->refreshProposal(); - if($this->proposal != ""){ - $this->proposalSelected = TRUE; - } + // Try to generate a password proposal, if this is successfull + // then preselect the proposal usage. + $this->refreshProposal(); + if ($this->proposal != "") { + $this->proposalSelected = TRUE; + } } function forceHash($hash) { - $this->forcedHash = $hash; + $this->forcedHash = $hash; } function refreshProposal() { - $this->proposal = passwordMethod::getPasswordProposal($this->config); - $this->proposalEnabled = (!empty($this->proposal)); + $this->proposal = passwordMethod::getPasswordProposal($this->config); + $this->proposalEnabled = (!empty($this->proposal)); } function execute() @@ -180,11 +175,11 @@ class password extends plugin function change_password($dn, $pwd, $hash) { - if(!$hash){ - change_password ($dn, $pwd); - }else{ - change_password ($dn, $pwd,0, $hash); - } + if ($hash) { + change_password ($dn, $pwd,0, $hash); + } else { + change_password ($dn, $pwd); + } } @@ -200,16 +195,17 @@ class password extends plugin static function plInfo() { return array( - "plDescription" => _("User password"), + "plShortName" => _("Password"), + "plDescription" => _("Change user password"), "plSelfModify" => TRUE, "plDepends" => array("user"), "plPriority" => 10, "plCategory" => array("users"), + "plSection" => "personal", "plProvidedAcls" => array() ); } } -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>