summaryrefslogtreecommitdiff
path: root/httemplate/browse/ftp_target.html
blob: 4a578205843d3a50c2b83cb727ed87e91908d5e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<& elements/browse.html,
  'title'       => 'FTP targets',
  'menubar'     => [ 'Add a target' => $p.'edit/ftp_target.html', ],
  'name'        => 'FTP targets',
  'query'       => { 'table'   => 'ftp_target',
                     'hashref' => {},
                   },
  'count_query' => $count_query,
  'header'      => [ '#',
                     'Server',
                     'Username',
                     'Password',
                     'Path',
                     'Protocol',
                     '', #handling
                   ],
  'fields'      => [ 'targetnum',
                     'hostname',
                     'username',
                     'password',
                     'path',
                     sub { 
                       my $ftp_target = shift;
                       my $label;
                       if ($ftp_target->secure) {
                         $label = 'SFTP';
                         $label .= ' (port '.$ftp_target->port.')'
                           if $ftp_target->port != 22;
                       }
                       else {
                         $label = 'FTP';
                         $label .= ' (port '.$ftp_target->port.')'
                           if $ftp_target->port != 21;
                       }
                       $label;
                     },
                     'handling',
                   ],
  'links'       => [ $link, $link ],
&>
</TABLE>

<% include('/elements/footer.html') %>

<%once>

my $count_query = 'SELECT COUNT(*) FROM ftp_target';

</%once>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

my $link = [ $p.'edit/ftp_target.html?', 'targetnum' ];
</%init>