|
|
@ -431,25 +431,25 @@ function get_domain_properties ($domain)
|
|
|
|
global $table_alias, $table_mailbox, $table_domain;
|
|
|
|
global $table_alias, $table_mailbox, $table_domain;
|
|
|
|
$list = array ();
|
|
|
|
$list = array ();
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query ("SELECT COUNT(*) FROM $table_alias
|
|
|
|
$result = db_query ("SELECT COUNT(*) FROM $table_alias
|
|
|
|
LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username
|
|
|
|
LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username
|
|
|
|
WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL)
|
|
|
|
WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL)
|
|
|
|
OR
|
|
|
|
OR
|
|
|
|
($table_alias.domain='$domain'
|
|
|
|
($table_alias.domain='$domain'
|
|
|
|
AND $table_alias.goto LIKE '%,%'
|
|
|
|
AND $table_alias.goto LIKE '%,%'
|
|
|
|
AND $table_mailbox.maildir IS NOT NULL)");
|
|
|
|
AND $table_mailbox.maildir IS NOT NULL)");
|
|
|
|
|
|
|
|
|
|
|
|
$row = db_row ($result['result']);
|
|
|
|
$row = db_row ($result['result']);
|
|
|
|
$list['alias_count'] = $row[0];
|
|
|
|
$list['alias_count'] = $row[0];
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query ("SELECT COUNT(*) FROM $table_mailbox WHERE domain='$domain'");
|
|
|
|
$result = db_query ("SELECT COUNT(*) FROM $table_mailbox WHERE domain='$domain'");
|
|
|
|
$row = db_row ($result['result']);
|
|
|
|
$row = db_row ($result['result']);
|
|
|
|
$list['mailbox_count'] = $row[0];
|
|
|
|
$list['mailbox_count'] = $row[0];
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query ("SELECT SUM(quota) FROM $table_mailbox WHERE domain='$domain'");
|
|
|
|
$result = db_query ("SELECT SUM(quota) FROM $table_mailbox WHERE domain='$domain'");
|
|
|
|
$row = db_row ($result['result']);
|
|
|
|
$row = db_row ($result['result']);
|
|
|
|
$list['quota_sum'] = $row[0];
|
|
|
|
$list['quota_sum'] = $row[0];
|
|
|
|
$list['alias_count'] = $list['alias_count'];
|
|
|
|
$list['alias_count'] = $list['alias_count'];
|
|
|
|
|
|
|
|
|
|
|
|
$list['alias_pgindex']=array ();
|
|
|
|
$list['alias_pgindex']=array ();
|
|
|
|
$list['mbox_pgindex']=array ();
|
|
|
|
$list['mbox_pgindex']=array ();
|
|
|
@ -462,40 +462,40 @@ function get_domain_properties ($domain)
|
|
|
|
$idxlabel="";
|
|
|
|
$idxlabel="";
|
|
|
|
$list['alias_pgindex_count'] = 0;
|
|
|
|
$list['alias_pgindex_count'] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if ( $list['alias_count'] > $page_size )
|
|
|
|
if ( $list['alias_count'] > $page_size )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
while ( $current < $list['alias_count'] )
|
|
|
|
while ( $current < $list['alias_count'] )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
|
|
|
|
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
|
|
|
|
$query = "SELECT $table_alias.address
|
|
|
|
$query = "SELECT $table_alias.address
|
|
|
|
FROM $table_alias
|
|
|
|
FROM $table_alias
|
|
|
|
LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username
|
|
|
|
LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username
|
|
|
|
WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL)
|
|
|
|
WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL)
|
|
|
|
OR
|
|
|
|
OR
|
|
|
|
($table_alias.domain='$domain'
|
|
|
|
($table_alias.domain='$domain'
|
|
|
|
AND $table_alias.goto LIKE '%,%'
|
|
|
|
AND $table_alias.goto LIKE '%,%'
|
|
|
|
AND $table_mailbox.maildir IS NOT NULL)
|
|
|
|
AND $table_mailbox.maildir IS NOT NULL)
|
|
|
|
ORDER BY $table_alias.address LIMIT $limitSql";
|
|
|
|
ORDER BY $table_alias.address LIMIT $limitSql";
|
|
|
|
$result = db_query ("$query");
|
|
|
|
$result = db_query ("$query");
|
|
|
|
$row = db_array ($result['result']);
|
|
|
|
$row = db_array ($result['result']);
|
|
|
|
$tmpstr = $row['address'];
|
|
|
|
$tmpstr = $row['address'];
|
|
|
|
//get first 2 chars
|
|
|
|
//get first 2 chars
|
|
|
|
$idxlabel = $tmpstr[0] . $tmpstr[1] . "-";
|
|
|
|
$idxlabel = $tmpstr[0] . $tmpstr[1] . "-";
|
|
|
|
($current + $page_size - 1 <= $list['alias_count']) ? $current = $current + $page_size - 1 : $current = $list['alias_count'] - 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";
|
|
|
|
$limitSql=('pgsql'==$CONF['database_type']) ? "1 OFFSET $current" : "$current, 1";
|
|
|
|
$query = "SELECT $table_alias.address
|
|
|
|
$query = "SELECT $table_alias.address
|
|
|
|
FROM $table_alias
|
|
|
|
FROM $table_alias
|
|
|
|
LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username
|
|
|
|
LEFT JOIN $table_mailbox ON $table_alias.address=$table_mailbox.username
|
|
|
|
WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL)
|
|
|
|
WHERE ($table_alias.domain='$domain' AND $table_mailbox.maildir IS NULL)
|
|
|
|
OR
|
|
|
|
OR
|
|
|
|
($table_alias.domain='$domain'
|
|
|
|
($table_alias.domain='$domain'
|
|
|
|
AND $table_alias.goto LIKE '%,%'
|
|
|
|
AND $table_alias.goto LIKE '%,%'
|
|
|
|
AND $table_mailbox.maildir IS NOT NULL)
|
|
|
|
AND $table_mailbox.maildir IS NOT NULL)
|
|
|
|
ORDER BY $table_alias.address LIMIT $limitSql";
|
|
|
|
ORDER BY $table_alias.address LIMIT $limitSql";
|
|
|
|
$result = db_query ("$query");
|
|
|
|
$result = db_query ("$query");
|
|
|
|
$row = db_array ($result['result']);
|
|
|
|
$row = db_array ($result['result']);
|
|
|
|
$tmpstr = $row['address'];
|
|
|
|
$tmpstr = $row['address'];
|
|
|
|
$idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1];
|
|
|
|
$idxlabel = $idxlabel . $tmpstr[0] . $tmpstr[1];
|
|
|
|
|
|
|
|
|
|
|
|
$current = $current + 1;
|
|
|
|
$current = $current + 1;
|
|
|
|
|
|
|
|
|
|
|
|