X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Faccess_user.pm;h=70cef4a6a7ea27e7f6cfc8771a67dd89a75de4ae;hb=782c9989fba6332e28f25187da8d623bddaab466;hp=37871c552e1de68cf7a21fdddccc31aa040f98d3;hpb=b0371bd62e1963ce29aa3119a9d8c7ac710c911a;p=freeside.git diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm index 37871c552..70cef4a6a 100644 --- a/FS/FS/access_user.pm +++ b/FS/FS/access_user.pm @@ -149,7 +149,16 @@ sub htpasswd_kludge { { return ''; } else { - return 'htpasswd exited unsucessfully'; + + if ($? == -1) { + return "htpasswd failed to execute: $!"; + } elsif ($? & 127) { + return sprintf("htpasswd died with signal %d, %s coredump", + ($? & 127), ($? & 128) ? 'with' : 'without' ); + } else { + return sprintf("htpasswd exited with value %d", $? >> 8 ); + } + } } @@ -397,6 +406,12 @@ user has the provided access right Optional table name in which agentnum is being checked. Sometimes required to resolve 'column reference "agentnum" is ambiguous' errors. +=item column + +Optional column name in which agentnum is being checked. + +e.g: column => 'COALESCE ( cust_main.agentnum, prospect_main.agentnum )' + =item viewall_right All agents will be viewable if the current user has the provided access right. @@ -410,7 +425,14 @@ sub agentnums_sql { my( $self ) = shift; my %opt = ref($_[0]) ? %{$_[0]} : @_; - my $agentnum = $opt{'table'} ? $opt{'table'}.'.agentnum' : 'agentnum'; + my $agentnum; + if ( $opt{column} ) { + $agentnum = $opt{column}; + } elsif ( $opt{table} ) { + $agentnum = "$opt{table}.agentnum" + } else { + $agentnum = 'agentnum'; + } my @or = ();