<?
if(VALID_DOCUMENT != 1) die('what?');
// all actions that uses main design
if(check_www_authentication(true)){
include(TMPLPATH."main_start.php");
// no news, show INBOX instead
if($action=='news' || $action == 'login' || $action == ''){
$action = 'show-folder';
$_GET['mailbox'] = $_SESSION['procmail']->inbox_name;
}
// show headers
if($action == 'show-folder')
include(TMPLPATH."show_headers.php");
// read mail
else if($action == 'read-mail' && $_SESSION['last_mail']){
if($_SESSION['last_headers'] &&
$_SESSION['last_headers']->name == $_SESSION['last_mail']->mailbox_name){
$h = $_SESSION['last_headers']->get_header($_SESSION['last_mail']->key);
if($h) $h->is_unseen = false;
}
$_SESSION['last_mail']->print_presentation();
}
// compose
else if(eregi('^compose',$action))
include(TMPLPATH."compose.php");
// address book
else if(eregi('^addressbook',$action))
include(TMPLPATH."addressbook.php");
// folders
else if(eregi('^folders',$action))
include(TMPLPATH."edit_folders.php");
// settings
else if(eregi('^settings',$action))
include(TMPLPATH."settings.php");
// filters
else if(eregi('^filters',$action))
include(TMPLPATH."filters.php");
// filters
else if(eregi('^restore',$action)){
include(TMPLPATH."restore.php");
}
// filters
else if(eregi('^newsgroups',$action))
include(TMPLPATH."newsgroups.php");
// help
else if($action=='help')
include(TMPLPATH."help.php");
// search
else if($action=='search')
include(TMPLPATH."search_form.php");
print '<hr/>';
include(TMPLPATH."show_folders.php");
include(TMPLPATH."main_end.php");
}
else{ // no session ... login
include(TMPLPATH."html_start.php");
include(TMPLPATH."login_form.php");
include(TMPLPATH."html_end.php");
}
?>