|
|
|
@ -58,61 +58,61 @@ class DomainHandler extends PFAHandler |
|
|
|
$this->struct = array( |
|
|
|
# field name allow display in... type $PALANG label $PALANG description default / options / ...
|
|
|
|
# editing? form list
|
|
|
|
'domain' => pacol($this->new, 1, 1, 'text', 'domain' , '' , '', array(), |
|
|
|
'domain' => self::pacol($this->new, 1, 1, 'text', 'domain' , '' , '', array(), |
|
|
|
array('linkto' => 'list-virtual.php?domain=%s')), |
|
|
|
'description' => pacol($super, $super, $super, 'text', 'description' , ''), |
|
|
|
'description' => self::pacol($super, $super, $super, 'text', 'description' , ''), |
|
|
|
|
|
|
|
# Aliases
|
|
|
|
'aliases' => pacol($super, $super, 0, 'num' , 'aliases' , 'pAdminEdit_domain_aliases_text' , Config::read('aliases')), |
|
|
|
'alias_count' => pacol(0, 0, 1, 'vnum', '' , '' , '', array(), |
|
|
|
'aliases' => self::pacol($super, $super, 0, 'num' , 'aliases' , 'pAdminEdit_domain_aliases_text' , Config::read('aliases')), |
|
|
|
'alias_count' => self::pacol(0, 0, 1, 'vnum', '' , '' , '', array(), |
|
|
|
/*not_in_db*/ 0, |
|
|
|
/*dont_write_to_db*/ 1, |
|
|
|
/*select*/ 'coalesce(__alias_count,0) - coalesce(__mailbox_count,0) as alias_count', |
|
|
|
/*extrafrom*/ 'left join ( select count(*) as __alias_count, domain as __alias_domain from ' . table_by_key('alias') . |
|
|
|
' group by domain) as __alias on domain = __alias_domain'), |
|
|
|
'aliases_quot' => pacol(0, 0, 1, 'quot', 'aliases' , '' , 0, array(), |
|
|
|
'aliases_quot' => self::pacol(0, 0, 1, 'quot', 'aliases' , '' , 0, array(), |
|
|
|
array('select' => db_quota_text('__alias_count - coalesce(__mailbox_count,0)', 'aliases', 'aliases_quot'))), |
|
|
|
'_aliases_quot_percent' => pacol(0, 0, 1, 'vnum', '' ,'' , 0, array(), |
|
|
|
'_aliases_quot_percent' => self::pacol(0, 0, 1, 'vnum', '' ,'' , 0, array(), |
|
|
|
array('select' => db_quota_percent('__alias_count - coalesce(__mailbox_count,0)', 'aliases', '_aliases_quot_percent'))), |
|
|
|
|
|
|
|
# Mailboxes
|
|
|
|
'mailboxes' => pacol($super, $super, 0, 'num' , 'mailboxes' , 'pAdminEdit_domain_aliases_text' , Config::read('mailboxes')), |
|
|
|
'mailbox_count' => pacol(0, 0, 1, 'vnum', '' , '' , '', array(), |
|
|
|
'mailboxes' => self::pacol($super, $super, 0, 'num' , 'mailboxes' , 'pAdminEdit_domain_aliases_text' , Config::read('mailboxes')), |
|
|
|
'mailbox_count' => self::pacol(0, 0, 1, 'vnum', '' , '' , '', array(), |
|
|
|
/*not_in_db*/ 0, |
|
|
|
/*dont_write_to_db*/ 1, |
|
|
|
/*select*/ 'coalesce(__mailbox_count,0) as mailbox_count', |
|
|
|
/*extrafrom*/ 'left join ( select count(*) as __mailbox_count, sum(quota) as __total_quota, domain as __mailbox_domain from ' . table_by_key('mailbox') . |
|
|
|
' group by domain) as __mailbox on domain = __mailbox_domain'), |
|
|
|
'mailboxes_quot' => pacol(0, 0, 1, 'quot', 'mailboxes' , '' , 0, array(), |
|
|
|
'mailboxes_quot' => self::pacol(0, 0, 1, 'quot', 'mailboxes' , '' , 0, array(), |
|
|
|
array('select' => db_quota_text('__mailbox_count', 'mailboxes', 'mailboxes_quot'))), |
|
|
|
'_mailboxes_quot_percent' => pacol(0, 0, 1, 'vnum', '' , '' , 0, array(), |
|
|
|
'_mailboxes_quot_percent' => self::pacol(0, 0, 1, 'vnum', '' , '' , 0, array(), |
|
|
|
array('select' => db_quota_percent('__mailbox_count', 'mailboxes', '_mailboxes_quot_percent'))), |
|
|
|
|
|
|
|
'maxquota' => pacol($editquota,$editquota,$quota, 'num', 'pOverview_get_quota' , 'pAdminEdit_domain_maxquota_text' , Config::read('maxquota')), |
|
|
|
'maxquota' => self::pacol($editquota,$editquota,$quota, 'num', 'pOverview_get_quota' , 'pAdminEdit_domain_maxquota_text' , Config::read('maxquota')), |
|
|
|
|
|
|
|
# Domain quota
|
|
|
|
'quota' => pacol($edit_dom_q,$edit_dom_q, 0, 'num', 'pAdminEdit_domain_quota' , 'pAdminEdit_domain_maxquota_text' , $domain_quota_default), |
|
|
|
'total_quota' => pacol(0, 0, 1, 'vnum', '' , '' , '', array(), |
|
|
|
'quota' => self::pacol($edit_dom_q,$edit_dom_q, 0, 'num', 'pAdminEdit_domain_quota' , 'pAdminEdit_domain_maxquota_text' , $domain_quota_default), |
|
|
|
'total_quota' => self::pacol(0, 0, 1, 'vnum', '' , '' , '', array(), |
|
|
|
array('select' => "$query_used_domainquota AS total_quota") /*extrafrom*//* already in mailbox_count */), |
|
|
|
'total_quot' => pacol(0, 0, $dom_q, 'quot', 'pAdminEdit_domain_quota' , '' , 0, array(), |
|
|
|
'total_quot' => self::pacol(0, 0, $dom_q, 'quot', 'pAdminEdit_domain_quota' , '' , 0, array(), |
|
|
|
array('select' => db_quota_text($query_used_domainquota, 'quota', 'total_quot'))), |
|
|
|
'_total_quot_percent' => pacol(0, 0, $dom_q, 'vnum', '' , '' , 0, array(), |
|
|
|
'_total_quot_percent' => self::pacol(0, 0, $dom_q, 'vnum', '' , '' , 0, array(), |
|
|
|
array('select' => db_quota_percent($query_used_domainquota, 'quota', '_total_quot_percent'))), |
|
|
|
|
|
|
|
'transport' => pacol($transp, $transp,$transp,'enum', 'transport' , 'pAdminEdit_domain_transport_text' , Config::read('transport_default') , |
|
|
|
'transport' => self::pacol($transp, $transp,$transp,'enum', 'transport' , 'pAdminEdit_domain_transport_text' , Config::read('transport_default') , |
|
|
|
/*options*/ Config::read_array('transport_options')), |
|
|
|
'backupmx' => pacol($super, $super, 1, 'bool', 'pAdminEdit_domain_backupmx' , '' , 0), |
|
|
|
'active' => pacol($super, $super, 1, 'bool', 'active' , '' , 1), |
|
|
|
'default_aliases' => pacol($this->new, $this->new, 0, 'bool', 'pAdminCreate_domain_defaultaliases', '' , 1,array(), /*not in db*/ 1), |
|
|
|
'created' => pacol(0, 0, 0, 'ts', 'created' , ''), |
|
|
|
'modified' => pacol(0, 0, $super, 'ts', 'last_modified' , ''), |
|
|
|
'password_expiry' => pacol($super, $pwexp, $pwexp, 'num', 'password_expiration' , 'password_expiration_desc' , 365), |
|
|
|
'_can_edit' => pacol(0, 0, 1, 'int', '' , '' , 0 , |
|
|
|
'backupmx' => self::pacol($super, $super, 1, 'bool', 'pAdminEdit_domain_backupmx' , '' , 0), |
|
|
|
'active' => self::pacol($super, $super, 1, 'bool', 'active' , '' , 1), |
|
|
|
'default_aliases' => self::pacol($this->new, $this->new, 0, 'bool', 'pAdminCreate_domain_defaultaliases', '' , 1,array(), /*not in db*/ 1), |
|
|
|
'created' => self::pacol(0, 0, 0, 'ts', 'created' , ''), |
|
|
|
'modified' => self::pacol(0, 0, $super, 'ts', 'last_modified' , ''), |
|
|
|
'password_expiry' => self::pacol($super, $pwexp, $pwexp, 'num', 'password_expiration' , 'password_expiration_desc' , 365), |
|
|
|
'_can_edit' => self::pacol(0, 0, 1, 'int', '' , '' , 0 , |
|
|
|
/*options*/ array(), |
|
|
|
/*not_in_db*/ 0, |
|
|
|
/*dont_write_to_db*/ 1, |
|
|
|
/*select*/ $this->is_superadmin . ' as _can_edit'), |
|
|
|
'_can_delete' => pacol(0, 0, 1, 'int', '' , '' , 0 , |
|
|
|
'_can_delete' => self::pacol(0, 0, 1, 'int', '' , '' , 0 , |
|
|
|
/*options*/ array(), |
|
|
|
/*not_in_db*/ 0, |
|
|
|
/*dont_write_to_db*/ 1, |
|
|
|
|