-my @header = ( '#', 'Service', 'Account', 'UID', 'Last Login' );
-my @fields = ( 'svcnum', 'svc', 'email', 'uid', 'last_login_text' );
-my @links = ( $link, $link, $link, $link, $link );
-my $align = 'rlllr';
-my @color = ( '', '', '', '', '' );
-my @style = ( '', '', '', '', '' );
-
-if ( $cgi->param('domain') ) {
- my $svc_domain =
- qsearchs('svc_domain', { 'domain' => $cgi->param('domain') } );
- unless ( $svc_domain ) {
- #it would be nice if this looked more like the other "not found"
- #errors, but this will do for now.
- errorpage("Domain ". $cgi->param('domain'). " not found at all");
- } else {
- push @extra_sql, 'domsvc = '. $svc_domain->svcnum;
- }
+my @header = ( 'Service', 'Account' );
+my @fields = ( 'svc', 'email' );
+my @links = ( $link, $link );
+my $align = 'll';
+my @color = ( '', '' );
+my @style = ( '', '' );
+my @footer = ();
+
+my $conf = new FS::Conf;
+
+if ( $conf->exists('report-showpasswords') #its a terrible idea
+ && $curuser->access_right('List service passwords') #but if you insist...
+ )
+{
+ push @header, emt('Password');
+ push @fields, 'get_cleartext_password';
+ push @links, $link;
+ $align .= 'l';
+ push @color, '';
+ push @style, '';