FS RT #30363 - Hide Account usage template output in an HTML comment when $hide_usage...
[freeside.git] / FS / FS / access_user.pm
index b740e47..0eaab83 100644 (file)
@@ -1,14 +1,12 @@
 package FS::access_user;
+use base qw( FS::m2m_Common FS::option_Common ); 
 
 use strict;
-use base qw( FS::m2m_Common FS::option_Common ); 
-use vars qw( $DEBUG $me $conf );
+use vars qw( $DEBUG $me );
 use FS::UID;
 use FS::Auth;
 use FS::Conf;
 use FS::Record qw( qsearch qsearchs dbh );
-use FS::access_user_pref;
-use FS::access_usergroup;
 use FS::agent;
 use FS::cust_main;
 use FS::sales;
@@ -265,29 +263,6 @@ sub report_sales {
 Returns links to the the groups this user is a part of, as FS::access_usergroup
 objects (see L<FS::access_usergroup>).
 
-=cut
-
-sub access_usergroup {
-  my $self = shift;
-  qsearch( 'access_usergroup', { 'usernum' => $self->usernum } );
-}
-
-#=item access_groups
-#
-#=cut
-#
-#sub access_groups {
-#
-#}
-#
-#=item access_groupnames
-#
-#=cut
-#
-#sub access_groupnames {
-#
-#}
-
 =item agentnums 
 
 Returns a list of agentnums this user can view (via group membership).
@@ -429,7 +404,7 @@ sub access_right {
     unless ( grep !exists($self->{_ACLcache}{$_}), @$rightname ) {
       warn "$me ACL cache hit for ". join(', ', @$rightname). "\n"
         if $DEBUG;
-      return grep $self->{_ACLcache}{$_}, @$rightname
+      return scalar( grep $self->{_ACLcache}{$_}, @$rightname );
     }
 
     warn "$me ACL cache miss for ". join(', ', @$rightname). "\n"
@@ -481,7 +456,7 @@ sub default_customer_view {
   my $self = shift;
 
   $self->option('default_customer_view')
-    || $conf->config('cust_main-default_view')
+    || FS::Conf->new->config('cust_main-default_view')
     || 'basics'; #s/jumbo/basics/ starting with 3.0
 
 }
@@ -516,7 +491,7 @@ sub spreadsheet_format {
 
   my $f =  $override
         || $self->option('spreadsheet_format') 
-        || $conf->config('spreadsheet_format')
+        || FS::Conf->new->config('spreadsheet_format')
         || 'XLS';
 
   $formats{$f};
@@ -538,6 +513,7 @@ sub is_system_user {
     fs_signup
     fs_bootstrap
     fs_selfserv
+    fs_api
   ) );
 }