Index: trunk/expressoAdmin1_2/inc/class.maillist.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.maillist.inc.php	(revision 64)
+++ trunk/expressoAdmin1_2/inc/class.maillist.inc.php	(revision 86)
@@ -247,7 +247,10 @@
 				foreach($add_users as $uidnumber)
 				{
-					$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
-					$array_emails_add[] = $mail;
-					$this->db_functions->write_log("Adicionado usuario $mail a lista",$dn,$uidnumber,'','');
+					if ($uidnumber != -1)
+					{
+						$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
+						$array_emails_add[] = $mail;
+						$this->db_functions->write_log("Adicionado usuario $mail a lista",$dn,$uidnumber,'','');
+					}
 				}
 				$this->ldap_functions->add_user2maillist($new_values['uidnumber'], $array_emails_add);
@@ -258,12 +261,15 @@
 				foreach($remove_users as $uidnumber)
 				{
-					$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
+					if ($uidnumber != -1)
+					{
+						$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
 					
-					// Não achei o email do usuário no ldap.
-					if (empty($mail))
-						$mail = $uidnumber;
+						// Não achei o email do usuário no ldap.
+						if (empty($mail))
+							$mail = $uidnumber;
 					
-					$array_emails_remove[] = $mail;
-					$this->db_functions->write_log("Removido usuario $mail da lista",$dn,$uidnumber,'','');
+						$array_emails_remove[] = $mail;
+						$this->db_functions->write_log("Removido usuario $mail da lista",$dn,$uidnumber,'','');
+					}
 				}
 				$this->ldap_functions->remove_user2maillist($new_values['uidnumber'], $array_emails_remove);
@@ -360,7 +366,10 @@
 				foreach($add_users as $uidnumber)
 				{
-					$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
-					$array_emails_add[] = $mail;
-					$this->db_functions->write_log("Adicionado usuario $mail a SCL da lista $dn",'',$uidnumber,'','');
+					if ($uidnumber != -1)
+					{
+						$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
+						$array_emails_add[] = $mail;
+						$this->db_functions->write_log("Adicionado usuario $mail a SCL da lista $dn",'',$uidnumber,'','');
+					}
 				}
 				$result = $this->ldap_functions->add_user2maillist_scl($dn, $array_emails_add);
@@ -378,7 +387,10 @@
 				foreach($remove_users as $uidnumber)
 				{
-					$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
-					$array_emails_remove[] = $mail;
-					$this->db_functions->write_log("Removido usuario $mail da SCP da lista $dn",'',$uidnumber,'','');
+					if ($uidnumber != -1)
+					{
+						$mail = $this->ldap_functions->uidnumber2mail($uidnumber);
+						$array_emails_remove[] = $mail;
+						$this->db_functions->write_log("Removido usuario $mail da SCP da lista $dn",'',$uidnumber,'','');
+					}
 				}
 				$result = $this->ldap_functions->remove_user2maillist_scl($dn, $array_emails_remove);
Index: trunk/expressoAdmin1_2/inc/class.group.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.group.inc.php	(revision 64)
+++ trunk/expressoAdmin1_2/inc/class.group.inc.php	(revision 86)
@@ -332,5 +332,5 @@
 				foreach($add_users as $uidnumber)
 				{
-					if (is_numeric($uidnumber))
+					if (is_numeric($uidnumber) && ($uidnumber != -1))
 					{
 						$this->db_functions->add_user2group($new_values['gidnumber'], $uidnumber);
@@ -352,8 +352,11 @@
 				foreach($remove_users as $uidnumber)
 				{
-					$this->db_functions->remove_user2group($new_values['gidnumber'], $uidnumber);
-					$user = $this->ldap_functions->uidnumber2uid($uidnumber);
-					$array_memberUids_remove[] = $user;
-					$this->db_functions->write_log("Removido usuário $user do grupo $dn.",$dn,'','','');
+					if ($uidnumber != -1)
+					{
+						$this->db_functions->remove_user2group($new_values['gidnumber'], $uidnumber);
+						$user = $this->ldap_functions->uidnumber2uid($uidnumber);
+						$array_memberUids_remove[] = $user;
+						$this->db_functions->write_log("Removido usuário $user do grupo $dn.",$dn,'','','');
+					}
 				}
 				$this->ldap_functions->remove_user2group($new_values['gidnumber'], $array_memberUids_remove);
