-
-
- /* Before starting the session, the base URI must be known. Assuming */
- /* that this file is in the src/ subdirectory (or something). */
- ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
- $base_uri = $regs[1];
-
- header('Pragma: no-cache');
- $location = get_location();
-
- session_set_cookie_params (0, $base_uri);
- session_start();
-
- session_unregister ('user_is_logged_in');
- session_register ('base_uri');
-
- if (! isset($squirrelmail_language) ||
- $squirrelmail_language == '' ) {
- $squirrelmail_language = $squirrelmail_default_language;
- }
- set_up_language($squirrelmail_language, true);
- /* Refresh the language cookie. */
- setcookie('squirrelmail_language', $squirrelmail_language, time()+2592000,$base_uri);
-
- if (!isset($login_username)) {
- echo "<HTML><BODY BGCOLOR=\"#ffffff\">\n" .
- "<BR> <BR>\n" .
- "<CENTER>\n" .
- '<B>' . _("You must be logged in to access this page.") . "</B><BR>" .
- '<A HREF="../src/login.php">' . _("Go to the login page") . "</A>\n" .
- "</CENTER>\n" .
- "</BODY></HTML>\n";
- exit;
- }
-
- if (!session_is_registered('user_is_logged_in')) {
- do_hook ('login_before');
-
- $onetimepad = OneTimePadCreate(strlen($secretkey));
- $key = OneTimePadEncrypt($secretkey, $onetimepad);
- session_register('onetimepad');
-
- /* Verify that username and password are correct. */
- if ($force_username_lowercase) {
- $login_username = strtolower($login_username);
- }
-
- $imapConnection = sqimap_login($login_username, $key, $imapServerAddress, $imapPort, 0);
- if (!$imapConnection) {
- echo "<html><body bgcolor=\"#ffffff\">\n".
- "<br> <br>\n".
- "<center>\n".
- '<b>' . _("There was an error contacting the mail server.") . "</b><br>\n".
- _("Contact your administrator for help.") . "\n".
- "</center>\n".
- "</body></html>\n";
- exit;
- } else {
- $delimiter = sqimap_get_delimiter ($imapConnection);
- }
- sqimap_logout($imapConnection);
- session_register('delimiter');
-
- $username = $login_username;
- session_register ('username');
- setcookie('key', $key, 0, $base_uri);
- do_hook ('login_verified');
- setPref( $data_dir, $username, 'counter',
- getPref( $data_dir, $username, 'counter', 0 ) + 1 );
+}
+
+
+/* Before starting the session, the base URI must be known. Assuming */
+/* that this file is in the src/ subdirectory (or something). */
+ereg ("(^.*/)[^/]+/[^/]+$", $PHP_SELF, $regs);
+$base_uri = $regs[1];
+
+header('Pragma: no-cache');
+$location = get_location();
+
+session_set_cookie_params (0, $base_uri);
+session_start();
+
+session_unregister ('user_is_logged_in');
+session_register ('base_uri');
+
+if (! isset($squirrelmail_language) ||
+ $squirrelmail_language == '' ) {
+ $squirrelmail_language = $squirrelmail_default_language;
+}
+set_up_language($squirrelmail_language, true);
+/* Refresh the language cookie. */
+setcookie('squirrelmail_language', $squirrelmail_language, time()+2592000,$base_uri);
+
+if (!isset($login_username)) {
+ displayHtmlHeader( _("You must be logged in to access this page.") );
+ echo "<BODY BGCOLOR=\"#ffffff\">\n" .
+ "<BR> <BR>\n" .
+ "<CENTER>\n" .
+ '<B>' . _("You must be logged in to access this page.") . "</B><BR>" .
+ '<A HREF="../src/login.php">' . _("Go to the login page") . "</A>\n" .
+ "</CENTER>\n" .
+ "</BODY></HTML>\n";
+ exit;
+}
+
+if (!session_is_registered('user_is_logged_in')) {
+ do_hook ('login_before');
+
+ $onetimepad = OneTimePadCreate(strlen($secretkey));
+ $key = OneTimePadEncrypt($secretkey, $onetimepad);
+ session_register('onetimepad');
+
+ /* Verify that username and password are correct. */
+ if ($force_username_lowercase) {
+ $login_username = strtolower($login_username);