From 9db074c1e7ab12c2736f607617d70f02f3e11afd Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sat, 31 Aug 2019 11:15:49 +0200 Subject: [PATCH] added delete button --- lam/lib/modules.inc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index ddc1d4e0..66f917be 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -831,7 +831,7 @@ class accountContainer { * @param string $name class name (e.g. posixAccount) * @return baseModule account module */ - function getAccountModule($name) { + public function getAccountModule($name) { if (isset($this->module[$name])) { return $this->module[$name]; } @@ -845,7 +845,7 @@ class accountContainer { * * @return baseModule[] modules */ - function getAccountModules() { + public function getAccountModules() { return $this->module; } @@ -854,7 +854,7 @@ class accountContainer { * * @return ConfiguredType account type */ - function get_type() { + public function get_type() { return $this->type; } @@ -862,7 +862,7 @@ class accountContainer { * This function is called when the user clicks on any button on the account pages. * It prints the HTML code of each account page. */ - function continue_main() { + public function continue_main() { $oldPage = $this->current_page; $oldSubpage = $this->subpage; $result = array(); @@ -875,6 +875,11 @@ class accountContainer { if (isset($_POST['accountContainerReset'])) { $result = $this->load_account($this->dn_orig); } + elseif (isset($_POST['accountContainerDelete'])) { + metaRefresh("../lists/deletelink.php?type=" . $this->type->getId() . "&DN='" . rawurlencode($this->dn_orig) . "'"); + unset($_SESSION[$this->base]); + exit(); + } elseif (!$profileLoaded) { // change dn suffix if (isset($_GET['suffix']) && ($_GET['suffix'] != '') && ($this->dnSuffix == null)) { @@ -1304,6 +1309,12 @@ class accountContainer { . getSecurityTokenName() . '\',\'' . getSecurityTokenValue() . '\');'); $leftButtonGroup->addElement($passwordButton); } + if (!$this->isNewAccount) { + $leftButtonGroup->addElement(new htmlSpacer('15px', null)); + $deleteButton = new htmlButton('accountContainerDelete', _('Delete')); + $deleteButton->setIconClass('deleteButton'); + $leftButtonGroup->addElement($deleteButton); + } $row->add($leftButtonGroup, 12, 7); $rightGroup = new htmlGroup();