From b99aa5729de4f9073b940a5d98e1172bd8225aff Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 16 Jul 2017 20:48:46 +0200 Subject: [PATCH 1/5] fixed issue with tool visibility --- lam/HISTORY | 5 +++++ lam/lib/tools/serverInfo.inc | 4 ++-- lam/templates/config/confmain.php | 9 ++++++--- lam/templates/main_header.php | 6 ++++-- lam/templates/tools.php | 4 +++- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lam/HISTORY b/lam/HISTORY index b9fc346f..a0ca3071 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -1,3 +1,8 @@ +July 2017 6.0.1 + - Fixed bugs: + -> Configuration file fills up with empty values + -> Tool visibility settings + 26.06.2017 6.0 - Support multiple configurations for same account type - PHP 7.1 compatibility diff --git a/lam/lib/tools/serverInfo.inc b/lam/lib/tools/serverInfo.inc index f65c1a36..bce1a008 100644 --- a/lam/lib/tools/serverInfo.inc +++ b/lam/lib/tools/serverInfo.inc @@ -4,7 +4,7 @@ namespace LAM\TOOLS\SERVER_INFO; $Id$ This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) - Copyright (C) 2009 - 2016 Roland Gruber + Copyright (C) 2009 - 2017 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 @@ -78,7 +78,7 @@ class toolServerInformation implements \LAMTool { * @return boolean true if password change rights are needed */ function getRequiresPasswordChangeRights() { - return true; + return false; } /** diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index ea93c979..86e1d3e9 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -496,11 +496,12 @@ for ($r = 0; $r < (sizeof($tools) / 4); $r++) { } $tool = $tools[($r * 4) + $c]; $toolClass = get_class($tool); + $toolName = substr($toolClass, strrpos($toolClass, '\\') + 1); $selected = false; - if (isset($toolSettings['tool_hide_' . $toolClass]) && ($toolSettings['tool_hide_' . $toolClass] === 'true')) { + if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] === 'true')) { $selected = true; } - $toolSettingsContent->addElement(new htmlTableExtendedInputCheckbox('tool_hide_' . $toolClass, $selected, $tool->getName(), null, false)); + $toolSettingsContent->addElement(new htmlTableExtendedInputCheckbox('tool_hide_' . $toolName, $selected, $tool->getName(), null, false)); $toolSettingsContent->addElement(new htmlSpacer('10px', null)); } $toolSettingsContent->addNewLine(); @@ -761,7 +762,9 @@ function checkInput() { $tools = getTools(); $toolSettings = array(); for ($i = 0; $i < sizeof($tools); $i++) { - $toolConfigID = 'tool_hide_' . $tools[$i]; + $toolClass = $tools[$i]; + $toolName = substr($toolClass, strrpos($toolClass, '\\') + 1); + $toolConfigID = 'tool_hide_' . $toolName; if ((isset($_POST[$toolConfigID])) && ($_POST[$toolConfigID] == 'on')) { $toolSettings[$toolConfigID] = 'true'; } diff --git a/lam/templates/main_header.php b/lam/templates/main_header.php index 6183cb78..6a65fe43 100644 --- a/lam/templates/main_header.php +++ b/lam/templates/main_header.php @@ -86,7 +86,8 @@ $toolSettings = $_SESSION['config']->getToolSettings(); // sort tools $toSort = array(); for ($i = 0; $i < sizeof($availableTools); $i++) { - $myTool = new $availableTools[$i](); + $toolClass = $availableTools[$i]; + $myTool = new $toolClass(); if ($myTool->getRequiresWriteAccess() && !checkIfWriteAccessIsAllowed()) { continue; } @@ -98,7 +99,8 @@ for ($i = 0; $i < sizeof($availableTools); $i++) { continue; } // check if hidden by config - if (isset($toolSettings['tool_hide_' . get_class($myTool)]) && ($toolSettings['tool_hide_' . get_class($myTool)] == 'true')) { + $toolName = substr($toolClass, strrpos($toolClass, '\\') + 1); + if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] == 'true')) { continue; } $toSort[$availableTools[$i]] = $myTool->getPosition(); diff --git a/lam/templates/tools.php b/lam/templates/tools.php index be87eaa4..9a81e7bb 100644 --- a/lam/templates/tools.php +++ b/lam/templates/tools.php @@ -77,7 +77,9 @@ for ($i = 0; $i < sizeof($tools); $i++) { continue; } // check if hidden by config - if (isset($toolSettings['tool_hide_' . get_class($tools[$i])]) && ($toolSettings['tool_hide_' . get_class($tools[$i])] == 'true')) { + $className = get_class($tools[$i]); + $toolName = substr($className, strrpos($className, '\\') + 1); + if (isset($toolSettings['tool_hide_' . $toolName]) && ($toolSettings['tool_hide_' . $toolName] == 'true')) { continue; } // add tool From ae64c43e2fa5047321093c4660adb4e8c2f4895b Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 19 Jul 2017 20:33:28 +0200 Subject: [PATCH 2/5] Patch 19: fixed multi-value input field --- lam/lib/baseModule.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index f27470c4..2979d099 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -1408,12 +1408,14 @@ abstract class baseModule { if ($label !== null) { $labelTextOut = new htmlOutputText($label); $labelTextOut->alignment = htmlElement::ALIGN_TOP; + $labelTextOut->setMarkAsRequired($required); $container->addElement($labelTextOut); } $subContainer = new htmlTable(); $subContainer->alignment = htmlElement::ALIGN_TOP; for ($i = 0; $i < sizeof($values); $i++) { $input = new htmlSelect($attrName . '_' . $i, $options, array($values[$i]), $fieldSize); + $input->setHasDescriptiveElements($hasDescriptiveOptions); $subContainer->addElement($input); if (!empty($htmlIDs)) { $htmlIDs[] = $attrName . '_' . $i; From 88cd30ff05abf8ae724ec396085cb8fa26966f5a Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 19 Jul 2017 20:51:32 +0200 Subject: [PATCH 3/5] 6.0.1 --- lam-packaging/debian/changelog | 6 ++++++ lam/HISTORY | 2 +- lam/VERSION | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lam-packaging/debian/changelog b/lam-packaging/debian/changelog index 5d75e83f..174d62c2 100644 --- a/lam-packaging/debian/changelog +++ b/lam-packaging/debian/changelog @@ -1,3 +1,9 @@ +ldap-account-manager (6.0.1-1) unstable; urgency=medium + + * new upstream release + + -- Roland Gruber Wed, 19 Jul 2017 20:50:22 +0200 + ldap-account-manager (6.0-1) unstable; urgency=medium * new upstream release diff --git a/lam/HISTORY b/lam/HISTORY index a0ca3071..262c14eb 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -1,4 +1,4 @@ -July 2017 6.0.1 +20.07.2017 6.0.1 - Fixed bugs: -> Configuration file fills up with empty values -> Tool visibility settings diff --git a/lam/VERSION b/lam/VERSION index e0ea36fe..5fe60723 100644 --- a/lam/VERSION +++ b/lam/VERSION @@ -1 +1 @@ -6.0 +6.0.1 From 3b9f847ca64d4560e9ffc5418e358f22015efa0a Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 19 Jul 2017 21:16:25 +0200 Subject: [PATCH 4/5] fixed email --- lam-packaging/debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lam-packaging/debian/changelog b/lam-packaging/debian/changelog index 174d62c2..02178c76 100644 --- a/lam-packaging/debian/changelog +++ b/lam-packaging/debian/changelog @@ -2,7 +2,7 @@ ldap-account-manager (6.0.1-1) unstable; urgency=medium * new upstream release - -- Roland Gruber Wed, 19 Jul 2017 20:50:22 +0200 + -- Roland Gruber Wed, 19 Jul 2017 20:50:22 +0200 ldap-account-manager (6.0-1) unstable; urgency=medium From 204798567f63f03fc9db846ce699e294a0328325 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 20 Jul 2017 21:22:35 +0200 Subject: [PATCH 5/5] fixed variable --- lam-packaging/RPM/ldap-account-manager.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lam-packaging/RPM/ldap-account-manager.spec b/lam-packaging/RPM/ldap-account-manager.spec index 3eebac90..2a8583c5 100644 --- a/lam-packaging/RPM/ldap-account-manager.spec +++ b/lam-packaging/RPM/ldap-account-manager.spec @@ -108,9 +108,9 @@ ln -s /var/lib/%{lam_dir}/tmp $RPM_BUILD_ROOT/usr/share/%{lam_dir}/tmp mv $RPM_BUILD_ROOT/usr/share/%{lam_dir}/sess $RPM_BUILD_ROOT/var/lib/%{lam_dir} ln -s /var/lib/%{lam_dir}/sess $RPM_BUILD_ROOT/usr/share/%{lam_dir}/sess mkdir -p $RPM_BUILD_ROOT%{httpd_confdir} -cp $RPM_BUILD_DIR/lam.apache.conf $RPM_BUILD_ROOT%{httpd_confdir}/ +cp $RPM_SOURCE_DIR/lam.apache.conf $RPM_BUILD_ROOT%{httpd_confdir}/ mkdir -p $RPM_BUILD_ROOT/etc/%{lam_dir} -cp $RPM_BUILD_DIR/lam.nginx.conf $RPM_BUILD_ROOT/etc/%{lam_dir}/ +cp $RPM_SOURCE_DIR/lam.nginx.conf $RPM_BUILD_ROOT/etc/%{lam_dir}/ %clean [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT