#!/usr/bin/perl ######################################### # inbox # deal with inboxing, message display ######################################### use localbucky; $dbh = DBI->connect ($dsn); our ($USER, $lastlog) = checkin(); logout() unless ($USER != -1); if ( defined($input->{object_from_uri}) ) { if ( $input->{object_from_uri} =~ /^[0-9]+$/ ) { $input->{id} ||= $input->{object_from_uri}; } else { $input->{box} ||= $input->{object_from_uri}; } } #$input->{id} ||= $input->{object_from_uri} if defined($input->{object_from_uri}) && ($input->{object_from_uri} =~ /^[0-9]+$/); #$input->{box} ||= $input->{object_from_uri} if defined($input->{object_from_uri}) && ( if (exists($input->{id})) { # display message my $message = get_message($input->{id}); my $bn = $b->{mbox}; $bn =~ s/^$USER->{username}\.//; if ($message == -1) { error("No such message!"); } if ($USER->{username} ne $message->{recipient} && $USER->{username} ne $message->{sender}) { error("You are not the recipient of this message."); } unflag_message($input->{id}); my $header_args= {}; $header_args->{'title'} = $message->{'subject'}; if ($message->{'body'} =~ /body bgcolor="?([#0-9a-fA-F]+)/) { $header_args->{'color'} = $1; } header($header_args); menu(); print "

"; display_message($message); footer(); } elsif ($input->{c} eq "f") { # folder_management_form(); } else { my $box = exists($input->{box}) ? $input->{box} : "inbox"; my $limit = exists($input->{limit}) ? int($input->{limit}) : 50; my $date = exists($input->{start}) ? int($input->{start}) : "now"; header("your $box"); menu(); my $messages = get_messages("$USER->{username}.$box", $limit, $date); my $boxes = get_boxes($USER->{username}); print qq!
!; print < message center
userbox foreach my $b (@$boxes) { my $count = $b->{mcount} || 0; my $bn = $b->{mbox}; $bn =~ s/^$USER->{username}\.//; print qq!! . qq!!; } print <
Compose New Mail
need to find someone?
check the userlist
userbox print qq!
Foldersmsgs
$bn!.hushnull($count, undef, 1).qq!
!; message_list($messages, $box); if (@$messages == $limit) { print qq!

!; $oldest = $messages->[-1]->{date}; print qq(next $limit messages >>); print qq!
\n!; } print qq!
!; footer(); } $dbh->disconnect (); print "Inbox: " . &report_time() . "\n" if $timer;