From 083d1fef19686b9b72f1b92e72a4fa56a3f392a9 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 18 Jul 2008 22:29:09 +0000 Subject: [PATCH] some random cleanups --- FS/FS/UI/Web.pm | 12 ++++++------ FS/FS/h_cust_svc.pm | 2 -- FS/FS/part_export.pm | 1 + FS/FS/part_pkg.pm | 6 +++--- FS/FS/svc_acct.pm | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index e4a9ac1b8..98d812d5e 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -332,8 +332,8 @@ setting is supplied, the cust-fields configuration value. =cut sub cust_fields { - my $svc_x = shift; - warn "FS::UI::Web::cust_fields called for $svc_x ". + my $record = shift; + warn "FS::UI::Web::cust_fields called for $record ". "(cust_fields: @cust_fields)" if $DEBUG > 1; @@ -342,12 +342,12 @@ sub cust_fields { my $seen_unlinked = 0; map { - if ( $svc_x->custnum ) { - warn " $svc_x -> $_" + if ( $record->custnum ) { + warn " $record -> $_" if $DEBUG > 1; - $svc_x->$_(@_); + $record->$_(@_); } else { - warn " ($svc_x unlinked)" + warn " ($record unlinked)" if $DEBUG > 1; $seen_unlinked++ ? '' : '(unlinked)'; } diff --git a/FS/FS/h_cust_svc.pm b/FS/FS/h_cust_svc.pm index 921be3ab9..e03043698 100644 --- a/FS/FS/h_cust_svc.pm +++ b/FS/FS/h_cust_svc.pm @@ -111,8 +111,6 @@ sub h_svc_x { # _upgrade_data # # Used by FS::Upgrade to migrate to a new database. -# -# use FS::UID qw( driver_name dbh ); diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 983e0b012..16aad6dcd 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -411,6 +411,7 @@ sub export_info { # ''; #} +#false laziness w/part_pkg & cdr foreach my $INC ( @INC ) { foreach my $file ( glob("$INC/FS/part_export/*.pm") ) { warn "attempting to load export info from $file\n" if $DEBUG; diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 0b2c53d1b..536cd8940 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -1029,6 +1029,7 @@ sub _upgrade_data { # class method =cut +#false laziness w/part_export & cdr my %info; foreach my $INC ( @INC ) { warn "globbing $INC/FS/part_pkg/*.pm\n" if $DEBUG; @@ -1046,8 +1047,7 @@ foreach my $INC ( @INC ) { next; } unless ( keys %$info ) { - warn "no %info hash found in FS::part_pkg::$mod, skipping\n" - unless $mod =~ /^(passwdfile|null)$/; #hack but what the heck + warn "no %info hash found in FS::part_pkg::$mod, skipping\n"; next; } warn "got plan info from FS::part_pkg::$mod: $info\n" if $DEBUG; @@ -1060,7 +1060,7 @@ foreach my $INC ( @INC ) { } tie %plans, 'Tie::IxHash', - map { $_ => $info{$_} } + map { $_ => $info{$_} } sort { $info{$a}->{'weight'} <=> $info{$b}->{'weight'} } keys %info; diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 3e3ecb5bd..84f52e813 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -1140,7 +1140,7 @@ sub check { $recref->{_password} = $1.$2; } else { - return 'Illegal (crypt-encoded) password'; + return 'Illegal (crypt-encoded) password: '. $recref->{_password}; } } elsif ( $recref->{_password_encoding} eq 'plain' ) { -- 2.11.0