3
$Id: mainlogin.php,v 1.2 2006/04/18 10:54:49 gruberroland Exp $
5
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
6
Copyright (C) 2003 - 2006 Roland Gruber
8
This program is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2 of the License, or
11
(at your option) any later version.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
* Login page to change the main preferences.
28
* @package configuration
29
* @author Roland Gruber
33
/** Access to config functions */
34
include_once('../../lib/config.inc');
35
/** Used to print status messages */
36
include_once('../../lib/status.inc');
39
session_save_path("../../sess");
44
// remove settings from session
45
if (isset($_SESSION["mainconf_password"])) unset($_SESSION["mainconf_password"]);
47
// check if user entered a password
48
if (isset($_POST['passwd'])) {
49
$cfgMain = new CfgMain();
50
if (isset($_POST['passwd']) && ($_POST['passwd'] == $cfgMain->password)) {
51
$_SESSION["mainconf_password"] = $_POST['passwd'];
52
metaRefresh("mainmanage.php");
56
$message = _("The password is invalid! Please try again.");
61
echo $_SESSION['header'];
70
<link rel="stylesheet" type="text/css" href="../../style/layout.css">
74
// set focus on password field
75
echo "<script type=\"text/javascript\" language=\"javascript\">\n";
77
echo "window.onload = function() {\n";
78
echo "loginField = document.getElementsByName('passwd')[0];\n";
79
echo "loginField.focus();\n";
84
<p align="center"><a href="http://lam.sourceforge.net" target="_blank">
85
<img src="../../graphics/banner.jpg" border=1 alt="LDAP Account Manager"></a>
88
<!-- form to change main options -->
89
<form action="mainlogin.php" method="post">
90
<table align="center" border="2" rules="none" bgcolor="white">
92
<td style="border-style:none" rowspan="3" width="20"></td>
93
<td style="border-style:none" height="20"></td>
94
<td style="border-style:none" rowspan="3" width="20"></td>
97
<td style="border-style:none" align="center"><b> <?php echo _("Please enter the master password to change the general preferences:"); ?> </b></td>
99
<tr><td style="border-style:none" > </td></tr>
101
// print message if login was incorrect or no config profiles are present
102
if (isset($message)) { // $message is set by confmain.php (requires conflogin.php then)
104
echo "<td style=\"border-style:none\" rowspan=\"2\"></td>\n";
105
echo "<td style=\"border-style:none\" align=\"center\"><b><font color=red>" . $message . "</font></b></td>\n";
106
echo "<td style=\"border-style:none\" rowspan=\"2\"></td>\n";
109
echo "<td style=\"border-style:none\" > </td>\n";
114
<td style="border-style:none" rowspan="3" width="20"></td>
115
<td style="border-style:none" align="center">
116
<input type="password" name="passwd">
117
<input type="submit" name="submit" value="<?php echo _("Ok"); ?>">
118
<a href="../help.php?HelpNumber=236" target="lamhelp">
119
<img src="../../graphics/help.png" alt="<?php echo _('Help'); ?>" title="<?php echo _('Help'); ?>">
122
<td style="border-style:none" rowspan="3" width="20"></td>
125
<td style="border-style:none"> </td>
128
<td style="border-style:none" height="20"></td>
133
<p><br><br><br><br><br></p>
135
<!-- back to login page -->
137
<a href="../login.php"> <?php echo _("Back to Login"); ?> </a>