~ubuntu-branches/ubuntu/karmic/ldap-account-manager/karmic

« back to all changes in this revision

Viewing changes to templates/config/mainlogin.php

  • Committer: Bazaar Package Importer
  • Author(s): Roland Gruber
  • Date: 2006-05-14 14:00:29 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060514140029-chr2mf30u7bajebu
Tags: 1.0.2-1
Updated to new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
$Id: mainlogin.php,v 1.2 2006/04/18 10:54:49 gruberroland Exp $
 
4
 
 
5
  This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
 
6
  Copyright (C) 2003 - 2006  Roland Gruber
 
7
 
 
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.
 
12
 
 
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.
 
17
 
 
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
 
21
 
 
22
*/
 
23
 
 
24
 
 
25
/**
 
26
* Login page to change the main preferences.
 
27
*
 
28
* @package configuration
 
29
* @author Roland Gruber
 
30
*/
 
31
 
 
32
 
 
33
/** Access to config functions */
 
34
include_once('../../lib/config.inc');
 
35
/** Used to print status messages */
 
36
include_once('../../lib/status.inc');
 
37
 
 
38
// start session
 
39
session_save_path("../../sess");
 
40
@session_start();
 
41
 
 
42
setlanguage();
 
43
 
 
44
// remove settings from session
 
45
if (isset($_SESSION["mainconf_password"])) unset($_SESSION["mainconf_password"]);
 
46
 
 
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");
 
53
                exit();
 
54
        }
 
55
        else {
 
56
                $message = _("The password is invalid! Please try again.");
 
57
        }
 
58
}
 
59
 
 
60
 
 
61
echo $_SESSION['header'];
 
62
 
 
63
?>
 
64
 
 
65
                <title>
 
66
                        <?php
 
67
                                echo _("Login");
 
68
                        ?>
 
69
                </title>
 
70
                <link rel="stylesheet" type="text/css" href="../../style/layout.css">
 
71
        </head>
 
72
        <body>
 
73
                <?php
 
74
                        // set focus on password field
 
75
                        echo "<script type=\"text/javascript\" language=\"javascript\">\n";
 
76
                        echo "<!--\n";
 
77
                        echo "window.onload = function() {\n";
 
78
                                echo "loginField = document.getElementsByName('passwd')[0];\n";
 
79
                                echo "loginField.focus();\n";
 
80
                        echo "}\n";
 
81
                        echo "//-->\n";
 
82
                        echo "</script>\n";
 
83
                ?>
 
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>
 
86
                </p>
 
87
                <hr><br><br>
 
88
                <!-- form to change main options -->
 
89
                <form action="mainlogin.php" method="post">
 
90
                <table align="center" border="2" rules="none" bgcolor="white">
 
91
                        <tr>
 
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>
 
95
                        </tr>
 
96
                        <tr>
 
97
                                <td style="border-style:none" align="center"><b> <?php echo _("Please enter the master password to change the general preferences:"); ?> </b></td>
 
98
                        </tr>
 
99
                        <tr><td style="border-style:none" >&nbsp;</td></tr>
 
100
<?php
 
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)
 
103
                echo "<tr>\n";
 
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";
 
107
                echo "</tr>\n";
 
108
                echo "<tr>\n";
 
109
                        echo "<td style=\"border-style:none\" >&nbsp;</td>\n";
 
110
                echo "</tr>\n";
 
111
        }
 
112
?>
 
113
                        <tr>
 
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
                                        &nbsp;<a href="../help.php?HelpNumber=236" target="lamhelp">
 
119
                                        <img src="../../graphics/help.png" alt="<?php echo _('Help'); ?>" title="<?php echo _('Help'); ?>">
 
120
                                        </a>
 
121
                                </td>
 
122
                                <td style="border-style:none" rowspan="3" width="20"></td>
 
123
                        </tr>
 
124
                        <tr>
 
125
                                <td  style="border-style:none">&nbsp;</td>
 
126
                        </tr>
 
127
                        <tr>
 
128
                                <td style="border-style:none" height="20"></td>
 
129
                        </tr>
 
130
                </table>
 
131
                </form>
 
132
 
 
133
                <p><br><br><br><br><br></p>
 
134
 
 
135
                <!-- back to login page -->
 
136
                <p>
 
137
                        <a href="../login.php"> <?php echo _("Back to Login"); ?> </a>
 
138
                </p>
 
139
 
 
140
        </body>
 
141
</html>