Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / FS / FS / ClientAPI / MyAccount / contact.pm
index 5690f86..c893c10 100644 (file)
@@ -33,6 +33,8 @@ sub contact_passwd {
   $error = 'Password too long.'
     if length($p->{'new_password'}) > ($conf->config('passwordmax') || 8);
 
+  $error ||= $contact->is_password_allowed($p->{'new_password'});
+
   $error ||= $contact->change_password($p->{'new_password'});
 
   return { 'error' => $error };
@@ -82,7 +84,7 @@ sub list_contacts {
       #TODO: contact phone numbers
       'comment'            => $_->comment,
       'selfservice_access' => $_->selfservice_access,
-      'disabled'           => $contact->disabled,
+      #'disabled'           => $contact->disabled,
     };
   } $cust_main->cust_contact );
 
@@ -141,7 +143,7 @@ sub delete_contact {
   my $error = $cust_contact->delete;
   return { 'error' => $error } if $error;
 
-  unless ( $contact->cust_contact ) {
+  unless ( $contact->cust_contact || $contact->prospect_contact ) {
     $contact->delete;
   }