fix quick crypt_password bug when its passwd an empty param
[freeside.git] / FS / FS / svc_acct.pm
index 1daf83a..a045193 100644 (file)
@@ -463,11 +463,6 @@ sub replace {
 
   return "can't modify system account" if $old->_check_system;
 
-  return "Username in use"
-    if $old->username ne $new->username &&
-      qsearchs( 'svc_acct', { 'username' => $new->username,
-                               'domsvc'   => $new->domsvc,
-                             } );
   {
     #no warnings 'numeric';  #alas, a 5.006-ism
     local($^W) = 0;
@@ -1324,13 +1319,15 @@ database.
 
 sub crypt_password {
   my $self = shift;
-  #false laziness w/shellcommands.pm
   #eventually should check a "password-encoding" field
   if ( length($self->_password) == 13
-       || $self->_password =~ /^\$(1|2a?)\$/ ) {
+       || $self->_password =~ /^\$(1|2a?)\$/
+       || $self->_password =~ /^(\*|NP|\*LK\*|!!?)$/
+     )
+  {
     $self->_password;
   } else {
-    my $encryption = scalar(@_) ? shift : 'crypt';
+    my $encryption = ( scalar(@_) && $_[0] ) ? shift : 'crypt';
     if ( $encryption eq 'crypt' ) {
       crypt(
         $self->_password,