From 310a027b9b72cf7d98c7f3e05b3bd1164077f2ab Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 19 Sep 2001 21:06:17 +0000 Subject: [PATCH] directory hashing remove jeff's lib patch from freeside-apply-credits add freeside-apply-credits to MANIFEST README for pre3-4 --- FS/FS/svc_acct.pm | 24 +++++++++++++++++++----- FS/MANIFEST | 1 + FS/bin/freeside-apply-credits | 1 - README.1.4.0pre3-4 | 6 ++++++ httemplate/docs/config.html | 7 +++++++ 5 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 README.1.4.0pre3-4 diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index a9c93afe3..46208aa22 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -6,6 +6,7 @@ use vars qw( @ISA $nossh_hack $conf $dir_prefix @shells $usernamemin $username_noperiod $shellmachine $useradd $usermod $userdel $mydomain $cyrus_server $cyrus_admin_user $cyrus_admin_pass + $dirhash $icradius_dbh @saltset @pw_set); use Carp; @@ -72,6 +73,7 @@ $FS::UID::callback{'FS::svc_acct'} = sub { } else { $icradius_dbh = ''; } + $dirhash = $conf->config('dirhash') || 0; }; @saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' ); @@ -708,10 +710,21 @@ sub check { $recref->{dir} =~ /^([\/\w\-]*)$/ or return "Illegal directory"; - $recref->{dir} = $1 || - $dir_prefix . '/' . $recref->{username} - #$dir_prefix . '/' . substr($recref->{username},0,1). '/' . $recref->{username} + $recref->{dir} = $1; + unless ( $recref->{dir} ) { + $recref->{dir} = $dir_prefix . '/'; + if ( $dirhash > 0 ) { + for my $h ( 1 .. $dirhash ) { + $recref->{dir} .= substr($recref->{username}, $h-1, 1). '/'; + } + } elsif ( $dirhash < 0 ) { + for my $h ( reverse $dirhash .. -1 ) { + $recref->{dir} .= substr($recref->{username}, $h, 1). '/'; + } + } + $recref->{dir} .= $recref->{username}; ; + } unless ( $recref->{username} eq 'sync' ) { if ( grep $_ eq $recref->{shell}, @shells ) { @@ -881,7 +894,8 @@ sub ssh { my $output_stream = <$writer>; my $error_stream = <$error>; if ( length $error_stream ) { - warn "[FS::svc_acct::ssh] STDERR $error_stream"; + #warn "[FS::svc_acct::ssh] STDERR $error_stream"; + die "[FS::svc_acct::ssh] STDERR $error_stream"; } if ( length $output_stream ) { warn "[FS::svc_acct::ssh] STDOUT $output_stream"; @@ -894,7 +908,7 @@ sub ssh { =head1 VERSION -$Id: svc_acct.pm,v 1.45 2001-09-19 19:41:28 ivan Exp $ +$Id: svc_acct.pm,v 1.46 2001-09-19 21:06:17 ivan Exp $ =head1 BUGS diff --git a/FS/MANIFEST b/FS/MANIFEST index 69123dbfb..b99250d1b 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -7,6 +7,7 @@ bin/freeside-bill bin/freeside-email bin/freeside-print-batch bin/freeside-queued +fin/freeside-apply-credits FS.pm FS/CGI.pm FS/Conf.pm diff --git a/FS/bin/freeside-apply-credits b/FS/bin/freeside-apply-credits index eb5c1f489..ea6a7bdd0 100755 --- a/FS/bin/freeside-apply-credits +++ b/FS/bin/freeside-apply-credits @@ -1,7 +1,6 @@ #!/usr/bin/perl -Tw use strict; -use lib "/usr/lib/perl5/site_perl/5.005/FSTest2"; use vars qw( $user $cust_main @customers ); use FS::UID qw(adminsuidsetup); use FS::Record qw(qsearch); diff --git a/README.1.4.0pre3-4 b/README.1.4.0pre3-4 new file mode 100644 index 000000000..d2fcf7f91 --- /dev/null +++ b/README.1.4.0pre3-4 @@ -0,0 +1,6 @@ +the following is necessary to upgrade from 1.4.0pre3 to pre4 or later. + +install the perl modules and httemplate as per install.html or upgrade8.html + +Run bin/dbdef-create + diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html index b985ebee9..424985b7e 100644 --- a/httemplate/docs/config.html +++ b/httemplate/docs/config.html @@ -43,6 +43,13 @@ All further configuration files and directories are located in
  • cybercash3.2 - CyberCash v3.2 support. Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly' or `mauthcapture'). CCMckLib3_2.pm, CCMckDirectLib3_2.pm and CCMckErrno3_2 are required.
  • cyrus
  • - Integration with Cyrus IMAP Server, three lines: IMAP server, admin username, and admin password. Cyrus::IMAP::Admin should be installed locally and the connection to the server secured.
  • deletecustomers - The existance of this file will enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customers' packages if they cancel service. +
  • dirhash - Optional numeric value to control director hashing. If positive, hashes directories for the specified number of levels from the front of the username. If negative, hashes directories for the specified number of levels from the end of the username. Some examples: +
  • disable_customer_referrals - The existance of this file will disable new customer-to-customer referrals in the web interface.
  • domain - Your domain name.
  • editreferrals - The existance of this file will allow you to change the referral of existing customers. -- 2.11.0