From 615e0f49478d59c390197370602465a435a4a4ad Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 23 Dec 2018 17:39:44 +0100 Subject: [PATCH] refactoring --- lam/templates/account/edit.php | 16 ++++++++-------- lam/templates/lists/deletelink.php | 10 +++++----- lam/templates/lists/list.php | 6 +++--- lam/templates/lists/userlink.php | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lam/templates/account/edit.php b/lam/templates/account/edit.php index 83e03c73..c038d499 100644 --- a/lam/templates/account/edit.php +++ b/lam/templates/account/edit.php @@ -32,17 +32,17 @@ */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** configuration options */ -include_once('../../lib/config.inc'); +include_once(__DIR__ . '/../../lib/config.inc'); /** functions to load and save profiles */ -include_once('../../lib/profiles.inc'); +include_once(__DIR__ . '/../../lib/profiles.inc'); /** Return error-message */ -include_once('../../lib/status.inc'); +include_once(__DIR__ . '/../../lib/status.inc'); /** Return a pdf-file */ -include_once('../../lib/pdf.inc'); +include_once(__DIR__ . '/../../lib/pdf.inc'); /** module functions */ -include_once('../../lib/modules.inc'); +include_once(__DIR__ . '/../../lib/modules.inc'); // Start session startSecureSession(); @@ -83,11 +83,11 @@ if (isset($_GET['DN'])) { $_SESSION['account'] = new accountContainer($type, 'account', getRandomNumber()); $result = $_SESSION['account']->load_account($DN); if (sizeof($result) > 0) { - include '../../lib/adminHeader.inc'; + include __DIR__ . '/../../lib/adminHeader.inc'; foreach ($result as $message) { call_user_func_array("StatusMessage", $message); } - include '../../lib/adminFooter.inc'; + include __DIR__ . '/../../lib/adminFooter.inc'; die(); } } diff --git a/lam/templates/lists/deletelink.php b/lam/templates/lists/deletelink.php index d21ae1ad..ea6aa58c 100644 --- a/lam/templates/lists/deletelink.php +++ b/lam/templates/lists/deletelink.php @@ -30,11 +30,11 @@ */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** Needed to find DNs of users */ -include_once("../../lib/ldap.inc"); +include_once(__DIR__ . "/../../lib/ldap.inc"); /** Used to display error messages */ -include_once("../../lib/status.inc"); +include_once(__DIR__ . "/../../lib/status.inc"); // start session startSecureSession(); @@ -64,9 +64,9 @@ if (isset($dn) && isset($type)) { } else { // print error message if arguments are missing - include '../../lib/adminHeader.inc'; + include __DIR__ . '/../../lib/adminHeader.inc'; StatusMessage("ERROR", "No account or type given."); - include '../../lib/adminFooter.inc'; + include __DIR__ . '/../../lib/adminFooter.inc'; } ?> diff --git a/lam/templates/lists/list.php b/lam/templates/lists/list.php index 7314e9d6..f938f3eb 100644 --- a/lam/templates/lists/list.php +++ b/lam/templates/lists/list.php @@ -30,11 +30,11 @@ $Id$ */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** Used to get type information. */ -include_once("../../lib/types.inc"); +include_once(__DIR__ . "/../../lib/types.inc"); /** Access to configuration options */ -include_once("../../lib/config.inc"); +include_once(__DIR__ . "/../../lib/config.inc"); // start session startSecureSession(); diff --git a/lam/templates/lists/userlink.php b/lam/templates/lists/userlink.php index f7c8e86e..4f5cbb5a 100644 --- a/lam/templates/lists/userlink.php +++ b/lam/templates/lists/userlink.php @@ -33,11 +33,11 @@ use \htmlStatusMessage; */ /** security functions */ -include_once("../../lib/security.inc"); +include_once(__DIR__ . "/../../lib/security.inc"); /** Needed to find DNs of users */ -include_once("../../lib/ldap.inc"); +include_once(__DIR__ . "/../../lib/ldap.inc"); /** Used to display error messages */ -include_once("../../lib/status.inc"); +include_once(__DIR__ . "/../../lib/status.inc"); // start session startSecureSession(); @@ -60,14 +60,14 @@ if ($dn) { } else { // print error message if user was not found - include '../../lib/adminHeader.inc'; + include __DIR__ . '/../../lib/adminHeader.inc'; $container = new htmlResponsiveRow(); $container->addVerticalSpacer('1rem'); $container->add(new htmlStatusMessage("ERROR", _("This user was not found!"), htmlspecialchars($user)), 12); $container->addVerticalSpacer('1rem'); $container->add(new \htmlLink(_("Back to group list"), 'javascript:history.back()'), 12); parseHtml(null, $container, array(), false, $tabindex, 'user'); - include '../../lib/adminFooter.inc'; + include __DIR__ . '/../../lib/adminFooter.inc'; }