correctly disable/enable accounts @ CP
[freeside.git] / FS / FS / svc_acct.pm
index 2a0c904..b90cbe8 100644 (file)
@@ -840,12 +840,29 @@ sub cp_change {
                         #Debug    => 1,
                       ) or die "$@\n";
 
+  if ( $password =~ /^\*SUSPENDED\* (.*)$/ ) {
+    $password = $1;
+    $app->set_mailbox_status(
+                              Domain       => $mydomain,
+                              Mailbox      => $username,
+                              Other        => 'T',
+                              Other_Bounce => 'T',
+                            );
+  } else {
+    $app->set_mailbox_status(
+                              Domain       => $mydomain,
+                              Mailbox      => $username,
+                              Other        => 'F',
+                              Other_Bounce => 'F',
+                            );
+  }
+  die $app->message."\n" unless $app->ok;
+
   $app->change_mailbox(
                         Domain    => $mydomain,
                         Mailbox   => $username,
                         Password  => $password,
                       );
-
   die $app->message."\n" unless $app->ok;
 
 }