X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_acct.pm;h=58070e7edfeed259b011040f420abd09c7d94269;hb=db4224c7e058492c8e32a39d5b6dd3c3ebe01955;hp=203150f7c9f260abc92d2ba27930d8dded34fe44;hpb=6f1a71826d05033213bda352f8c6753094093f56;p=freeside.git diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 203150f7c..58070e7ed 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -114,12 +114,11 @@ FS::UID->install_callback( sub { $smtpmachine = $conf->config('smtpmachine'); $radius_password = $conf->config('radius-password') || 'Password'; $radius_ip = $conf->config('radius-ip') || 'Framed-IP-Address'; - @pw_set = ( 'A'..'Z' ) if $conf->exists('password-generated-allcaps'); + @pw_set = FS::svc_acct->pw_set; } ); @saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' ); -@pw_set = ( 'a'..'z', 'A'..'Z', '0'..'9', '(', ')', '#', '.', ',' ); sub _cache { my $self = shift; @@ -318,7 +317,7 @@ sub table_info { disable_inventory => 1, }, '_password' => { label => 'Password', - required => 1 + #required => 1 }, 'gid' => { label => 'GID', @@ -338,6 +337,7 @@ sub table_info { 'domsvc' => { label => 'Domain', type => 'select', + select_svc => 1, select_table => 'svc_domain', select_key => 'svcnum', select_label => 'domain', @@ -738,7 +738,7 @@ sub insert { #welcome email my @welcome_exclude_svcparts = $conf->config('svc_acct_welcome_exclude'); - unless ( grep { $_ eq $self->svcpart } @welcome_exclude_svcparts ) { + unless ($FS::svc_Common::noexport_hack or ( grep { $_ eq $self->svcpart } @welcome_exclude_svcparts )) { my $error = ''; my $msgnum = $conf->config('welcome_msgnum', $agentnum); if ( $msgnum ) { @@ -925,7 +925,19 @@ sub delete { } } - my $error = $self->SUPER::delete; # usergroup here + foreach my $svc_phone ( + qsearch( 'svc_phone', { 'forward_svcnum' => $self->svcnum }) + ) { + $svc_phone->set('forward_svcnum', ''); + my $error = $svc_phone->replace; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + } + + my $error = $self->delete_password_history + || $self->SUPER::delete; # usergroup here if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; @@ -1401,8 +1413,7 @@ sub check { $recref->{_password} = $1; } else { return gettext('illegal_password'). " $passwordmin-$passwordmax ". - FS::Msgcat::_gettext('illegal_password_characters'). - ": ". $recref->{_password}; + FS::Msgcat::_gettext('illegal_password_characters'); } if ( $password_noampersand ) { @@ -2399,8 +2410,8 @@ sub last_login_text { Returns a paged search (L) for Call Detail Records associated with this service. For svc_acct, "associated with" means that -either the "src" or the "charged_party" field of the CDR matches the -"username" field of the service. +either the "src" or the "charged_party" field of the CDR matches either +the "username" field of the service or the username@domain label. =cut @@ -2411,6 +2422,7 @@ sub psearch_cdrs { my @where; my $did = dbh->quote($self->username); + my $diddomain = dbh->quote($self->label); my $prefix = $options{'default_prefix'} || ''; #convergent.au '+61' my $prefixdid = dbh->quote($prefix . $self->username); @@ -2426,12 +2438,16 @@ sub psearch_cdrs { if (!$options{'disable_charged_party'}) { push @orwhere, "charged_party = $did", - "charged_party = $prefixdid"; + "charged_party = $prefixdid", + "charged_party = $diddomain" + ; } if (!$options{'disable_src'}) { push @orwhere, "src = $did AND charged_party IS NULL", - "src = $prefixdid AND charged_party IS NULL"; + "src = $prefixdid AND charged_party IS NULL", + "src = $diddomain AND charged_party IS NULL" + ; } push @where, '(' . join(' OR ', @orwhere) . ')';