~ubuntu-branches/ubuntu/hardy/squirrelmail/hardy-updates

« back to all changes in this revision

Viewing changes to src/login.php

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2005-02-06 21:41:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050206214151-z4n1o8mnttgzuj0y
Tags: 2:1.4.4-3
* Move default_pref config file from /var to /etc, as per Debian policy
  (Closes: #293281)
* [JvW] (finally) override two lintian warnings about nonstandard
  permissions that are intentional (Closes: #293366)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * login.php -- simple login screen
5
5
 *
6
 
 * Copyright (c) 1999-2003 The SquirrelMail Project Team
 
6
 * Copyright (c) 1999-2005 The SquirrelMail Project Team
7
7
 * Licensed under the GNU GPL. For full terms see the file COPYING.
8
8
 *
9
9
 * This a simple login screen. Some housekeeping is done to clean
10
10
 * cookies and find language.
11
11
 *
12
 
 * $Id: login.php,v 1.106 2003/12/01 21:56:56 cigamit Exp $
 
12
 * @version $Id: login.php,v 1.98.2.5 2004/12/27 15:04:00 kink Exp $
13
13
 * @package squirrelmail
14
14
 */
15
15
 
16
 
/** Path for SquirrelMail required files. */
 
16
/**
 
17
 * Path for SquirrelMail required files.
 
18
 * @ignore
 
19
 */
17
20
define('SM_PATH','../');
18
21
 
19
22
/* SquirrelMail required files. */
25
28
require_once(SM_PATH . 'functions/page_header.php');
26
29
require_once(SM_PATH . 'functions/html.php');
27
30
require_once(SM_PATH . 'functions/global.php');
28
 
require_once(SM_PATH . 'functions/imap_general.php');
 
31
require_once(SM_PATH . 'functions/forms.php');
29
32
 
30
33
/**
31
34
 * $squirrelmail_language is set by a cookie when the user selects
50
53
 
51
54
header('Pragma: no-cache');
52
55
 
53
 
/**
54
 
 * This detects if the IMAP server has logins disabled, and if so, 
55
 
 * squelches the display of the login form and puts up a message
56
 
 * explaining the situation.
57
 
 */
58
 
$imap = sqimap_create_stream($imapServerAddress, $imapPort, $use_imap_tls);
59
 
$logindisabled = sqimap_capability($imap,'LOGINDISABLED');
60
 
sqimap_logout($imap);
61
 
if ($logindisabled) {
62
 
    $string = "The IMAP server is reporting that logins are disabled.<br>";
63
 
    if (!$use_imap_tls) {
64
 
        $string .= "The use of TLS may allow SquirrelMail to login.<br>";
65
 
    }
66
 
    $string .= "Please contact your system administrator.";
67
 
    error_box($string,$color);
68
 
    exit;
69
 
}
70
 
 
71
56
do_hook('login_cookie');
72
57
 
73
58
/* Output the javascript onload function. */
89
74
          "  }\n".
90
75
          "// -->\n".
91
76
          "</script>\n";
92
 
 
93
 
if (@file_exists($theme[$theme_default]['PATH']))
94
 
   @include ($theme[$theme_default]['PATH']);
95
 
 
 
77
$custom_css = 'none';
96
78
displayHtmlHeader( "$org_name - " . _("Login"), $header, FALSE );
97
79
 
98
 
echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" onLoad=\"squirrelmail_loginpage_onload()\">" .
99
 
     "\n" . '<form action="redirect.php" method="post">' . "\n";
 
80
echo '<body text="#000000" bgcolor="#FFFFFF" link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="squirrelmail_loginpage_onload();">' .
 
81
     "\n" . addForm('redirect.php', 'post');
100
82
 
101
83
$username_form_name = 'login_username';
102
84
$password_form_name = 'secretkey';
118
100
    }
119
101
}
120
102
 
121
 
if(sqgetGlobalVar('mailto', $mailto)) {
122
 
    $rcptaddress = '<input type="hidden" name="mailto" value="' . urlencode($mailto) . '" />' . "\n";
123
 
} else {
124
 
    $rcptaddress = '';
125
 
}
126
103
echo html_tag( 'table',
127
104
    html_tag( 'tr',
128
105
        html_tag( 'td',
139
116
                html_tag( 'tr',
140
117
                    html_tag( 'td',
141
118
                        '<b>' . sprintf (_("%s Login"), $org_name) . "</b>\n",
142
 
                    'center', $color[0] )
 
119
                    'center', '#DCDCDC' )
143
120
                ) .
144
121
                html_tag( 'tr',
145
122
                    html_tag( 'td',  "\n" .
149
126
                                    _("Name:") ,
150
127
                                'right', '', 'width="30%"' ) .
151
128
                                html_tag( 'td',
152
 
                                    '<input type="text" name="' . $username_form_name .'" value="' . $loginname_value .'" />' ,
 
129
                                    addInput($username_form_name, $loginname_value),
153
130
                                'left', '', 'width="*"' )
154
131
                                ) . "\n" .
155
132
                            html_tag( 'tr',
157
134
                                    _("Password:") ,
158
135
                                'right', '', 'width="30%"' ) .
159
136
                                html_tag( 'td',
160
 
                                    '<input type="password" name="' . $password_form_name . '" />' . "\n" .
161
 
                                    '<input type="hidden" name="js_autodetect_results" value="SMPREF_JS_OFF" />' . "\n" .
162
 
                                    $rcptaddress .
163
 
                                    '<input type="hidden" name="just_logged_in" value="1" />' . "\n",
 
137
                                    addPwField($password_form_name).
 
138
                                    addHidden('js_autodetect_results', SMPREF_JS_OFF).
 
139
                                    addHidden('just_logged_in', '1'),
164
140
                                'left', '', 'width="*"' )
165
141
                            ) ,
166
 
                        'center', $color[4], 'border="0" width="100%"' ) ,
167
 
                    'left', $color[4] )
 
142
                        'center', '#ffffff', 'border="0" width="100%"' ) ,
 
143
                    'left', '#FFFFFF' )
168
144
                ) . 
169
145
                html_tag( 'tr',
170
146
                    html_tag( 'td',
171
 
                        '<center><input type="submit" value="' . _("Login") . '" /></center>',
 
147
                        '<center>'. addSubmit(_("Login")) .'</center>',
172
148
                    'left' )
173
149
                ),
174
 
            '', $color[4], 'border="0" width="350"' ) . '</center>',
 
150
            '', '#ffffff', 'border="0" width="350"' ) . '</center>',
175
151
        'center' )
176
152
    ) ,
177
 
'', $color[4], 'border="0" cellspacing="0" cellpadding="0" width="100%"' );
 
153
'', '#ffffff', 'border="0" cellspacing="0" cellpadding="0" width="100%"' );
178
154
do_hook('login_form');
179
155
echo '</form>' . "\n";
180
156
 
181
157
do_hook('login_bottom');
182
 
echo "</body>\n".
183
 
     "</html>\n";
184
158
?>
 
159
</body></html>
 
 
b'\\ No newline at end of file'