📄 folders.php
字号:
<?php
require( "./inc/inc.php" );
if ( !$UM->mail_connect( ) )
{
header( "Location: error.php?err=1&sid={$sid}&tid={$tid}&lid={$lid}\r\n" );
}
if ( !$UM->mail_auth( ) )
{
header( "Location: badlogin.php?sid={$sid}&tid={$tid}&lid={$lid}\r\n" );
exit( );
}
$newfolder = trim( $newfolder );
if ( $newfolder != "" && ereg( "[A-Za-z0-9 -]", $newfolder ) && !file_exists( $userfolder.$newfolder ) )
{
$UM->mail_create_box( $newfolder );
}
if ( $delfolder != "" && $delfolder != "inbox" && $delfolder != "sent" && $delfolder != "trash" && ereg( "[A-Za-z0-9 -]", $delfolder ) && strpos( $delfolder, ".." ) === false && $UM->mail_delete_box( $delfolder ) )
{
unset( $this->headers->base64_encode( strtolower( $delfolder ) ) );
}
if ( isset( $empty ) )
{
$headers = $sess['headers'][base64_encode( strtolower( $empty ) )];
$i = 0;
for ( ; $i < count( $headers ); ++$i )
{
$UM->mail_delete_msg( $headers[$i], $prefs['save-to-trash'] );
$expunge = true;
}
if ( $expunge )
{
$UM->mail_expunge( );
unset( $this->headers->base64_encode( strtolower( $empty ) ) );
if ( $prefs['save-to-trash'] )
{
unset( $this->headers->base64_encode( "trash" ) );
}
$SS->save( $sess );
}
if ( isset( $goback ) )
{
header( "Location: msglist.php?folder=".urlencode( $folder )."&sid={$sid}&tid={$tid}&lid={$lid}" );
}
}
$jssource = "\r\n<script language=\"JavaScript\">\r\nfunction newmsg() { location = 'newmsg.php?pag={$pag}&folder=".urlencode( $folder )."&sid={$sid}&tid={$tid}&lid={$lid}'; }\r\nfunction refreshlist() { location = 'folders.php?folder=".urlencode( $folder )."&sid={$sid}&tid={$tid}&lid={$lid}'}\r\nfunction goend() { location = 'logout.php?sid={$sid}&tid={$tid}&lid={$lid}'; }\r\nfunction search() { location = 'search.php?sid={$sid}&tid={$tid}&lid={$lid}'; }\r\nfunction goinbox() { location = 'msglist.php?folder=inbox&sid={$sid}&tid={$tid}&lid={$lid}'; }\r\nfunction emptytrash() {\tlocation = 'folders.php?empty=trash&folder=".urlencode( $folder )."&goback=true&sid={$sid}&tid={$tid}&lid={$lid}';}\r\nfunction addresses() { location = 'addressbook.php?sid={$sid}&tid={$tid}&lid={$lid}'; }\r\nfunction prefs() { location = 'preferences.php?sid={$sid}&tid={$tid}&lid={$lid}'; }\r\nfunction create() {\r\n\tstrPat = /[^A-Za-z0-9 -]/;\r\n\tfrm = document.forms[0];\r\n\tstrName = frm.newfolder.value\r\n\tmathArray = strName.match(strPat)\r\n\tif(mathArray != null) {\r\n\t\talert('".ereg_replace( "'", "\\'", $error_invalid_name )."')\r\n\t\treturn false;\r\n\t}else\r\n\t\tfrm.submit();\r\n}\r\n</script>\r\n";
$smarty->assign( "umJS", $jssource );
$smarty->assign( "umLid", $lid );
$smarty->assign( "umSid", $sid );
$smarty->assign( "umUserEmail", $sess['email'] );
$boxes = $UM->mail_list_boxes( );
$scounter = 0;
$pcounter = 0;
$n = 0;
for ( ; $n < count( $boxes ); ++$n )
{
$entry = $boxes[$n]['name'];
$unread = 0;
if ( !is_array( $sess['headers'][base64_encode( strtolower( $entry ) )] ) )
{
$thisbox = $UM->mail_list_msgs( $entry );
$sess['headers'][base64_encode( strtolower( $entry ) )] = $thisbox;
}
else
{
$thisbox = $sess['headers'][base64_encode( strtolower( $entry ) )];
}
$boxsize = 0;
$i = 0;
for ( ; $i < count( $thisbox ); ++$i )
{
if ( !eregi( "\\SEEN", $thisbox[$i]['flags'] ) )
{
++$unread;
}
$boxsize += $thisbox[$i]['size'];
}
$delete = " ";
if ( !ereg( "(inbox|sent|trash)", strtolower( $entry ) ) )
{
$delete = "<a href=\"folders.php?delfolder={$entry}&folder={$folder}&sid={$sid}&tid={$tid}&lid={$lid}\">OK</a>";
}
$boxname = $entry;
if ( $unread != 0 )
{
$unread = "<b>{$unread}</b>";
}
if ( ereg( "(inbox|sent|trash)", strtolower( $entry ) ) )
{
$system[$scounter]['entry'] = strtolower( $entry );
$system[$scounter]['name'] = $boxname;
$system[$scounter]['msgs'] = count( $thisbox )."/{$unread}";
$system[$scounter]['del'] = $delete;
$system[$scounter]['boxsize'] = ceil( $boxsize / 1024 );
$system[$scounter]['chlink'] = "msglist.php?folder=".strtolower( $entry )."&sid={$sid}&tid={$tid}&lid={$lid}";
$system[$scounter]['emptylink'] = "folders.php?empty=".strtolower( $entry )."&folder=".strtolower( $entry )."&sid={$sid}&tid={$tid}&lid={$lid}";
++$scounter;
}
else
{
$personal[$pcounter]['entry'] = $entry;
$personal[$pcounter]['name'] = $boxname;
$personal[$pcounter]['msgs'] = count( $thisbox )."/{$unread}";
$personal[$pcounter]['del'] = $delete;
$personal[$pcounter]['boxsize'] = ceil( $boxsize / 1024 );
$personal[$pcounter]['chlink'] = "msglist.php?folder=".urlencode( $entry )."&sid={$sid}&tid={$tid}&lid={$lid}";
$personal[$pcounter]['emptylink'] = "folders.php?empty=".urlencode( $entry )."&folder=".urlencode( $entry )."&sid={$sid}&tid={$tid}&lid={$lid}";
++$pcounter;
}
$totalused += $boxsize;
}
$SS->save( $sess );
$UM->mail_disconnect( );
unset( $SS );
unset( $UM );
array_qsort2( $system, "name" );
$umFolderList = array_merge( $system, $personal );
$smarty->assign( "umFolderList", $umFolderList );
$smarty->assign( "umPersonal", $personal );
$smarty->assign( "umTotalUsed", ceil( $totalused / 1024 ) );
$quota_enabled = $quota_limit ? 1 : 0;
$smarty->assign( "umQuotaEnabled", $quota_enabled );
$smarty->assign( "umQuotaLimit", $quota_limit );
$usageGraph = get_usage_graphic( $totalused / 1024, $quota_limit );
$smarty->assign( "umUsageGraph", $usageGraph );
$noquota = $quota_limit < $totalused / 1024 ? 1 : 0;
$smarty->assign( "umNoQuota", $noquota );
echo $nocache;
$smarty->display( "neotech.net/folders.htm" );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -