communigate: domain account defaults, RT#7083
[freeside.git] / httemplate / view / svc_acct / basics.html
1 <% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
2
3 <% include('/view/elements/tr.html', label=>'Service',  value=>$part_svc->svc) %>
4 <% include('/view/elements/tr.html', label=>'Username', value=>$svc_acct->username) %>
5 <% include('/view/elements/tr.html', label=>'Domain',   value=>$domain) %>
6
7 % if ( $opt{'communigate'} ) {
8   <% include('/view/elements/tr.html', label=>'Aliases', value=>$svc_acct->cgp_aliases) %>
9 %}
10
11 % if ( $svc_acct->pbxsvc ) {
12   <% include('/view/elements/tr.html', label=>'PBX', value=>$svc_acct->pbx_title) %>
13 %}
14
15 % my $show_pw = '';
16 % my $password = $svc_acct->get_cleartext_password; 
17 % if ( $password =~ /^\*\w+\* (.*)$/ ) {
18 %   $password = $1;
19 %   $show_pw .= '<I>(login disabled)</I> ';
20 % } 
21 % if ( ! $password
22 %      && $svc_acct->_password_encryption ne 'plain'
23 %      && $svc_acct->_password
24 %    )
25 % {
26 %   $show_pw .= '<I>('. uc($svc_acct->_password_encryption). ' encrypted)</I>';
27 % } elsif ( $conf->exists('showpasswords') ) { 
28 %   $show_pw .= '<PRE>'. encode_entities($password). '</PRE>';
29 % } else { 
30 %   $show_pw .= '<I>(hidden)</I>';
31 % } 
32 % $password = ''; 
33 <% include('/view/elements/tr.html', label=>'Password', value=>$show_pw) %>
34
35
36 % if ( $conf->exists('security_phrase') ) {
37   <%include('/view/elements/tr.html', label=>'Security phrase', value=>$svc_acct->sec_phrase)%>
38 % } 
39
40 % if ( $svc_acct->popnum ) {
41 %   my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
42     <% include('/view/elements/tr.html', label=>'Access number', value=>$svc_acct_pop->text) %>
43 % } 
44
45 % if ($svc_acct->uid ne '') { 
46   <% include('/view/elements/tr.html', label=>'UID', value=>$svc_acct->uid) %>
47 % } 
48
49 % if ($svc_acct->gid ne '') { 
50   <% include('/view/elements/tr.html', label=>'GID', value=>$svc_acct->gid) %>
51 % } 
52
53 % if ($svc_acct->finger ne '') { 
54   <% include('/view/elements/tr.html', label=>'Real Name', value=>$svc_acct->finger) %>
55 % } 
56
57 % if ($svc_acct->dir ne '') { 
58   <% include('/view/elements/tr.html', label=>'Home directory', value=>$svc_acct->dir) %>
59 % } 
60
61 % if ($svc_acct->shell ne '') { 
62   <% include('/view/elements/tr.html', label=>'Shell', value=>$svc_acct->shell) %>
63 % } 
64
65 % if ($svc_acct->quota ne '' && ! $opt{'communigate'} ) { 
66
67   <% include('/view/elements/tr.html', label=>'Quota', value=>$svc_acct->quota) %>
68
69 % } elsif ( $opt{'communigate'} ) {
70
71   <% include('/view/elements/tr.html', label=>'Mailbox type', value=>$svc_acct->cgp_type) %>
72
73   <% include('/view/elements/tr.html', label=>'Enabled services',
74                         value=>$svc_acct->cgp_accessmodes ) %>
75
76   <% include('/view/elements/tr.html', label=>'Mail storage limit',
77                         value=>$svc_acct->quota ) %>
78
79   <% include('/view/elements/tr.html', label=>'File storage limit',
80                         value=>$svc_acct->file_quota ) %>
81
82   <% include('/view/elements/tr.html', label=>'Number of files limit',
83                         value=>$svc_acct->file_maxnum ) %>
84
85   <% include('/view/elements/tr.html', label=>'File size limit',
86                         value=>$svc_acct->file_maxsize ) %>
87
88   <% include('/view/elements/tr.html', label=>'Message delete method',
89                         value=>$svc_acct->cgp_deletemode ) %>
90
91   <% include('/view/elements/tr.html', label=>'On logout remove trash',
92                         value=>$svc_acct->cgp_emptytrash ) %>
93
94
95 % }
96
97 % if ($svc_acct->slipip) { 
98   <% include('/view/elements/tr.html',
99        label=>'IP address',
100        value=> ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
101                  ? "<I>(Dynamic)</I>"
102                  : $svc_acct->slipip
103      )
104   %>
105 % } 
106
107 <% include('usage.html',
108              'svc_acct' => $svc_acct,
109           )
110 %>
111
112 % foreach my $attribute ( grep /^radius_/, $svc_acct->fields ) {
113 %   $attribute =~ /^radius_(.*)$/;
114 %   my $pattribute = $FS::raddb::attrib{$1};
115     <% include('/view/elements/tr.html', label=>"Radius (reply) $pattribute",
116                           value=>$svc_acct->getfield($attribute)
117               )
118     %>
119 % } 
120
121 % foreach my $attribute ( grep /^rc_/, $svc_acct->fields ) {
122 %   $attribute =~ /^rc_(.*)$/;
123 %   my $pattribute = $FS::raddb::attrib{$1};
124     <% include('/view/elements/tr.html', label=>"Radius (check) $pattribute",
125                           value=>$svc_acct->getfield($attribute)
126               )
127     %>
128 % } 
129
130 <% include('/view/elements/tr.html', label=>'RADIUS groups',
131                       value=>join('<BR>', $svc_acct->radius_groups) ) %>
132
133 %# Can this be abstracted further?  Maybe a library function like
134 %# widget('HTML', 'view', $svc_acct) ?  It would definitely make UI 
135 %# style management easier.
136 % foreach (sort { $a cmp $b } $svc_acct->virtual_fields) { 
137   <% $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)) %>
138 % } 
139
140 </TABLE></TD></TR></TABLE>
141 <%init>
142
143 my %opt = @_;
144
145 my $conf = new FS::Conf;
146
147 my $svc_acct = $opt{'svc_acct'};
148 my $part_svc = $opt{'part_svc'};
149
150 die 'Empty domsvc for svc_acct.svcnum '. $svc_acct->svcnum
151   unless $svc_acct->domsvc;
152 my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc } );
153 die 'Unknown domain (domsvc '. $svc_acct->domsvc.
154     ' for svc_acct.svcnum '. $svc_acct->svcnum. ')'
155   unless $svc_domain;
156 my $domain = $svc_domain->domain;
157
158 </%init>