@ -260,6 +260,78 @@ function get_domain_properties ($domain)
$list['quota_sum'] = $row[0];
$list['alias_count'] = $list['alias_count'] - $list['mailbox_count'];
$list['alias_pgindex']=array ();
$list['mbox_pgindex']=array ();
//while loop to figure index names. use page_size and loop of queries
$i=0;
$current=0;
$page_size = $CONF['page_size'];
$tmpstr="";
$idxlabel="";
if ( $list['alias_count'] > $page_size )
{
while ( $current < $list['alias_count'] )
{
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
$query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql";
$result = db_query ("$query");
$row = db_array ($result['result']);
$tmpstr = $row['address'];
//get first 2 chars
$idxlabel = $tmpstr[0] . $tmpstr[1] . "-";
($current + $page_size - 1 < = $list['alias_count']) ? $current = $current + $page_size - 1 : $current = $list['alias_count'] - 1;
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
$query = "SELECT $table_alias.address FROM $table_alias LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username WHERE $table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL ORDER BY $table_alias.address LIMIT $limitSql";
$result = db_query ("$query");
$row = db_array ($result['result']);
$tmpstr = $row['address'];
$idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1];
$current = $current + 1;
$list['alias_pgindex'][]=$idxlabel;
$i++;
}
$list['alias_pgindex_count']=$i;
}
$i=0;
$current=0;
$page_size = $CONF['page_size'];
$tmpstr="";
$idxlabel="";
if ( $list['mailbox_count'] > $page_size )
{
while ( $current < $list['mailbox_count'] )
{
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
$query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql";
$result = db_query ("$query");
$row = db_array ($result['result']);
$tmpstr = $row['username'];
//get first 2 chars
$idxlabel = $tmpstr[0] . $tmpstr[1] . "-";
($current + $page_size - 1 < = $list['mailbox_count']) ? $current = $current + $page_size - 1 : $current = $list['mailbox_count'] - 1;
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
$query = "SELECT $table_mailbox.username FROM $table_mailbox WHERE $table_mailbox.domain='$domain' ORDER BY $table_mailbox.username LIMIT $limitSql";
$result = db_query ("$query");
$row = db_array ($result['result']);
$tmpstr = $row['username'];
$idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1];
$current = $current + 1;
$list['mbox_pgindex'][]=$idxlabel;
$i++;
}
$list['mbox_pgindex_count']=$i;
}
// end mod
$query="SELECT * FROM $table_domain WHERE domain='$domain'";
if ('pgsql'==$CONF['database_type'])
{