2007-03-24 08:27:00 +01:00
< ? php
2007-09-30 17:53:54 +02:00
/**
* Postfix Admin
*
* LICENSE
* This source file is subject to the GPL license that is bundled with
* this package in the file LICENSE . TXT .
*
* Further details on the project are available at :
* http :// www . postfixadmin . com or http :// postfixadmin . sf . net
*
* @ version $Id $
* @ license GNU GPL v2 or later .
*
* File : list - virtual . php
* List virtual users for a domain .
*
2007-12-02 14:59:33 +01:00
* Template File : list - virtual . php
2007-09-30 17:53:54 +02:00
*
* Template Variables :
*
* tAlias
* tMailbox
*
* Form POST \ GET Variables :
*
* fDomain
* fDisplay
*/
2007-10-31 19:24:40 +01:00
require_once ( 'common.php' );
2007-09-22 12:54:00 +02:00
2008-01-03 22:50:39 +01:00
2007-11-03 23:24:34 +01:00
authentication_require_role ( 'admin' );
2007-03-24 08:27:00 +01:00
2009-07-19 14:25:47 +02:00
$fDomain = false ;
2012-04-09 00:20:55 +02:00
$admin_username = authentication_get_username ();
2007-11-25 01:35:13 +01:00
2007-11-03 23:24:34 +01:00
if ( authentication_has_role ( 'global-admin' )) {
2011-04-24 16:23:32 +02:00
$list_domains = list_domains ();
$is_superadmin = 1 ;
2007-11-03 23:24:34 +01:00
} else {
2011-04-24 16:23:32 +02:00
$list_domains = list_domains_for_admin ( authentication_get_username ());
$is_superadmin = 0 ;
2007-11-03 23:24:34 +01:00
}
2007-03-24 08:27:00 +01:00
$tAlias = array ();
$tMailbox = array ();
2007-08-13 23:26:54 +02:00
$fDisplay = 0 ;
$page_size = $CONF [ 'page_size' ];
2007-03-24 08:27:00 +01:00
2011-04-24 16:23:32 +02:00
if ( $_SERVER [ 'REQUEST_METHOD' ] == " GET " ) {
if ( isset ( $_GET [ 'domain' ])) $fDomain = escape_string ( $_GET [ 'domain' ]);
if ( isset ( $_GET [ 'limit' ])) $fDisplay = intval ( $_GET [ 'limit' ]);
$search = escape_string ( safeget ( 'search' ));
} else {
if ( isset ( $_POST [ 'fDomain' ])) $fDomain = escape_string ( $_POST [ 'fDomain' ]);
if ( isset ( $_POST [ 'limit' ])) $fDisplay = intval ( $_POST [ 'limit' ]);
$search = escape_string ( safepost ( 'search' ));
2007-08-13 23:26:54 +02:00
}
2007-11-03 23:24:34 +01:00
if ( count ( $list_domains ) == 0 ) {
2011-09-30 00:07:27 +02:00
if ( $is_superadmin ) {
flash_error ( $PALANG [ 'no_domains_exist' ]);
} else {
flash_error ( $PALANG [ 'no_domains_for_this_admin' ]);
}
2011-04-24 16:23:32 +02:00
header ( " Location: list-domain.php " ); # no domains (for this admin at least) - redirect to domain list
exit ;
2007-11-03 23:24:34 +01:00
}
2007-03-24 08:27:00 +01:00
2009-12-07 10:21:38 +01:00
if (( is_array ( $list_domains ) and sizeof ( $list_domains ) > 0 )) {
if ( empty ( $fDomain )) {
2012-04-09 00:20:55 +02:00
$fDomain = escape_string ( $list_domains [ 0 ]);
2009-12-07 10:21:38 +01:00
}
}
2007-03-24 08:27:00 +01:00
2009-11-30 15:06:51 +01:00
if ( ! in_array ( $fDomain , $list_domains )) {
2011-04-24 16:23:32 +02:00
flash_error ( $PALANG [ 'invalid_parameter' ] );
header ( " Location: list-domain.php " ); # invalid domain, or not owned by this admin
exit ;
2009-11-30 15:06:51 +01:00
}
if ( ! check_owner ( authentication_get_username (), $fDomain )) {
2011-04-24 16:23:32 +02:00
flash_error ( $PALANG [ 'invalid_parameter' ] . " If you see this message, please open a bugreport " ); # this check is most probably obsoleted by the in_array() check above
header ( " Location: list-domain.php " ); # domain not owned by this admin
exit ( 0 );
2007-11-03 23:24:34 +01:00
}
2007-08-13 23:29:33 +02:00
2009-11-30 15:06:51 +01:00
// store fDomain in $_SESSION so after adding/editing aliases/mailboxes we can
2009-12-24 15:58:01 +01:00
// take the user back to the appropriate domain listing. (see templates/menu.tpl)
2009-11-30 15:06:51 +01:00
if ( $fDomain ) {
$_SESSION [ 'list_virtual_sticky_domain' ] = $fDomain ;
}
2009-11-02 01:24:40 +01:00
#
# alias domain
#
2008-07-27 21:06:55 +02:00
if ( boolconf ( 'alias_domain' )) {
2012-04-09 00:20:55 +02:00
if ( $search == " " ) {
$list_param = " alias_domain=' $fDomain ' OR target_domain=' $fDomain ' " ;
} else {
$list_param = " alias_domain LIKE '% $search %' OR target_domain LIKE '% $search %' " ;
2011-04-24 16:23:32 +02:00
}
2011-04-24 16:08:11 +02:00
2012-04-09 00:20:55 +02:00
$handler = new AliasdomainHandler ( 0 , $admin_username );
if ( $handler -> getList ( $list_param )) {
$tAliasDomains = $handler -> result ();
} else {
$tAliasDomains = array ();
# TODO: check if there was an error or simply no alias domains
}
2011-04-24 16:08:11 +02:00
$can_create_alias_domain = 1 ;
2012-04-09 00:20:55 +02:00
foreach ( $tAliasDomains as $row ) {
if ( $row [ 'alias_domain' ] == $fDomain ) $can_create_alias_domain = 0 ; # domain is already an alias domain
}
# set $can_create_alias_domain = 0 if all domains (of this admin) are already used as alias domains
if ( $handler -> getList ( " 1=1 " )) {
if ( count ( $handler -> result ()) + 1 >= count ( $list_domains ) ) $can_create_alias_domain = 0 ; # all domains (of this admin) are already alias domains
}
2011-04-24 16:23:32 +02:00
}
2008-05-21 23:05:48 +02:00
2009-11-02 01:24:40 +01:00
#
# aliases
#
if ( $search == " " ) {
2012-04-09 01:11:46 +02:00
$list_param = " domain=' $fDomain ' " ;
# sql_domain / sql_where only needed for pagebrowser
2011-04-24 16:23:32 +02:00
$sql_domain = " $table_alias .domain=' $fDomain ' " ;
$sql_where = " " ;
2009-11-02 01:24:40 +01:00
} else {
2012-04-09 01:11:46 +02:00
$list_param = " (address LIKE '% $search %' OR goto LIKE '% $search %') " ;
# sql_domain / sql_where only needed for pagebrowser
2011-04-24 16:23:32 +02:00
$sql_domain = db_in_clause ( " $table_alias .domain " , $list_domains );
$sql_where = " AND ( address LIKE '% $search %' OR goto LIKE '% $search %' ) " ;
2009-11-02 01:24:40 +01:00
}
2009-11-05 15:55:39 +01:00
2011-04-10 22:19:17 +02:00
$alias_pagebrowser_query = "
FROM $table_alias
WHERE $sql_domain AND NOT EXISTS ( SELECT 1 FROM $table_mailbox WHERE username = $table_alias . address ) $sql_where
ORDER BY address
" ;
2012-04-09 01:11:46 +02:00
/*
2011-04-10 22:19:17 +02:00
$query = "
SELECT address , goto , modified , active
$alias_pagebrowser_query
LIMIT $page_size OFFSET $fDisplay
" ;
2012-04-09 01:11:46 +02:00
*/
2009-11-02 01:24:40 +01:00
2012-04-09 01:11:46 +02:00
$handler = new AliasHandler ( 0 , $admin_username );
if ( $handler -> getList ( $list_param , $page_size , $fDisplay )) {
$tAlias = $handler -> result ();
} else {
$tAlias = array ();
# TODO: check if there was an error or simply no aliases
2007-08-13 23:29:33 +02:00
}
2007-03-24 08:27:00 +01:00
2009-11-02 01:24:40 +01:00
2012-04-09 01:11:46 +02:00
2009-11-02 01:24:40 +01:00
#
# mailboxes
#
2010-09-27 01:14:42 +02:00
$display_mailbox_aliases = boolconf ( 'alias_control_admin' );
2009-11-02 01:24:40 +01:00
# build the sql query
2010-09-27 01:14:42 +02:00
$sql_select = " SELECT $table_mailbox .* " ;
2009-11-02 01:24:40 +01:00
$sql_from = " FROM $table_mailbox " ;
$sql_join = " " ;
2009-12-07 10:21:38 +01:00
$sql_where = " WHERE " ;
2009-11-02 01:24:40 +01:00
$sql_order = " ORDER BY $table_mailbox .username " ;
$sql_limit = " LIMIT $page_size OFFSET $fDisplay " ;
if ( $search == " " ) {
2009-12-07 10:21:38 +01:00
$sql_where .= " $table_mailbox .domain=' $fDomain ' " ;
2009-11-02 01:24:40 +01:00
} else {
2009-12-07 10:21:38 +01:00
$sql_where .= db_in_clause ( " $table_mailbox .domain " , $list_domains ) . " " ;
2009-11-02 01:24:40 +01:00
$sql_where .= " AND ( $table_mailbox .username LIKE '% $search %' OR $table_mailbox .name LIKE '% $search %' " ;
if ( $display_mailbox_aliases ) {
$sql_where .= " OR $table_alias .goto LIKE '% $search %' " ;
}
$sql_where .= " ) " ; # $search is already escaped
2007-08-13 23:29:33 +02:00
}
2009-11-02 01:24:40 +01:00
if ( $display_mailbox_aliases ) {
$sql_select .= " , $table_alias .goto " ;
$sql_join .= " LEFT JOIN $table_alias ON $table_mailbox .username= $table_alias .address " ;
2007-08-13 23:29:33 +02:00
}
2009-11-02 01:24:40 +01:00
if ( boolconf ( 'vacation_control_admin' )) {
$sql_select .= " , $table_vacation .active AS v_active " ;
$sql_join .= " LEFT JOIN $table_vacation ON $table_mailbox .username= $table_vacation .email " ;
}
if ( boolconf ( 'used_quotas' ) && boolconf ( 'new_quota_table' )) {
$sql_select .= " , $table_quota2 .bytes as current " ;
$sql_join .= " LEFT JOIN $table_quota2 ON $table_mailbox .username= $table_quota2 .username " ;
}
if ( boolconf ( 'used_quotas' ) && ( ! boolconf ( 'new_quota_table' ) ) ) {
$sql_select .= " , $table_quota .current " ;
$sql_join .= " LEFT JOIN $table_quota ON $table_mailbox .username= $table_quota .username " ;
2010-09-27 01:14:42 +02:00
$sql_where .= " AND ( $table_quota .path='quota/storage' OR $table_quota .path IS NULL ) " ;
2009-11-02 01:24:40 +01:00
}
2011-04-10 22:19:17 +02:00
$mailbox_pagebrowser_query = " $sql_from\n $sql_join\n $sql_where\n $sql_order " ;
$query = " $sql_select\n $mailbox_pagebrowser_query\n $sql_limit " ;
2009-11-02 01:24:40 +01:00
2007-08-13 23:29:33 +02:00
$result = db_query ( $query );
2009-12-07 10:21:38 +01:00
2011-04-24 16:23:32 +02:00
if ( $result [ 'rows' ] > 0 ) {
2011-10-08 00:57:43 +02:00
$delimiter = preg_quote ( $CONF [ 'recipient_delimiter' ], " / " );
$goto_single_rec_del = " " ;
2011-04-24 16:23:32 +02:00
while ( $row = db_array ( $result [ 'result' ])) {
if ( $display_mailbox_aliases ) {
2010-09-28 22:30:56 +02:00
$goto_split = explode ( " , " , $row [ 'goto' ]);
2009-11-02 01:24:40 +01:00
$row [ 'goto_mailbox' ] = 0 ;
$row [ 'goto_other' ] = array ();
foreach ( $goto_split as $goto_single ) {
2011-10-08 00:57:43 +02:00
if ( ! empty ( $CONF [ 'recipient_delimiter' ])) {
$goto_single_rec_del = preg_replace ( '/' . $delimiter . '[^' . $delimiter . '@]*@/' , " @ " , $goto_single );
}
if ( $goto_single == $row [ 'username' ] || $goto_single_rec_del == $row [ 'username' ]) { # delivers to mailbox
2009-11-02 01:24:40 +01:00
$row [ 'goto_mailbox' ] = 1 ;
} elseif ( boolconf ( 'vacation' ) && strstr ( $goto_single , '@' . $CONF [ 'vacation_domain' ]) ) { # vacation alias - TODO: check for full vacation alias
# skip the vacation alias, vacation status is detected otherwise
} else { # forwarding to other alias
$row [ 'goto_other' ][] = $goto_single ;
}
}
2011-04-24 16:23:32 +02:00
}
if ( 'pgsql' == $CONF [ 'database_type' ]) {
// XXX
$row [ 'modified' ] = date ( 'Y-m-d H:i' , strtotime ( $row [ 'modified' ]));
$row [ 'created' ] = date ( 'Y-m-d H:i' , strtotime ( $row [ 'created' ]));
$row [ 'active' ] = ( 't' == $row [ 'active' ]) ? 1 : 0 ;
if ( $row [ 'v_active' ] == NULL ) {
$row [ 'v_active' ] = 'f' ;
}
$row [ 'v_active' ] = ( 't' == $row [ 'v_active' ]) ? 1 : 0 ;
}
$tMailbox [] = $row ;
}
2007-08-13 23:29:33 +02:00
}
2007-10-02 13:57:28 +02:00
$tCanAddAlias = false ;
$tCanAddMailbox = false ;
2011-07-26 02:33:44 +02:00
$tDisplay_back = " " ;
$tDisplay_back_show = " " ;
$tDisplay_up_show = " " ;
$tDisplay_next = " " ;
$tDisplay_next_show = " " ;
2007-10-02 13:57:28 +02:00
$limit = get_domain_properties ( $fDomain );
if ( isset ( $limit )) {
2011-04-24 16:23:32 +02:00
if ( $fDisplay >= $page_size ) {
$tDisplay_back_show = 1 ;
$tDisplay_back = $fDisplay - $page_size ;
}
if (( $limit [ 'alias_count' ] > $page_size ) or ( $limit [ 'mailbox_count' ] > $page_size )) {
$tDisplay_up_show = 1 ;
}
if (
(( $fDisplay + $page_size ) < $limit [ 'alias_count' ]) or
(( $fDisplay + $page_size ) < $limit [ 'mailbox_count' ])
) {
$tDisplay_next_show = 1 ;
$tDisplay_next = $fDisplay + $page_size ;
}
if ( $limit [ 'aliases' ] == 0 ) {
$tCanAddAlias = true ;
}
elseif ( $limit [ 'alias_count' ] < $limit [ 'aliases' ]) {
$tCanAddAlias = true ;
}
if ( $limit [ 'mailboxes' ] == 0 ) {
$tCanAddMailbox = true ;
}
elseif ( $limit [ 'mailbox_count' ] < $limit [ 'mailboxes' ]) {
$tCanAddMailbox = true ;
}
$limit [ 'aliases' ] = eval_size ( $limit [ 'aliases' ]);
$limit [ 'mailboxes' ] = eval_size ( $limit [ 'mailboxes' ]);
2013-03-23 20:32:48 +01:00
if ( boolconf ( 'quota' )) {
$limit [ 'maxquota' ] = eval_size ( $limit [ 'maxquota' ]);
}
2009-11-05 15:55:39 +01:00
}
$gen_show_status = array ();
$check_alias_owner = array ();
if (( is_array ( $tAlias ) and sizeof ( $tAlias ) > 0 ))
2012-04-09 01:11:46 +02:00
foreach ( array_keys ( $tAlias ) as $i ) {
2011-04-24 16:23:32 +02:00
$gen_show_status [ $i ] = gen_show_status ( $tAlias [ $i ][ 'address' ]);
2012-04-09 00:20:55 +02:00
$check_alias_owner [ $i ] = check_alias_owner ( $admin_username , $tAlias [ $i ][ 'address' ]);
2011-04-24 16:23:32 +02:00
}
2009-11-05 15:55:39 +01:00
$gen_show_status_mailbox = array ();
2011-02-08 00:26:17 +01:00
$divide_quota = array ( 'current' => array (), 'quota' => array ());
2009-11-05 15:55:39 +01:00
if (( is_array ( $tMailbox ) and sizeof ( $tMailbox ) > 0 ))
2011-04-24 16:23:32 +02:00
for ( $i = 0 ; $i < sizeof ( $tMailbox ); $i ++ ) {
2011-02-08 00:26:17 +01:00
$gen_show_status_mailbox [ $i ] = gen_show_status ( $tMailbox [ $i ][ 'username' ]);
if ( isset ( $tMailbox [ $i ][ 'current' ])) {
$divide_quota [ 'current' ][ $i ] = divide_quota ( $tMailbox [ $i ][ 'current' ]);
}
if ( isset ( $tMailbox [ $i ][ 'quota' ])) {
$divide_quota [ 'quota' ][ $i ] = divide_quota ( $tMailbox [ $i ][ 'quota' ]);
}
2011-08-08 20:39:03 +02:00
if ( isset ( $tMailbox [ $i ][ 'quota' ]) && isset ( $tMailbox [ $i ][ 'current' ]))
{
$divide_quota [ 'percent' ][ $i ] = min ( 100 , round (( $divide_quota [ 'current' ][ $i ] / max ( 1 , $divide_quota [ 'quota' ][ $i ])) * 100 ));
$divide_quota [ 'quota_width' ][ $i ] = ( $divide_quota [ 'percent' ][ $i ] / 100 * 120 );
2012-04-09 19:55:00 +02:00
} else {
$divide_quota [ 'current' ][ $i ] = 'unknown' ; # TODO: make translateable
$divide_quota [ 'quota_width' ][ $i ] = 0 ; # TODO: use special value?
2011-08-08 20:39:03 +02:00
}
2011-04-24 16:23:32 +02:00
}
2009-11-05 15:55:39 +01:00
class cNav_bar
{
2011-04-24 16:23:32 +02:00
var $count , $title , $limit , $page_size , $pages , $search ; //* arguments
var $url ; //* manually
var $fInit , $arr_prev , $arr_next , $arr_top ; //* internal
var $anchor ;
function cNav_bar ( $aTitle , $aLimit , $aPage_size , $aPages , $aSearch ) {
$this -> count = count ( $aPages );
$this -> title = $aTitle ;
$this -> limit = $aLimit ;
$this -> page_size = $aPage_size ;
$this -> pages = $aPages ;
2010-09-28 22:30:56 +02:00
if ( $aSearch == " " ) {
$this -> search = " " ;
} else {
2010-10-12 22:45:24 +02:00
$this -> search = " &search= " . htmlentities ( $aSearch );
2010-09-28 22:30:56 +02:00
}
2011-04-24 16:23:32 +02:00
$this -> url = '' ;
$this -> fInit = false ;
}
function init () {
$this -> anchor = 'a' . substr ( $this -> title , 3 );
$this -> url .= '#' . $this -> anchor ;
( $this -> limit >= $this -> page_size ) ? $this -> arr_prev = ' <a href="?limit=' . ( $this -> limit - $this -> page_size ) . $this -> search . $this -> url . '"><img border="0" src="images/arrow-l.png" title="' . $GLOBALS [ 'PALANG' ][ 'pOverview_left_arrow' ] . '" alt="' . $GLOBALS [ 'PALANG' ][ 'pOverview_left_arrow' ] . '"/></a> ' : $this -> arr_prev = '' ;
( $this -> limit > 0 ) ? $this -> arr_top = ' <a href="?limit=0' . $this -> search . $this -> url . '"><img border="0" src="images/arrow-u.png" title="' . $GLOBALS [ 'PALANG' ][ 'pOverview_up_arrow' ] . '" alt="' . $GLOBALS [ 'PALANG' ][ 'pOverview_up_arrow' ] . '"/></a> ' : $this -> arr_top = '' ;
(( $this -> limit + $this -> page_size ) < ( $this -> count * $this -> page_size )) ? $this -> arr_next = ' <a href="?limit=' . ( $this -> limit + $this -> page_size ) . $this -> search . $this -> url . '"><img border="0" src="images/arrow-r.png" title="' . $GLOBALS [ 'PALANG' ][ 'pOverview_right_arrow' ] . '" alt="' . $GLOBALS [ 'PALANG' ][ 'pOverview_right_arrow' ] . '"/></a> ' : $this -> arr_next = '' ;
$this -> fInit = true ;
}
function display_pre () {
$ret_val = '<div class="nav_bar"' ;
//$ret_val .= ' style="background-color:#ffa;"';
$ret_val .= '>' ;
$ret_val .= '<table width="730"><colgroup span="1"><col width="550"></col></colgroup> ' ;
$ret_val .= '<tr><td align="left">' ;
return $ret_val ;
}
function display_post () {
$ret_val = '</td></tr></table></div>' ;
return $ret_val ;
}
function display_top () {
$ret_val = '' ;
if ( $this -> count < 1 )
return $ret_val ;
if ( ! $this -> fInit )
$this -> init ();
$ret_val .= '<a name="' . $this -> anchor . '"></a>' ;
$ret_val .= $this -> display_pre ();
$ret_val .= '<b>' . $this -> title . '</b> ' ;
( $this -> limit >= $this -> page_size ) ? $highlight_at = $this -> limit / $this -> page_size : $highlight_at = 0 ;
for ( $i = 0 ; $i < count ( $this -> pages ); $i ++ )
{
$lPage = $this -> pages [ $i ];
2012-04-09 01:18:29 +02:00
if ( $i == $highlight_at ) {
$ret_val .= '<b>' . $lPage . '</b>' . " \n " ;
} else {
$ret_val .= '<a href="?limit=' . ( $i * $this -> page_size ) . $this -> search . $this -> url . '">' . $lPage . '</a>' . " \n " ;
}
2011-04-24 16:23:32 +02:00
}
$ret_val .= '</td><td valign="middle" align="right">' ;
$ret_val .= $this -> arr_prev ;
$ret_val .= $this -> arr_top ;
$ret_val .= $this -> arr_next ;
$ret_val .= $this -> display_post ();
return $ret_val ;
}
function display_bottom () {
$ret_val = '' ;
if ( $this -> count < 1 )
return $ret_val ;
if ( ! $this -> fInit )
$this -> init ();
$ret_val .= $this -> display_pre ();
$ret_val .= '</td><td valign="middle" align="right">' ;
$ret_val .= $this -> arr_prev ;
$ret_val .= $this -> arr_top ;
$ret_val .= $this -> arr_next ;
$ret_val .= $this -> display_post ();
return $ret_val ;
}
2007-08-13 23:29:33 +02:00
}
2007-03-24 08:27:00 +01:00
2011-04-10 22:19:17 +02:00
$pagebrowser_alias = create_page_browser ( " $table_alias .address " , $alias_pagebrowser_query );
$nav_bar_alias = new cNav_bar ( $PALANG [ 'pOverview_alias_title' ], $fDisplay , $CONF [ 'page_size' ], $pagebrowser_alias , $search );
2009-11-05 15:55:39 +01:00
$nav_bar_alias -> url = '&domain=' . $fDomain ;
2011-04-10 22:19:17 +02:00
$pagebrowser_mailbox = create_page_browser ( " $table_mailbox .username " , $mailbox_pagebrowser_query );
$nav_bar_mailbox = new cNav_bar ( $PALANG [ 'pOverview_mailbox_title' ], $fDisplay , $CONF [ 'page_size' ], $pagebrowser_mailbox , $search );
2009-11-05 15:55:39 +01:00
$nav_bar_mailbox -> url = '&domain=' . $fDomain ;
//print $nav_bar_alias->display_top ();
2011-04-24 16:23:32 +02:00
2007-12-02 17:54:15 +01:00
// this is why we need a proper template layer.
$fDomain = htmlentities ( $fDomain , ENT_QUOTES );
2009-11-05 15:55:39 +01:00
2011-02-08 00:26:17 +01:00
if ( empty ( $_GET [ 'domain' ])) {
$_GET [ 'domain' ] = '' ;
}
2009-12-24 15:58:01 +01:00
$smarty -> assign ( 'select_options' , select_options ( $list_domains , array ( $fDomain )), false );
$smarty -> assign ( 'nav_bar_alias' , array ( 'top' => $nav_bar_alias -> display_top (), 'bottom' => $nav_bar_alias -> display_bottom ()), false );
$smarty -> assign ( 'nav_bar_mailbox' , array ( 'top' => $nav_bar_mailbox -> display_top (), 'bottom' => $nav_bar_mailbox -> display_bottom ()), false );
2009-11-05 15:55:39 +01:00
2010-09-27 01:14:42 +02:00
$smarty -> assign ( 'fDomain' , $fDomain , false );
$smarty -> assign ( 'search' , $search );
2009-11-05 15:55:39 +01:00
$smarty -> assign ( 'list_domains' , $list_domains );
$smarty -> assign ( 'limit' , $limit );
$smarty -> assign ( 'tDisplay_back_show' , $tDisplay_back_show );
$smarty -> assign ( 'tDisplay_back' , $tDisplay_back );
$smarty -> assign ( 'tDisplay_up_show' , $tDisplay_up_show );
$smarty -> assign ( 'tDisplay_next_show' , $tDisplay_next_show );
$smarty -> assign ( 'tDisplay_next' , $tDisplay_next );
2012-04-09 00:20:55 +02:00
$smarty -> assign ( 'tAliasDomains' , $tAliasDomains );
2011-04-24 16:08:11 +02:00
$smarty -> assign ( 'can_create_alias_domain' , $can_create_alias_domain );
2009-11-05 15:55:39 +01:00
$smarty -> assign ( 'tAlias' , $tAlias );
2010-09-27 01:14:42 +02:00
$smarty -> assign ( 'gen_show_status' , $gen_show_status , false );
2009-11-05 15:55:39 +01:00
$smarty -> assign ( 'check_alias_owner' , $check_alias_owner );
$smarty -> assign ( 'tCanAddAlias' , $tCanAddAlias );
$smarty -> assign ( 'tMailbox' , $tMailbox );
2010-09-27 01:14:42 +02:00
$smarty -> assign ( 'gen_show_status_mailbox' , $gen_show_status_mailbox , false );
2009-11-05 15:55:39 +01:00
$smarty -> assign ( 'boolconf_used_quotas' , boolconf ( 'used_quotas' ));
$smarty -> assign ( 'divide_quota' , $divide_quota );
$smarty -> assign ( 'tCanAddMailbox' , $tCanAddMailbox );
$smarty -> assign ( 'display_mailbox_aliases' , $display_mailbox_aliases );
if ( isset ( $_GET [ 'tab' ]))
2011-04-24 16:23:32 +02:00
$_SESSION [ 'tab' ] = $_GET [ 'tab' ];
2009-11-05 15:55:39 +01:00
//if (empty ($_GET ['tab']))
2011-04-24 16:23:32 +02:00
// unset ($_SESSION ['tab']);
2009-11-05 15:55:39 +01:00
if ( ! isset ( $_SESSION [ 'tab' ]))
2011-10-30 00:16:16 +02:00
$_SESSION [ 'tab' ] = 'all' ;
2009-11-05 15:55:39 +01:00
$smarty -> assign ( 'tab' , $_SESSION [ 'tab' ]);
$smarty -> assign ( 'smarty_template' , 'list-virtual' );
$smarty -> display ( 'index.tpl' );
2007-03-24 08:27:00 +01:00
2009-05-08 01:23:21 +02:00
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
2007-03-24 08:27:00 +01:00
?>