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

« back to all changes in this revision

Viewing changes to src/right_main.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
 * right_main.php
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 is where the mailboxes are listed. This controls most of what
10
10
 * goes on in SquirrelMail.
11
11
 *
12
 
 * $Id: right_main.php,v 1.111 2004/02/01 20:50:02 ebullient Exp $
 
12
 * @version $Id: right_main.php,v 1.104.2.8 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/mailbox_display.php');
26
29
require_once(SM_PATH . 'functions/display_messages.php');
27
30
require_once(SM_PATH . 'functions/html.php');
 
31
require_once(SM_PATH . 'functions/plugin.php');
28
32
 
29
33
/***********************************************************
30
34
 * incoming variables from URL:                            *
54
58
sqgetGlobalVar('numMessages'      , $numMessages,       SQ_SESSION);
55
59
sqgetGlobalVar('session',           $session,           SQ_GET);
56
60
sqgetGlobalVar('note',              $note,              SQ_GET);
57
 
sqgetGlobalVar('mail_sent',         $mail_sent,         SQ_GET);
58
61
sqgetGlobalVar('use_mailbox_cache', $use_mailbox_cache, SQ_GET);
59
62
 
60
63
if ( sqgetGlobalVar('startMessage', $temp) ) {
61
 
  $startMessage = (int) $temp;
 
64
    $startMessage = (int) $temp;
62
65
}
63
66
if ( sqgetGlobalVar('PG_SHOWNUM', $temp) ) {
64
67
  $PG_SHOWNUM = (int) $temp;
80
83
}
81
84
/* end of get globals */
82
85
 
83
 
 
84
86
/* Open a connection on the imap port (143) */
85
87
 
86
88
$imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
100
102
    $show_num = $PG_SHOWNUM;
101
103
}
102
104
 
103
 
if (isset($newsort) ) {
104
 
    if ( $newsort != $sort )
105
 
        setPref($data_dir, $username, 'sort', $newsort);
106
 
 
107
 
    $sort = $newsort;
108
 
    sqsession_register($sort, 'sort');
109
 
}
 
105
if (!isset($show_num) || empty($show_num) || ($show_num == 0)) {
 
106
    setPref($data_dir, $username, 'show_num' , 15);
 
107
    $show_num = 15;
 
108
}
 
109
 
 
110
if (isset($newsort) && $newsort != $sort) {
 
111
    setPref($data_dir, $username, 'sort', $newsort);
 
112
}
 
113
 
 
114
 
110
115
 
111
116
/* If the page has been loaded without a specific mailbox, */
112
117
/* send them to the inbox                                  */
131
136
    if (isset($set_thread)) {
132
137
        if ($set_thread == 1) {
133
138
            setPref($data_dir, $username, "thread_$mailbox", 1);
134
 
            $thread_sort_messages = '1';    
 
139
            $thread_sort_messages = '1';
135
140
        }
136
141
        elseif ($set_thread == 2)  {
137
142
            setPref($data_dir, $username, "thread_$mailbox", 0);
138
 
            $thread_sort_messages = '0';    
 
143
            $thread_sort_messages = '0';
139
144
        }
140
145
    }
141
146
    else {
144
149
}
145
150
else {
146
151
    $thread_sort_messages = 0;
147
 
 
152
}
148
153
 
149
154
do_hook ('generic_header');
150
155
 
152
157
 
153
158
if ($composenew) {
154
159
    $comp_uri = SM_PATH . 'src/compose.php?mailbox='. urlencode($mailbox).
155
 
                "&session=$session";
 
160
        "&session=$session";
156
161
    displayPageHeader($color, $mailbox, "comp_in_new('$comp_uri');", false);
157
162
} else {
158
163
    displayPageHeader($color, $mailbox);
159
164
}
 
165
 
160
166
do_hook('right_main_after_header');
161
 
 
162
 
/* display a message to the user that their mail has been sent */
163
 
if (isset($mail_sent) && $mail_sent == 'yes') {
164
 
    $note = _("Your Message has been sent.");
165
 
}
166
167
if (isset($note)) {
167
 
    echo html_tag( 'div', '<b>' . $note .'</b>', 'center' ) . "<br>\n";
 
168
    echo html_tag( 'div', '<b>' . $note .'</b>', 'center' ) . "<br />\n";
168
169
}
169
170
 
170
171
if ( sqgetGlobalVar('just_logged_in', $just_logged_in, SQ_SESSION) ) {
175
176
        if (strlen(trim($motd)) > 0) {
176
177
            echo html_tag( 'table',
177
178
                        html_tag( 'tr',
178
 
                            html_tag( 'td', 
 
179
                            html_tag( 'td',
179
180
                                html_tag( 'table',
180
181
                                    html_tag( 'tr',
181
182
                                        html_tag( 'td', $motd, 'center' )
188
189
    }
189
190
}
190
191
 
 
192
if (isset($newsort)) {
 
193
    $sort = $newsort;
 
194
    sqsession_register($sort, 'sort');
 
195
}
191
196
 
192
197
/*********************************************************************
193
198
 * Check to see if we can use cache or not. Currently the only time  *
199
204
    $use_mailbox_cache = 0;
200
205
}
201
206
 
 
207
 
202
208
if ($use_mailbox_cache && sqsession_is_registered('msgs')) {
203
209
    showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color, $show_num, $use_mailbox_cache);
204
210
} else {
216
222
 
217
223
    $numMessages = sqimap_get_num_messages ($imapConnection, $mailbox);
218
224
 
219
 
    showMessagesForMailbox($imapConnection, $mailbox, $numMessages, 
 
225
    showMessagesForMailbox($imapConnection, $mailbox, $numMessages,
220
226
                           $startMessage, $sort, $color, $show_num,
221
227
                           $use_mailbox_cache);
222
228
 
223
229
    if (sqsession_is_registered('msgs') && isset($msgs)) {
224
230
        sqsession_register($msgs, 'msgs');
225
 
        //$_SESSION['msgs'] = $msgs;
226
231
    }
227
232
 
228
233
    if (sqsession_is_registered('msort') && isset($msort)) {
229
234
        sqsession_register($msort, 'msort');
230
 
        //$_SESSION['msort'] = $msort;
231
235
    }
232
236
 
233
237
    sqsession_register($numMessages, 'numMessages');
234
 
    //$_SESSION['numMessages'] = $numMessages;
235
238
}
236
239
do_hook('right_main_bottom');
237
240
sqimap_logout ($imapConnection);
238
241
 
239
242
echo '</body></html>';
240
243
 
241
 
?>
 
244
?>
 
 
b'\\ No newline at end of file'