X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_acct.pm;h=e67db43c6b265150672ebfd69270be8e638d2c78;hb=7d68066ea33f9f85fe14ce663372642d7ec2ad20;hp=6596354302eb9fa4f5359033b4499f84e1feefcd;hpb=171119e612fffaf5f0f053feffd12c55c72a4965;p=freeside.git diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 659635430..e67db43c6 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -1163,6 +1163,7 @@ sub check { my $cust_pkg; local $username_letter = $username_letter; + local $username_uppercase = $username_uppercase; if ($self->svcnum) { my $cust_svc = $self->cust_svc or return "no cust_svc record found for svcnum ". $self->svcnum; @@ -1174,6 +1175,8 @@ sub check { if ($cust_pkg) { $username_letter = $conf->exists('username-letter', $cust_pkg->cust_main->agentnum); + $username_uppercase = + $conf->exists('username-uppercase', $cust_pkg->cust_main->agentnum); } my $ulen = $usernamemax || $self->dbdef_table->column('username')->length; @@ -1464,7 +1467,7 @@ sub set_password { if ( !$encoding ) { # set encoding to system default ($encoding, $encryption) = - split(/-/, lc($conf->config('default-password-encoding'))); + split(/-/, lc($conf->config('default-password-encoding') || '')); $encoding ||= 'legacy'; $self->_password_encoding($encoding); } @@ -2521,7 +2524,8 @@ sub check_password { if ( $self->_password_encoding eq 'ldap' ) { - my $auth = from_rfc2307 Authen::Passphrase $self->_password; + $password =~ s/^{PLAIN}/{CLEARTEXT}/; + my $auth = from_rfc2307 Authen::Passphrase $password; return $auth->match($check_password); } elsif ( $self->_password_encoding eq 'crypt' ) { @@ -2848,6 +2852,9 @@ sub search { push @where, "svcpart = $1"; } + # sector and tower + my @where_sector = $class->tower_sector_sql($params); + push @where, @where_sector if @where_sector; # here is the agent virtualization #if ($params->{CurrentUser}) { @@ -2875,6 +2882,9 @@ sub search { ' LEFT JOIN cust_pkg USING ( pkgnum ) '. ' LEFT JOIN cust_main USING ( custnum ) '; + $addl_from .= ' LEFT JOIN tower_sector USING ( sectornum )' + if @where_sector; + my $count_query = "SELECT COUNT(*) FROM svc_acct $addl_from $extra_sql"; #if ( keys %svc_acct ) { # $count_query .= ' WHERE '.