refactoring

This commit is contained in:
Roland Gruber 2018-12-23 17:39:44 +01:00
parent 36b91b2785
commit 615e0f4947
4 changed files with 21 additions and 21 deletions

View File

@ -32,17 +32,17 @@
*/ */
/** security functions */ /** security functions */
include_once("../../lib/security.inc"); include_once(__DIR__ . "/../../lib/security.inc");
/** configuration options */ /** configuration options */
include_once('../../lib/config.inc'); include_once(__DIR__ . '/../../lib/config.inc');
/** functions to load and save profiles */ /** functions to load and save profiles */
include_once('../../lib/profiles.inc'); include_once(__DIR__ . '/../../lib/profiles.inc');
/** Return error-message */ /** Return error-message */
include_once('../../lib/status.inc'); include_once(__DIR__ . '/../../lib/status.inc');
/** Return a pdf-file */ /** Return a pdf-file */
include_once('../../lib/pdf.inc'); include_once(__DIR__ . '/../../lib/pdf.inc');
/** module functions */ /** module functions */
include_once('../../lib/modules.inc'); include_once(__DIR__ . '/../../lib/modules.inc');
// Start session // Start session
startSecureSession(); startSecureSession();
@ -83,11 +83,11 @@ if (isset($_GET['DN'])) {
$_SESSION['account'] = new accountContainer($type, 'account', getRandomNumber()); $_SESSION['account'] = new accountContainer($type, 'account', getRandomNumber());
$result = $_SESSION['account']->load_account($DN); $result = $_SESSION['account']->load_account($DN);
if (sizeof($result) > 0) { if (sizeof($result) > 0) {
include '../../lib/adminHeader.inc'; include __DIR__ . '/../../lib/adminHeader.inc';
foreach ($result as $message) { foreach ($result as $message) {
call_user_func_array("StatusMessage", $message); call_user_func_array("StatusMessage", $message);
} }
include '../../lib/adminFooter.inc'; include __DIR__ . '/../../lib/adminFooter.inc';
die(); die();
} }
} }

View File

@ -30,11 +30,11 @@
*/ */
/** security functions */ /** security functions */
include_once("../../lib/security.inc"); include_once(__DIR__ . "/../../lib/security.inc");
/** Needed to find DNs of users */ /** Needed to find DNs of users */
include_once("../../lib/ldap.inc"); include_once(__DIR__ . "/../../lib/ldap.inc");
/** Used to display error messages */ /** Used to display error messages */
include_once("../../lib/status.inc"); include_once(__DIR__ . "/../../lib/status.inc");
// start session // start session
startSecureSession(); startSecureSession();
@ -64,9 +64,9 @@ if (isset($dn) && isset($type)) {
} }
else { else {
// print error message if arguments are missing // print error message if arguments are missing
include '../../lib/adminHeader.inc'; include __DIR__ . '/../../lib/adminHeader.inc';
StatusMessage("ERROR", "No account or type given."); StatusMessage("ERROR", "No account or type given.");
include '../../lib/adminFooter.inc'; include __DIR__ . '/../../lib/adminFooter.inc';
} }
?> ?>

View File

@ -30,11 +30,11 @@ $Id$
*/ */
/** security functions */ /** security functions */
include_once("../../lib/security.inc"); include_once(__DIR__ . "/../../lib/security.inc");
/** Used to get type information. */ /** Used to get type information. */
include_once("../../lib/types.inc"); include_once(__DIR__ . "/../../lib/types.inc");
/** Access to configuration options */ /** Access to configuration options */
include_once("../../lib/config.inc"); include_once(__DIR__ . "/../../lib/config.inc");
// start session // start session
startSecureSession(); startSecureSession();

View File

@ -33,11 +33,11 @@ use \htmlStatusMessage;
*/ */
/** security functions */ /** security functions */
include_once("../../lib/security.inc"); include_once(__DIR__ . "/../../lib/security.inc");
/** Needed to find DNs of users */ /** Needed to find DNs of users */
include_once("../../lib/ldap.inc"); include_once(__DIR__ . "/../../lib/ldap.inc");
/** Used to display error messages */ /** Used to display error messages */
include_once("../../lib/status.inc"); include_once(__DIR__ . "/../../lib/status.inc");
// start session // start session
startSecureSession(); startSecureSession();
@ -60,14 +60,14 @@ if ($dn) {
} }
else { else {
// print error message if user was not found // print error message if user was not found
include '../../lib/adminHeader.inc'; include __DIR__ . '/../../lib/adminHeader.inc';
$container = new htmlResponsiveRow(); $container = new htmlResponsiveRow();
$container->addVerticalSpacer('1rem'); $container->addVerticalSpacer('1rem');
$container->add(new htmlStatusMessage("ERROR", _("This user was not found!"), htmlspecialchars($user)), 12); $container->add(new htmlStatusMessage("ERROR", _("This user was not found!"), htmlspecialchars($user)), 12);
$container->addVerticalSpacer('1rem'); $container->addVerticalSpacer('1rem');
$container->add(new \htmlLink(_("Back to group list"), 'javascript:history.back()'), 12); $container->add(new \htmlLink(_("Back to group list"), 'javascript:history.back()'), 12);
parseHtml(null, $container, array(), false, $tabindex, 'user'); parseHtml(null, $container, array(), false, $tabindex, 'user');
include '../../lib/adminFooter.inc'; include __DIR__ . '/../../lib/adminFooter.inc';
} }