From e43b106c955d2f47507734c0f5bce5ea4a64c3e9 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 23 Dec 2018 17:28:42 +0100 Subject: [PATCH] refactoring --- lam/templates/delete.php | 26 +++++++++++++--------- lam/templates/tools/serverInfo.php | 8 +++---- lam/templates/tree/treeViewContainer.php | 8 +++---- lam/templates/upload/massBuildAccounts.php | 12 +++++----- lam/templates/upload/massDoUpload.php | 16 ++++++------- lam/templates/upload/masscreate.php | 16 ++++++------- 6 files changed, 45 insertions(+), 41 deletions(-) diff --git a/lam/templates/delete.php b/lam/templates/delete.php index 1d871e0c..055ce629 100644 --- a/lam/templates/delete.php +++ b/lam/templates/delete.php @@ -39,19 +39,19 @@ use \htmlStatusMessage; /** security functions */ -include_once("../lib/security.inc"); +include_once(__DIR__ . "/../lib/security.inc"); /** account functions */ -include_once('../lib/account.inc'); +include_once(__DIR__ . '/../lib/account.inc'); /** current configuration options */ -include_once('../lib/config.inc'); +include_once(__DIR__ . '/../lib/config.inc'); /** message displaying */ -include_once('../lib/status.inc'); +include_once(__DIR__ . '/../lib/status.inc'); /** LDAP connection */ -include_once('../lib/ldap.inc'); +include_once(__DIR__ . '/../lib/ldap.inc'); /** remote interface */ -include_once('../lib/remote.inc'); +include_once(__DIR__ . '/../lib/remote.inc'); /** module interface */ -include_once('../lib/modules.inc'); +include_once(__DIR__ . '/../lib/modules.inc'); // Start session startSecureSession(); @@ -155,11 +155,15 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) { } if (isset($_POST['cancel'])) { - if (isset($_SESSION['delete_dn'])) unset($_SESSION['delete_dn']); + if (isset($_SESSION['delete_dn'])) { + unset($_SESSION['delete_dn']); + } metaRefresh("lists/list.php?type=" . $_POST['type']); } elseif (isset($_POST['cancelAllOk'])) { - if (isset($_SESSION['delete_dn'])) unset($_SESSION['delete_dn']); + if (isset($_SESSION['delete_dn'])) { + unset($_SESSION['delete_dn']); + } metaRefresh("lists/list.php?type=" . $_POST['type'] . '&deleteAllOk=1'); } @@ -171,7 +175,7 @@ if (isset($_POST['delete'])) { die(); } // Show HTML Page - include '../lib/adminHeader.inc'; + include __DIR__ . '/../lib/adminHeader.inc'; echo "
\n"; echo "
getScope() . "-bright smallPaddingContent\">
\n"; $container = new htmlResponsiveRow(); @@ -328,7 +332,7 @@ if (isset($_POST['delete'])) { }); '; $tabindex = 1; $container = new htmlResponsiveRow(); @@ -364,6 +364,6 @@ elseif (isset($monitorEntries['cn=monitor']['opsinitiated'])) { parseHtml(null, $container, array(), true, $tabindex, 'user'); echo '
'; -include '../../lib/adminFooter.inc'; +include __DIR__ . '/../../lib/adminFooter.inc'; ?> diff --git a/lam/templates/tree/treeViewContainer.php b/lam/templates/tree/treeViewContainer.php index a0acade8..5c6a95e9 100644 --- a/lam/templates/tree/treeViewContainer.php +++ b/lam/templates/tree/treeViewContainer.php @@ -29,9 +29,9 @@ */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** access to configuration options */ -include_once("../../lib/config.inc"); +include_once(__DIR__ . "/../../lib/config.inc"); // start session startSecureSession(); @@ -39,7 +39,7 @@ enforceUserIsLoggedIn(); setlanguage(); -include '../../lib/adminHeader.inc'; +include __DIR__ . '/../../lib/adminHeader.inc'; ?>
@@ -64,5 +64,5 @@ window.onresize = resizeIframe;
diff --git a/lam/templates/upload/massBuildAccounts.php b/lam/templates/upload/massBuildAccounts.php index 0fc06abb..7c976ab4 100644 --- a/lam/templates/upload/massBuildAccounts.php +++ b/lam/templates/upload/massBuildAccounts.php @@ -35,13 +35,13 @@ use \htmlResponsiveRow; */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** access to configuration */ -include_once('../../lib/config.inc'); +include_once(__DIR__ . '/../../lib/config.inc'); /** status messages */ -include_once('../../lib/status.inc'); +include_once(__DIR__ . '/../../lib/status.inc'); /** account modules */ -include_once('../../lib/modules.inc'); +include_once(__DIR__ . '/../../lib/modules.inc'); // Start session @@ -95,7 +95,7 @@ if (isset($_GET['showldif'])) { exit; } -include '../../lib/adminHeader.inc'; +include __DIR__ . '/../../lib/adminHeader.inc'; $typeId = htmlspecialchars($_POST['typeId']); $typeManager = new \LAM\TYPES\TypeManager(); $type = $typeManager->getConfiguredType($typeId); @@ -279,7 +279,7 @@ parseHtml(null, $container, array(), false, $tabindex, $type->getScope()); echo ''; echo '
'; -include '../../lib/adminFooter.inc'; +include __DIR__ . '/../../lib/adminFooter.inc'; /** * Prints a back button to the page where the user enters a file to upload. diff --git a/lam/templates/upload/massDoUpload.php b/lam/templates/upload/massDoUpload.php index c868645c..570e5472 100644 --- a/lam/templates/upload/massDoUpload.php +++ b/lam/templates/upload/massDoUpload.php @@ -29,17 +29,17 @@ namespace LAM\UPLOAD; */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** access to configuration */ -include_once('../../lib/config.inc'); +include_once(__DIR__ . '/../../lib/config.inc'); /** LDAP handle */ -include_once('../../lib/ldap.inc'); +include_once(__DIR__ . '/../../lib/ldap.inc'); /** status messages */ -include_once('../../lib/status.inc'); +include_once(__DIR__ . '/../../lib/status.inc'); /** account modules */ -include_once('../../lib/modules.inc'); +include_once(__DIR__ . '/../../lib/modules.inc'); /** PDF */ -include_once('../../lib/pdf.inc'); +include_once(__DIR__ . '/../../lib/pdf.inc'); // Start session @@ -61,7 +61,7 @@ if (!isLoggedIn()) { // Set correct language, codepages, .... setlanguage(); -include '../../lib/adminHeader.inc'; +include __DIR__ . '/../../lib/adminHeader.inc'; $typeId = htmlspecialchars($_SESSION['mass_typeId']); $typeManager = new \LAM\TYPES\TypeManager(); $type = $typeManager->getConfiguredType($typeId); @@ -87,5 +87,5 @@ $tokenPrefix = '?' . getSecurityTokenName() . '=' . getSecurityTokenValue(); '; -include '../../lib/adminFooter.inc'; +include __DIR__ . '/../../lib/adminFooter.inc'; ?> diff --git a/lam/templates/upload/masscreate.php b/lam/templates/upload/masscreate.php index c1584de9..f6801bb1 100644 --- a/lam/templates/upload/masscreate.php +++ b/lam/templates/upload/masscreate.php @@ -47,17 +47,17 @@ use \moduleCache; */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** access to configuration */ -include_once('../../lib/config.inc'); +include_once(__DIR__ . '/../../lib/config.inc'); /** status messages */ -include_once('../../lib/status.inc'); +include_once(__DIR__ . '/../../lib/status.inc'); /** account modules */ -include_once('../../lib/modules.inc'); +include_once(__DIR__ . '/../../lib/modules.inc'); /** Used to get PDF information. */ -include_once('../../lib/pdfstruct.inc'); +include_once(__DIR__ . '/../../lib/pdfstruct.inc'); /** upload functions */ -include_once('../../lib/upload.inc'); +include_once(__DIR__ . '/../../lib/upload.inc'); // Start session startSecureSession(); @@ -95,7 +95,7 @@ if (isset($_GET['getCSV'])) { Uploader::cleanSession(); -include '../../lib/adminHeader.inc'; +include __DIR__ . '/../../lib/adminHeader.inc'; // get possible types and remove those which do not support file upload $typeManager = new \LAM\TYPES\TypeManager(); @@ -248,7 +248,7 @@ function changeVisibleModules(element) { echo "\n"; echo ''; -include '../../lib/adminFooter.inc'; +include __DIR__ . '/../../lib/adminFooter.inc'; /** * Displays the acount type specific main page of the upload.