use common footer

This commit is contained in:
Roland Gruber 2010-08-21 09:43:52 +00:00
parent cad8992d9d
commit 291e25e99d
26 changed files with 102 additions and 81 deletions

View File

@ -161,8 +161,8 @@ class lamList {
$this->entries = $this->listSort($this->entries);
}
// show form
echo ("<form action=\"list.php?type=" . $this->type . "&amp;norefresh=true\" method=\"post\">\n");
echo "<div class=\"ui-tabs-panel ui-widget-content ui-corner-bottom\">";
echo ("<form action=\"list.php?type=" . $this->type . "&amp;norefresh=true\" method=\"post\">\n");
// draw account list if accounts were found
if (sizeof($this->entries) > 0) {
// buttons
@ -701,9 +701,9 @@ class lamList {
/**
* Prints the HTML footer.
*/
protected function listPrintFooter() {
echo ("</div></form></div>\n");
echo "</body></html>\n";
protected function listPrintFooter() {
echo ("</form></div>\n");
include '../main_footer.php';
}
/**

View File

@ -910,8 +910,8 @@ function parseHtml($module, $input, $values, $restricted, &$tabindex, $scope) {
}
echo "</tr>\n";
}
echo "</table>\n";
}
echo "</table>\n";
return $ret;
}
@ -1227,8 +1227,7 @@ class accountContainer {
call_user_func_array("StatusMessage", $result[$i]);
}
if ($stopProcessing) {
echo "</body>\n";
echo "</html>\n";
$this->printPageFooter();
return;
}
}
@ -1439,8 +1438,7 @@ class accountContainer {
*/
private function printPageFooter() {
echo "</form>\n";
echo "</body>\n";
echo "</html>\n";
include '../main_footer.php';
}
/**
@ -1501,7 +1499,7 @@ class accountContainer {
private function printModuleTabs() {
// $x is used to count up tabindex
$x=1;
echo '<div id="headerTabs" class="ui-tabs">';
echo '<div class="ui-tabs">';
echo '<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix">';
// Loop for each module
for ($i=0; $i<count($this->order); $i++ ) {

View File

@ -68,8 +68,7 @@ if (isset($_GET['DN'])) {
for ($i=0; $i<sizeof($result); $i++) {
call_user_func_array("StatusMessage", $result[$i]);
}
echo "</body>\n";
echo "</html>\n";
include '../main_footer.php';
die();
}
}

View File

@ -77,6 +77,7 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) {
$_SESSION['account'] = new accountContainer($_GET['type'], 'account');
// Show HTML Page
include 'main_header.php';
echo "<br>\n";
echo "<form action=\"delete.php\" method=\"post\">\n";
echo "<fieldset class=\"".$_GET['type']."edit\"><legend><b>";
echo _('Please confirm:');
@ -112,8 +113,7 @@ if (isset($_GET['type']) && isset($_SESSION['delete_dn'])) {
echo "<input name=\"cancel\" type=\"submit\" value=\"" . _('Cancel') . "\">\n";
echo "</fieldset>\n";
echo "</form>\n";
echo "</body>\n";
echo "</html>\n";
include 'main_footer.php';
}
if ($_POST['cancel']) {
@ -124,6 +124,7 @@ if ($_POST['cancel']) {
if ($_POST['delete']) {
// Show HTML Page
include 'main_header.php';
echo "<br>\n";
echo "<form action=\"delete.php\" method=\"post\">\n";
echo "<input name=\"type\" type=\"hidden\" value=\"" . $_POST['type'] . "\">\n";
echo "<fieldset class=\"".$_POST['type']."edit\"><legend><b>";
@ -232,8 +233,7 @@ if ($_POST['delete']) {
echo "<br><input name=\"cancel\" type=\"submit\" value=\"" . _('Back to list') . "\">\n";
echo "</fieldset>\n";
echo "</form>\n";
echo "</body>\n";
echo "</html>\n";
include 'main_footer.php';
}

View File

@ -150,18 +150,18 @@ if (isset($_POST['add_suff']) || isset($_POST['cancel'])) {
for ($i = 0; $i < sizeof($fail); $i++) {
StatusMessage("ERROR", _("Failed to create entry!") . "<br>" . $error[$i], $fail[$i]);
}
echo "</body></html>\n";
include 'main_footer.php';
}
else {
// print success message
StatusMessage("INFO", "", _("All changes were successful."));
echo "</body></html>\n";
include 'main_footer.php';
}
}
else {
// no suffixes were created
StatusMessage("INFO", "", _("No changes were made."));
echo "</body></html>\n";
include 'main_footer.php';
}
exit;
}
@ -174,17 +174,17 @@ $new_suff = explode(";", $new_suff);
include 'main_header.php';
echo "<p>&nbsp;</p>\n";
echo "<p><font color=\"red\"><b>" . _("The following suffix(es) are missing in LDAP. LAM can create them for you.") . "</b></font></p>\n";
echo "<p>" . _("The following suffix(es) are missing in LDAP. LAM can create them for you.") . "</p>\n";
echo "<p>&nbsp;</p>\n";
// print missing suffixes
for ($i = 0; $i < sizeof($new_suff); $i++) {
echo "<p><b>" . $new_suff[$i] . "</b></p>\n";
echo "<p>" . $new_suff[$i] . "</p>\n";
}
echo "<p>&nbsp;</p>\n";
echo "<form action=\"initsuff.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"new_suff\" value=\"" . implode(";", $new_suff) . "\">\n";
echo "<input type=\"submit\" name=\"add_suff\" value=\"" . _("Create") . "\">";
echo "<input type=\"submit\" name=\"cancel\" value=\"" . _("Cancel") . "\">";
echo "</form>\n";
echo "</body></html>\n";
echo "</form><br>\n";
include 'main_footer.php';
?>

View File

@ -58,7 +58,7 @@ else {
// print error message if arguments are missing
include '../main_header.php';
StatusMessage("ERROR", "No account or type given.");
echo ("</body></html>\n");
include '../main_footer.php';
}
?>

View File

@ -61,7 +61,7 @@ else {
StatusMessage("ERROR", "", _("This user was not found!") . " (" . $user . ")");
echo "<p>&nbsp;</p>";
echo "<p><a href=\"list.php?type=group\">" . _("Back to group list") . "</a></p>";
echo ("</body></html>\n");
include '../main_footer.php';
}

View File

@ -0,0 +1,34 @@
<?php
/*
$Id$
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2010 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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* Footer part of page which closes the tab content area etc.
*
* @package main
* @author Roland Gruber
*/
?>
</div>
</body>
</html>

View File

@ -74,7 +74,7 @@ while ($jsEntry = $jsDir->read()) {
</table>
<br>
<div id="headerTabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<div class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
<?php
$linkList = array();

View File

@ -193,7 +193,6 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
// show links for upload and LDIF export
echo "<h1 align=\"center\">" . _("LAM has checked your input and is now ready to create the accounts.") . "</h1>\n";
echo "<p>&nbsp;</p>\n";
echo "<p align=\"center\">\n";
echo "<table align=\"center\" width=\"80%\"><tr>\n";
echo "<td align=\"center\" width=\"50%\">\n";
echo "<a href=\"massDoUpload.php\"><b>" . _("Upload accounts to LDAP") . "</b></a>";
@ -202,7 +201,6 @@ if ($_FILES['inputfile'] && ($_FILES['inputfile']['size'] > 0)) {
echo "<a href=\"massBuildAccounts.php?showldif=true\"><b>" . _("Show LDIF file") . "</b></a>";
echo "</td>\n";
echo "</tr></table>\n";
echo "</p>\n";
}
}
}
@ -212,8 +210,6 @@ else {
echo '<br><a href="masscreate.php">' . _('Back') . '</a>';
}
echo "</body>\n";
echo "</html>\n";
include 'main_footer.php';
?>

View File

@ -117,12 +117,11 @@ if (($_SESSION['mass_counter'] < sizeof($accounts)) || !isset($_SESSION['mass_po
echo "<script type=\"text/javascript\">\n";
echo "top.location.href = \"massDoUpload.php\";\n";
echo "</script>\n";
echo "</body></html>";
include 'main_footer.php';
}
// all accounts have been created
else {
$_SESSION['cache']->refresh_cache(true);
echo "</head>\n<body>\n";
echo "<h1>" . _("LDAP upload has finished") . "</h1>\n";
if (sizeof($_SESSION['mass_errors']) > 0) {
echo "<h2>" . _("There were errors while uploading:") . "</h2>\n";
@ -130,7 +129,7 @@ else {
call_user_func_array('StatusMessage', $_SESSION['mass_errors'][$i]);
}
}
echo "</body></html>";
include 'main_footer.php';
}

View File

@ -197,9 +197,7 @@ echo "<table style=\"border-color: grey\" cellpadding=\"10\" border=\"0\" cellsp
echo "</table>\n";
echo "</form>\n";
echo "</body>\n";
echo "</html>\n";
include 'main_footer.php';
/**
* Displays the acount type specific main page of the upload.
@ -369,8 +367,7 @@ function showMainPage($scope, $selectedModules) {
echo "<a href=\"masscreate.php?getCSV=1\"><b>" . _("Download sample CSV file") . "</b></a>\n";
echo "<br><br>\n";
echo "</body>\n";
echo "</html>\n";
include 'main_footer.php';
die;
}

View File

@ -112,7 +112,7 @@ if (isset($_POST['createOU']) || isset($_POST['deleteOU'])) {
"<input type=\"submit\" name=\"sure\" value=\"" . _("Delete") . "\">\n" .
"<input type=\"submit\" name=\"abort\" value=\"" . _("Cancel") . "\">\n" .
"</form>";
echo "</body></html>\n";
include 'main_footer.php';
exit();
}
else {
@ -196,5 +196,5 @@ function display_main($message, $error) {
echo ("<br>\n");
echo ("</form>\n");
echo ("</body></html>\n");
include 'main_footer.php';
}

View File

@ -92,4 +92,5 @@ echo ("<input type=\"submit\" name=\"submit\" value=\"" . _("Delete") . "\">\n")
echo ("<input type=\"submit\" name=\"abort\" value=\"" . _("Cancel") . "\">\n");
echo ("<input type=\"hidden\" name=\"type\" value=\"" . $_GET['type'] . "\">");
echo ("<input type=\"hidden\" name=\"delete\" value=\"" . $_GET['delete'] . "\">");
echo ("</p></form></body></html>\n");
echo ("</p></form>\n");
include '../main_footer.php';

View File

@ -185,5 +185,6 @@ include '../main_header.php';
<br>
</form>
</body>
</html>
<?php
include '../main_footer.php';
?>

View File

@ -697,10 +697,10 @@ foreach($_SESSION['currentPDFStructure'] as $key => $entry) {
<input type="hidden" name="type" value="<?php echo $_GET['type'];?>">
<br><br><br>
</form>
</body>
</html>
<?php
include '../main_footer.php';
/**
* Translates a given field ID (e.g. inetOrgPerson_givenName) to its descriptive name.

View File

@ -83,4 +83,5 @@ echo ("<input type=\"submit\" name=\"submit\" value=\"" . _("Ok") . "\">\n");
echo ("<input type=\"submit\" name=\"abort\" value=\"" . _("Cancel") . "\">\n");
echo ("<input type=\"hidden\" name=\"type\" value=\"$type\">");
echo ("<input type=\"hidden\" name=\"del\" value=\"" . $_GET['del'] . "\">");
echo ("</p></form></body></html>\n");
echo ("</p></form>\n");
include '../main_footer.php';

View File

@ -176,7 +176,6 @@ echo "</fieldset>\n";
echo "<br>\n";
echo "</form>\n";
echo "</body>\n";
echo "</html>\n";
include '../main_footer.php';
?>

View File

@ -117,6 +117,7 @@ if (isset($_POST['save'])) {
// print header
include '../main_header.php';
echo "<br>\n";
// print error messages if any
if (sizeof($errors) > 0) {
@ -260,6 +261,7 @@ echo ("<input tabindex=\"$tabindex\" type=\"submit\" name=\"abort\" value=\"" .
echo "<input type=\"hidden\" name=\"accounttype\" value=\"$type\">\n";
echo "<br><br><br><br>\n";
echo ("</form></body></html>\n");
echo ("</form>\n");
include '../main_footer.php';
?>

View File

@ -431,10 +431,10 @@ if( $view == 'syntaxes' ) {
<?php } } /* End foreach objectClass */ ?>
<?php } /* End else (displaying objectClasses */ ?>
<?php if( ! is_null( $viewvalue ) && ! $viewed )
<?php
if( ! is_null( $viewvalue ) && ! $viewed ) {
StatusMessage("ERROR", sprintf( _('No such schema item: "%s"'), htmlspecialchars( $viewvalue ) ) );
}
include '../main_footer.php';
?>
</body>
</html>

View File

@ -125,8 +125,6 @@ if ($vendorversion != '') {
echo "</table>\n";
echo "</body>\n";
echo "</html>\n";
include 'main_footer.php';
?>

View File

@ -56,8 +56,6 @@ echo "<td style=\"padding:10px;\">" . _("Check if the LDAP schema fits the requi
echo "</table>\n";
echo "</body>\n";
echo "</html>\n";
include '../main_footer.php';
?>

View File

@ -106,9 +106,7 @@ else {
}
echo "</body>\n";
echo "</html>\n";
include '../main_footer.php';
/**
@ -133,11 +131,11 @@ function lamTestLamdaemon($command, $stopTest, $handle, $testText) {
$lamdaemonOk = true;
}
if ($lamdaemonOk) {
echo "<td>" . $okImage . "</td>";
echo "<td nowrap>" . $okImage . "&nbsp;&nbsp;</td>";
echo "<td>" . _("Lamdaemon successfully run.") . "</td>";
}
else {
echo "<td>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td nowrap>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td>\n";
if (!(strpos($output, 'ERROR,') === 0) && !(strpos($output, 'WARN,') === 0)) {
// error messages from console (e.g. sudo)
@ -168,7 +166,7 @@ function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota) {
$okImage = "<img width=16 height=16 src=\"../../graphics/pass.png\" alt=\"\">\n";
$failImage = "<img width=16 height=16 src=\"../../graphics/fail.png\" alt=\"\">\n";
echo "<table class=\"userlist\" rules=\"none\" width=\"750\">\n";
echo "<table class=\"userlist\" rules=\"none\">\n";
flush();
$stopTest = false;
@ -182,12 +180,12 @@ function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota) {
echo "<td>" . _("No lamdaemon server set, please update your LAM configuration settings.") . "</td>";
}
elseif (($_SESSION['config']->get_scriptPath() == null) || (strlen($_SESSION['config']->get_scriptPath()) < 10)) {
echo "<td>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td nowrap>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td>" . _("No lamdaemon path set, please update your LAM configuration settings.") . "</td>";
$stopTest = true;
}
else {
echo "<td>" . $okImage . "&nbsp;&nbsp;</td>\n";
echo "<td nowrap>" . $okImage . "&nbsp;&nbsp;</td>\n";
echo "<td>" . sprintf(_("Using %s as lamdaemon remote server."), $serverName) . "</td>";
}
echo "</tr>\n";
@ -208,11 +206,11 @@ function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota) {
}
}
if ($unixOk) {
echo "<td>" . $okImage . "</td>\n";
echo "<td nowrap>" . $okImage . "&nbsp;&nbsp;</td>\n";
echo "<td>" . sprintf(_("Using %s to connect to remote server."), $userName) . "</td>";
}
else {
echo "<td>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td nowrap>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td>" . sprintf(_("Your LAM admin user (%s) must be a valid Unix account to work with lamdaemon!"), $credentials[0]) . "</td>";
$stopTest = true;
}
@ -233,11 +231,11 @@ function lamRunLamdaemonTestSuite($serverName, $serverTitle, $testQuota) {
}
}
if ($sshOk) {
echo "<td>" . $okImage . "</td>";
echo "<td nowrap>" . $okImage . "&nbsp;&nbsp;</td>";
echo "<td>" . _("SSH connection could be established.") . "</td>";
}
else {
echo "<td>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td nowrap>" . $failImage . "&nbsp;&nbsp;</td>\n";
echo "<td>" . _("Unable to connect to remote server!") . "</td>";
$stopTest = true;
}

View File

@ -54,7 +54,7 @@ $classes = get_cached_schema('objectclasses');
if (!is_array($classes)) {
StatusMessage('ERROR', _('Unable to retrieve schema!'), _('You do not have the required access rights or the LDAP schema is not published by your server.'));
echo "</body></html>\n";
include '../main_footer.php';
die();
}
@ -85,8 +85,7 @@ for ($t = 0; $t < sizeof($types); $t++) {
echo "</table>\n<br>";
}
echo "</body>\n";
echo "</html>\n";
include '../main_footer.php';
/**
* Checks if the object classes and attributes for this module are available.

View File

@ -89,7 +89,6 @@ for ($i = 0; $i < sizeof($tools); $i++) {
echo "</table>\n";
echo "</body>\n";
echo "</html>\n";
include 'main_footer.php';
?>

View File

@ -58,6 +58,8 @@ jQuery('#tab_tree').addClass('ui-tabs-selected');
jQuery('#tab_tree').addClass('ui-state-active');
</script>
</div></div>
</body>
</html>
</div>
<?php
include '../main_footer.php';
?>