From 42bca3db5999e0ab43f5e51a058b99ab07c90f96 Mon Sep 17 00:00:00 2001
From: Roland Gruber
Date: Sun, 18 Nov 2018 09:19:12 +0100
Subject: [PATCH] responsive design
---
lam/lib/config.inc | 4 ++++
lam/templates/initsuff.php | 29 ++++++++++++++---------------
lam/templates/lists/deletelink.php | 4 ++--
lam/templates/lists/userlink.php | 18 +++++++++++-------
lam/templates/tools/ou_edit.php | 4 ++--
5 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/lam/lib/config.inc b/lam/lib/config.inc
index a0ed084d..e50a2aeb 100644
--- a/lam/lib/config.inc
+++ b/lam/lib/config.inc
@@ -309,6 +309,10 @@ function extractConfigOptionsFromPOST($confTypes) {
* @param string $page the URL of the target page
*/
function metaRefresh($page) {
+ if (!headers_sent()) {
+ header('Location: ' . $page);
+ return;
+ }
if (isset($_SESSION['header'])) {
echo $_SESSION['header'];
}
diff --git a/lam/templates/initsuff.php b/lam/templates/initsuff.php
index fcdba617..073679d4 100644
--- a/lam/templates/initsuff.php
+++ b/lam/templates/initsuff.php
@@ -1,9 +1,8 @@
0) {
@@ -161,7 +160,7 @@ if (isset($_POST['add_suff']) || isset($_POST['cancel'])) {
foreach ($failedDNs as $suffix => $error) {
StatusMessage("ERROR", _("Failed to create entry!") . "
" . htmlspecialchars($error), htmlspecialchars($suffix));
}
- include 'main_footer.php';
+ include '../lib/adminFooter.inc';
}
else {
// print success message
@@ -172,7 +171,7 @@ if (isset($_POST['add_suff']) || isset($_POST['cancel'])) {
else {
// no suffixes were created
StatusMessage("INFO", "", _("No changes were made."));
- include 'main_footer.php';
+ include '../lib/adminFooter.inc';
}
exit;
}
@@ -183,24 +182,24 @@ $newSuffixes = str_replace("\\", "", $newSuffixes);
$newSuffixes = str_replace("'", "", $newSuffixes);
$newSuffixes = explode(";", $newSuffixes);
-include 'main_header.php';
+include '../lib/adminHeader.inc';
echo '';
echo "
\n";
echo "
\n";
-include 'main_footer.php';
+include '../lib/adminFooter.inc';
?>
diff --git a/lam/templates/lists/deletelink.php b/lam/templates/lists/deletelink.php
index f3cf5919..d21ae1ad 100644
--- a/lam/templates/lists/deletelink.php
+++ b/lam/templates/lists/deletelink.php
@@ -64,9 +64,9 @@ if (isset($dn) && isset($type)) {
}
else {
// print error message if arguments are missing
- include '../main_header.php';
+ include '../../lib/adminHeader.inc';
StatusMessage("ERROR", "No account or type given.");
- include '../main_footer.php';
+ include '../../lib/adminFooter.inc';
}
?>
diff --git a/lam/templates/lists/userlink.php b/lam/templates/lists/userlink.php
index 9c838244..0941768d 100644
--- a/lam/templates/lists/userlink.php
+++ b/lam/templates/lists/userlink.php
@@ -1,10 +1,11 @@
";
- echo "" . _("Back to group list") . "
";
- include '../main_footer.php';
+ include '../../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';
}
diff --git a/lam/templates/tools/ou_edit.php b/lam/templates/tools/ou_edit.php
index cdb49bf8..86dc0508 100644
--- a/lam/templates/tools/ou_edit.php
+++ b/lam/templates/tools/ou_edit.php
@@ -118,7 +118,7 @@ if (isset($_POST['createOU']) || isset($_POST['deleteOU'])) {
$info = ldap_get_entries($_SESSION['ldap']->server(), $sr);
if ($sr && $info['count'] == 0) {
// print header
- include '../main_header.php';
+ include '../../lib/adminHeader.inc';
echo '';
echo "";
echo '
';
- include '../main_footer.php';
+ include '../../lib/adminFooter.inc';
exit();
}
else {