Index: trunk/expressoAdmin1_2/inc/class.user.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.user.inc.php	(revision 396)
+++ trunk/expressoAdmin1_2/inc/class.user.inc.php	(revision 414)
@@ -269,5 +269,5 @@
 				}
 
-				$this->db_functions->write_log("criado usuario $dn",'','','','');
+				$this->db_functions->write_log("created user",$dn);
 			}
 
@@ -307,5 +307,5 @@
 			{
 				$return['status'] = false;
-				$return['msg'] = 'Você não tem direito de editar informações de usuários.';
+				$return['msg'] = lang('You do not have access to edit user informations') . '.';
 				return $return;
 			}
@@ -331,5 +331,5 @@
 						{
 							$dn = $newrdn . ',' . $newparent;
-							$this->db_functions->write_log('alterado contexto do usuario' . $new_values['uid'] . ' de: ' . $old_values['context'] . ' para: ' . $new_values['context'],'',$dn,'','');
+							$this->db_functions->write_log('modified user context', $dn . ': ' . $old_values['uid'] . '->' . $new_values['context']);
 						}
 					}
@@ -342,5 +342,5 @@
 					$ldap_mod_replace['givenname'] = $new_values['givenname'];
 					$ldap_mod_replace['cn'] = $new_values['givenname'] . ' ' . $new_values['sn'];
-					$this->db_functions->write_log("alterado givenname do usuario $dn de ".$old_values['givenname']." para ".$new_values['givenname'],'','','','');
+					$this->db_functions->write_log("modified first name", "$dn: " . $old_values['givenname'] . "->" . $new_values['givenname']);
 				}
 				if ($diff['sn'])
@@ -348,5 +348,5 @@
 					$ldap_mod_replace['sn'] = $new_values['sn'];
 					$ldap_mod_replace['cn'] = $new_values['givenname'] . ' ' . $new_values['sn'];
-					$this->db_functions->write_log("altera sn do usuario de ".$old_values['sn']." para ".$new_values['sn'],'','','','');
+					$this->db_functions->write_log("modified last name", "$dn: " . $old_values['sn'] . "->" . $new_values['sn']);
 				}
 				if ($diff['mail'])
@@ -355,24 +355,12 @@
 					$this->ldap_functions->replace_user2maillists($new_values['mail'], $old_values['mail']);
 					$this->ldap_functions->replace_mail_from_institutional_account($new_values['mail'], $old_values['mail']);
-					$this->db_functions->write_log("alterado mail do usuario $dn de " . $old_values['mail'] . " para " . $new_values['mail'],'','','','');
-				}
-				/*
-				if (($diff['mailalternateaddress']) && ($old_values['mailalternateaddress'] != ''))
-				{
-					$ldap_mod_replace['mailalternateaddress'] = $new_values['mailalternateaddress'];
-					$this->db_functions->write_log("alterado mailalternateaddress do usuario",'',$dn,'','');
-				}
-				if (($diff['mailforwardingaddress']) && ($old_values['mailforwardingaddress'] != ''))
-				{
-					$ldap_mod_replace['mailforwardingaddress'] = $new_values['mailforwardingaddress'];
-					$this->db_functions->write_log("alterado mailforwardingaddress do usuario",'',$dn,'','');
-				}
-				*/
+					$this->db_functions->write_log("modified user email", "$dn: " . $old_values['mail'] . "->" . $new_values['mail']);
+				}
 				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 				// Passwd Expired - Com atributo
-				if (($old_values['passwd_expired'] != '') && ($new_values['passwd_expired'] == '1'))
+				if (($old_values['passwd_expired'] != 0) && ($new_values['passwd_expired'] == '1'))
 				{
 					$ldap_mod_replace['phpgwlastpasswdchange'] = '0';
-					$this->db_functions->write_log("Expirado senha do usuário $dn",'','','','');
+					$this->db_functions->write_log("Expired user password","$dn");
 				}
 			}
@@ -406,5 +394,5 @@
 					}
 					
-					$this->db_functions->write_log("alterado password do usuario $dn",'','','','');
+					$this->db_functions->write_log("modified user password",$dn);
 				}
 			}
@@ -416,5 +404,5 @@
 				{
 					$ldap_mod_replace['telephonenumber'] = $new_values['telephonenumber'];
-					$this->db_functions->write_log("alterado telephonenumber do usuario $dn de ".$old_values['telephonenumber']." para ".$new_values['telephonenumber'],'','','','');
+					$this->db_functions->write_log('modified user telephonenumber', $dn . ': ' . $old_values['telephonenumber'] . '->' . $new_values['telephonenumber']);
 				}
 			}
@@ -432,22 +420,22 @@
 					{
 						$ldap_atribute = str_replace("corporative_information_", "", $atribute);
-						// REPLACE ATTRS OF CORPORATIVE
+						// REPLACE CORPORATIVE ATTRIBUTES
 						if (($diff[$atribute]) && ($old_values[$atribute] != ''))
 						{
 							$ldap_atribute = str_replace("corporative_information_", "", $atribute);
-							$ldap_mod_replace[$ldap_atribute] = $new_values[$atribute];
-							$this->db_functions->write_log("alterado $ldap_atribute do usuario $dn de ".$old_values[$atribute]." para ".$new_values[$atribute],'','','','');
-						}
-						//ADD ATTRS OF CORPORATIVE
+							$ldap_mod_replace[$ldap_atribute] = utf8_encode($new_values[$atribute]);
+							$this->db_functions->write_log('modified user attribute', $dn . ': ' . $ldap_atribute . ': ' . $old_values[$atribute] . '->' . $new_values[$atribute]);
+						}
+						//ADD CORPORATIVE ATTRIBUTES
 						elseif (($old_values[$atribute] == '') && ($new_values[$atribute] != ''))
 						{
-							$ldap_add[$ldap_atribute] = $new_values[$atribute];
-							$this->db_functions->write_log("adicionado $ldap_atribute ao usuario $dn de ".$old_values[$atribute]." para ".$new_values[$atribute],'','','','');
-						}
-						//REMOVE ATTRS OF CORPORATIVE
+							$ldap_add[$ldap_atribute] = utf8_encode($new_values[$atribute]);
+							$this->db_functions->write_log('added user attribute', $dn . ': ' . $ldap_atribute . ': ' . $old_values[$atribute] . '->' . $new_values[$atribute]);
+						}
+						//REMOVE CORPORATIVE ATTRIBUTES
 						elseif (($old_values[$atribute] != '') && ($new_values[$atribute] == ''))
 						{
 							$ldap_remove[$ldap_atribute] = array();
-							$this->db_functions->write_log("removido $ldap_atribute do usuario $dn de ".$old_values[$atribute]." para ".$new_values[$atribute],'','','','');	
+							$this->db_functions->write_log('removed user attribute', $dn . ': ' . $ldap_atribute . ': ' . $old_values[$atribute] . '->' . $new_values[$atribute]);	
 						}
 					}
@@ -463,5 +451,5 @@
 				{
 					$ldap_mod_replace['gidnumber'] = $new_values['gidnumber'];
-					$this->db_functions->write_log("alterado gidnumber do usuario $dn. De:".$old_values['gidnumber']." Para:".$new_values['gidnumber'],'','','','');
+					$this->db_functions->write_log('modified user primary group', $dn . ': ' . $old_values['gidnumber'] . '->' . $new_values['gidnumber']);
 				}
 				
@@ -471,5 +459,5 @@
 					{
 						$ldap_mod_replace['sambaPrimaryGroupSID']	= $this->current_config['expressoAdmin_sambaSID'] . '-' . ((2 * $new_values['gidnumber'])+1001);
-						$this->db_functions->write_log("alterado sambaPrimaryGroupSID do usuario $dn.",'','','','');
+						$this->db_functions->write_log('modified user sambaPrimaryGroupSID', $dn);
 					}
 					
@@ -477,15 +465,15 @@
 					{
 						$ldap_mod_replace['sambaacctflags'] = $new_values['sambaacctflags'];
-						$this->db_functions->write_log("alterado sambaacctflags do usuario $dn",'','','','');
+						$this->db_functions->write_log("modified user sambaacctflags",$dn);
 					}
 					if ($diff['sambalogonscript'])
 					{
 						$ldap_mod_replace['sambalogonscript'] = $new_values['sambalogonscript'];
-						$this->db_functions->write_log("alterado sambalogonscript do usuario $dn",'','','','');
+						$this->db_functions->write_log("modified user sambalogonscript",$dn);
 					}
 					if ($diff['sambahomedirectory'])
 					{
 						$ldap_mod_replace['homedirectory'] = $new_values['sambahomedirectory'];
-						$this->db_functions->write_log("alterado homedirectory do usuario $dn",'','','','');
+						$this->db_functions->write_log("modified user homedirectory",$dn);
 					}
 					if ($diff['sambadomain'])
@@ -493,5 +481,5 @@
 						$ldap_mod_replace['sambaSID']				= $diff['sambadomain'] . '-' . ((2 * $old_values['uidnumber'])+1000);
 						$ldap_mod_replace['sambaPrimaryGroupSID']	= $diff['sambadomain'] . '-' . ((2 * $old_values['gidnumber'])+1001);
-						$this->db_functions->write_log("alterado dominio samba do usuario $dn para " . $params['sambadomain'],'','','','');
+						$this->db_functions->write_log('modified user samba domain', $dn . ': ' . $old_values['sambadomain'] . '->' . $new_values['sambadomain']);
 					}
 				}
@@ -509,5 +497,5 @@
 				{
 					$this->ldap_functions->ldap_remove_photo($dn);
-					$this->db_functions->write_log("removido jpegphoto do usuario $dn",'','','','');
+					$this->db_functions->write_log("removed user photo",$dn);
 				}
 				elseif ($_FILES['photo']['name'] != '')
@@ -517,5 +505,5 @@
 					{
 						$return['status'] = false;
-						$return['msg'] .= 'Foto do usuário não foi salva, pois excede o tamanho máximo de 10 kb.';
+						$return['msg'] .= lang('User photo could not be save because is bigger the 10 kb') . '.';
 					}
 					else
@@ -524,10 +512,10 @@
 						{
 							$photo_exist = true;
-							$this->db_functions->write_log("substituido jpegphoto do usuario $dn",'','','','');
+							$this->db_functions->write_log("mofified user photo",$dn);
 						}
 						else
 						{
 							$photo_exist = false;
-							$this->db_functions->write_log("adicionado jpegphoto ao usuario $dn",'','','','');
+							$this->db_functions->write_log("added user photo",$dn);
 						}				
 						$this->ldap_functions->ldap_save_photo($dn, $_FILES['photo']['tmp_name'], $new_values['photo_exist'], $photo_exist);
@@ -544,10 +532,10 @@
 				{
 					$ldap_add['telephonenumber'] = $new_values['telephonenumber'];
-					$this->db_functions->write_log("adicionado telephonenumber ao usuario $dn",'','','','');
+					$this->db_functions->write_log("added user phone",$dn);
 				}
 				if (($old_values['telephonenumber'] != '') && ($new_values['telephonenumber'] == ''))
 				{
 					$ldap_remove['telephonenumber'] = array();
-					$this->db_functions->write_log("removido telephonenumber do usuario $dn",'','','','');
+					$this->db_functions->write_log("removed user phone",$dn);
 				}
 				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -556,10 +544,10 @@
 				{
 					$ldap_add['phpgwlastpasswdchange'] = '0';
-					$this->db_functions->write_log("Expirado senha do usuário $dn",'','','','');
+					$this->db_functions->write_log("expired user password",$dn);
 				}
 				if (($old_values['passwd_expired'] == '0') && ($new_values['passwd_expired'] == ''))
 				{
 					$ldap_remove['phpgwlastpasswdchange'] = array();
-					$this->db_functions->write_log("Removido expiração da senha do usuário $dn",'','','','');
+					$this->db_functions->write_log("removed expiry from user password",$dn);
 				}
 				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -568,10 +556,10 @@
 				{
 					$this->db_functions->add_pref_changepassword($new_values['uidnumber']);
-					$this->db_functions->write_log("adicionado changepassword ao usuario $dn",'','','','');
+					$this->db_functions->write_log("turn on changepassword",$dn);
 				}
 				if (($old_values['changepassword'] != '') && ($new_values['changepassword'] == ''))
 				{
 					$this->db_functions->remove_pref_changepassword($new_values['uidnumber']);
-					$this->db_functions->write_log("removido changepassword do usuario $dn",'','','','');
+					$this->db_functions->write_log("turn of changepassword",$dn);
 				}
 				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -580,10 +568,10 @@
 				{
 					$ldap_add['phpgwaccountstatus'] = 'A';
-					$this->db_functions->write_log("ativado conta do usuario $dn",'','','','');
+					$this->db_functions->write_log("turn on user account",$dn);
 				}
 				if (($old_values['phpgwaccountstatus'] != '') && ($new_values['phpgwaccountstatus'] == ''))
 				{
 					$ldap_remove['phpgwaccountstatus'] = array();
-					$this->db_functions->write_log("desativado conta do usuario $dn",'','','','');
+					$this->db_functions->write_log("turn off user account",$dn);
 				}
 				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -592,10 +580,10 @@
 				{
 					$ldap_add['phpgwaccountvisible'] = '-1';
-					$this->db_functions->write_log("adicionado phpgwaccountvisible ao usuario $dn",'','','','');
+					$this->db_functions->write_log("turn on phpgwaccountvisible",$dn);
 				}
 				if (($old_values['phpgwaccountvisible'] != '') && ($new_values['phpgwaccountvisible'] == ''))
 				{
 					$ldap_remove['phpgwaccountvisible'] = array();
-					$this->db_functions->write_log("removido phpgwaccountvisible ao usuario $dn",'','','','');
+					$this->db_functions->write_log("turn off phpgwaccountvisible",$dn);
 				}
 				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -604,38 +592,11 @@
 				{
 					$ldap_add['accountstatus'] = 'active';
-					$this->db_functions->write_log("ativado conta de email do usuario $dn",'','','','');
+					$this->db_functions->write_log("turn on user account email",$dn);
 				}
 				if (($old_values['accountstatus'] != '') && ($new_values['accountstatus'] == ''))
 				{
 					$ldap_remove['accountstatus'] = array();
-					$this->db_functions->write_log("desativado conta de email do usuario $dn",'','','','');
-				}
-				/*
-				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-				// MAILALTERNATEADDRESS
-				if (($old_values['mailalternateaddress'] == '') && ($new_values['mailalternateaddress'] != ''))
-				{
-					$ldap_add['mailalternateaddress'] = $new_values['mailalternateaddress'];
-					$this->db_functions->write_log("adicionado mailalternateaddress ao usuario",'',$dn,'','');
-				}
-				if (($old_values['mailalternateaddress'] != '') && ($new_values['mailalternateaddress'] == ''))
-				{
-					$ldap_remove['mailalternateaddress'] = array();
-					$this->db_functions->write_log("removido mailalternateaddress ao usuario",'',$dn,'','');
-				}
-				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-				// MAILFORWARDINGADDRESS
-				if (($old_values['mailforwardingaddress'] == '') && ($new_values['mailforwardingaddress'] != ''))
-				{
-					$ldap_add['mailforwardingaddress'] = $new_values['mailforwardingaddress'];
-					$this->db_functions->write_log("adicionado mailforwardingaddress ao usuario",'',$dn,'','');
-				}
-				if (($old_values['mailforwardingaddress'] != '') && ($new_values['mailforwardingaddress'] == ''))
-				{
-					$ldap_remove['mailforwardingaddress'] = array();
-					$this->db_functions->write_log("removido mailforwardingaddress ao usuario",'',$dn,'','');
-				}
-				*/
-				
+					$this->db_functions->write_log("turn off user account email",$dn);
+				}
 				////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 				// MAILALTERNATEADDRESS
@@ -651,5 +612,5 @@
 					{
 						$ldap_add['mailalternateaddress'][] = $mailalternateaddress;
-						$this->db_functions->write_log("adicionado mailalternateaddress $mailalternateaddress ao usuario $dn",'',$dn,'','');
+						$this->db_functions->write_log("added mailalternateaddress","$dn: $mailalternateaddress");
 					}
 				}
@@ -661,5 +622,5 @@
 						{
 							$ldap_remove['mailalternateaddress'][] = $mailalternateaddress;
-							$this->db_functions->write_log("removido mailalternateaddress $mailalternateaddress do usuario $dn",'',$dn,'','');
+							$this->db_functions->write_log("removed mailalternateaddress","$dn: $mailalternateaddress");
 						}
 					}
@@ -679,5 +640,5 @@
 					{
 						$ldap_add['mailforwardingaddress'][] = $mailforwardingaddress;
-						$this->db_functions->write_log("adicionado mailforwardingaddress $mailforwardingaddress ao usuario $dn",'',$dn,'','');
+						$this->db_functions->write_log("added mailforwardingaddress","$dn: $mailforwardingaddress");
 					}
 				}
@@ -689,5 +650,5 @@
 						{
 							$ldap_remove['mailforwardingaddress'][] = $mailforwardingaddress;
-							$this->db_functions->write_log("removido mailforwardingaddress $mailforwardingaddress do usuario $dn",'',$dn,'','');
+							$this->db_functions->write_log("removed mailforwardingaddress","$dn: $mailforwardingaddress");
 						}
 					}
@@ -699,10 +660,10 @@
 				{
 					$ldap_add['deliverymode'] = 'forwardOnly';
-					$this->db_functions->write_log("adicionado forwardOnly ao usuario $dn",'','','','');
+					$this->db_functions->write_log("added forwardOnly", $dn);
 				}
 				if (($old_values['deliverymode'] != '') && ($new_values['deliverymode'] == ''))
 				{
 					$ldap_remove['deliverymode'] = array();
-					$this->db_functions->write_log("removido forwardOnly ao usuario $dn",'','','','');
+					$this->db_functions->write_log("removed forwardOnly", $dn);
 				}
 			}
@@ -716,5 +677,5 @@
 				{
 					$this->imap_functions->change_user_quota($new_values['uid'], $new_values['mailquota']);
-					$this->db_functions->write_log("alterado cota do usuario $dn",'','','','');
+					$this->db_functions->write_log("modified user email quota", $dn);
 				}
 			}
@@ -739,5 +700,5 @@
 					$ldap_remove['sambaPwdLastSet']			= array();
 					$ldap_remove['sambaPwdMustChange']		= array();
-					$this->db_functions->write_log("removido atributos samba do usuario $dn.",'','','','');
+					$this->db_functions->write_log("removed user samba attributes", $dn);
 				}
 				//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -745,9 +706,10 @@
 				if (($this->current_config['expressoAdmin_samba_support'] == 'true') && (!$new_values['userSamba']) && ($new_values['use_attrs_samba'] == 'on'))
 				{
-					//Verifica se o binario para criar as senhas do samba exite.
 					if (!is_file('/home/expressolivre/mkntpwd'))
 					{
 						$return['status'] = false;
-						$return['msg'] .= "O arquivo binário /home/expressolivre/mkntpwd não exite.\\nEle é necessário para a criação das senhas usadas pelo SAMBA.\\nInforme o administrador ExpressoLivre sobre isto.\\n";
+						$return['msg'] .= lang("The file /home/expressolivre/mkntpwd does not exist") . ".\n";
+						$return['msg'] .= lang("It is necessery to create samba passwords") . ".\n";
+						$return['msg'] .= lang("Inform your system administrator about this") . ".\n";
 					}
 					else
@@ -766,5 +728,5 @@
 						$ldap_add['sambaPwdLastSet']		= strtotime("now");
 						$ldap_add['sambaPwdMustChange']	= '2147483647';
-						$this->db_functions->write_log("adicionado atributos samba ao usuario $dn.",'','','','');
+						$this->db_functions->write_log("added user samba attribute", $dn);
 					}
 				}
@@ -795,5 +757,5 @@
 						$this->db_functions->add_user2group($gidnumber, $new_values['uidnumber']);
 						$this->ldap_functions->add_user2group($gidnumber, $user_uid);
-						$this->db_functions->write_log("adicionado usuario $dn ao grupo $gidnumber.",'','','','');
+						$this->db_functions->write_log("inserted user to group", "$dn: $gidnumber");
 					}
 				}
@@ -809,21 +771,9 @@
 								$this->db_functions->remove_user2group($gidnumber, $new_values['uidnumber']);
 								$this->ldap_functions->remove_user2group($gidnumber, $user_uid);
-								$this->db_functions->write_log("removido usuario $dn do grupo $gidnumber.",'','','','');
+								$this->db_functions->write_log("removed user from group", "$dn: $gidnumber");
 							}
 						}
 					}
 				}
-				/* GIDNUMBER agora é um atributo samba e pode ser alterado por gerentes com este perfil
-				/*
-				if ($diff['gidnumber'])
-				{
-					$ldap_mod_replace['gidnumber'] = $new_values['gidnumber'];
-					if (($this->current_config['expressoAdmin_samba_support'] == 'true') && ($new_values['userSamba']) && ($new_values['use_attrs_samba'] == 'on'))
-					{
-						$ldap_mod_replace['sambaPrimaryGroupSID']	= $this->current_config['expressoAdmin_sambaSID'] . '-' . ((2 * $new_values['gidnumber'])+1001);
-					}
-					$this->db_functions->write_log("alterado gidnumber do usuario.",'',$dn,'','');
-				}
-				*/
 			}
 			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -843,6 +793,4 @@
 			if (count($ldap_add))
 			{
-				echo 'ldap-add<br>';
-				print_r($ldap_add);
 				$result = $this->ldap_functions->add_user_attributes($dn, $ldap_add);
 				if (!$result['status'])
@@ -857,6 +805,4 @@
 			if (count($ldap_remove))
 			{
-				echo 'ldap-remove<br>';
-				print_r($ldap_remove);
 				$result = $this->ldap_functions->remove_user_attributes($dn, $ldap_remove);
 				if (!$result['status'])
@@ -886,13 +832,8 @@
 					{
 						$this->ldap_functions->add_user2maillist($uid, $new_values['mail']);
-						$this->db_functions->write_log("adicionado usuario $dn a maillist $uid.",'','','','');
-					}
-				}
-				/*
-				echo '<pre>';
-				print_r($old_values['maillists']);
-				print_r($new_values['maillists']);
-				*/
-				
+						$this->db_functions->write_log("inserted user to maillist","$dn: $uid");
+					}
+				}
+
 				if (count($remove_maillists)>0)
 				{
@@ -900,5 +841,5 @@
 					{
 						$this->ldap_functions->remove_user2maillist($uid, $new_values['mail']);
-						$this->db_functions->write_log("removido usuario $dn da maillist $uid.",'','','','');
+						$this->db_functions->write_log("removed user from maillist","$dn: $uid");
 					}
 				}
@@ -930,5 +871,5 @@
 
 					foreach ($add_apps as $app => $index)
-						$this->db_functions->write_log("Adicionado aplicativo $app ao usuário $dn",'',$dn,'','');
+						$this->db_functions->write_log("added application to user","$dn: $app");
 				}
 				if (count($remove_apps)>0)
@@ -945,5 +886,5 @@
 					
 					foreach ($remove_apps2 as $app => $access)
-						$this->db_functions->write_log("Removido aplicativo $app do usuário $dn",'',$dn,'','');
+						$this->db_functions->write_log("removed application to user","$dn: $app");
 				}
 				//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -976,8 +917,8 @@
 			{
 				$return['status'] = false;
-				$return['msg'] = 'Senha default já cadastrada!';
-			}
-			
-			$this->db_functions->write_log("Setado senha default para $uid",'','','','');
+				$return['msg'] = lang('default password already registered') . '!';
+			}
+			
+			$this->db_functions->write_log("inserted default password",$uid);
 			
 			return $return;
@@ -997,8 +938,8 @@
 			{
 				$return['status'] = false;
-				$return['msg'] = 'Senha default NÃO cadastrada!';
-			}
-			
-			$this->db_functions->write_log("Retornado senha default de $uid",'','','','');
+				$return['msg'] = lang('default password not registered') . '!';
+			}
+			
+			$this->db_functions->write_log("returned user password",$uid);
 			
 			return $return;
@@ -1039,5 +980,5 @@
 						$return['msg'] .= $result_ldap['msg'];
 					}
-					$this->db_functions->write_log('deletado usuario ' . $user_info['uid'],'','','','');
+					$this->db_functions->write_log('deleted user', $user_info['uid']);
 				}
 			}
@@ -1055,13 +996,13 @@
 			{
 				$return['status'] = false;
-				$return['msg'] .= 'Você não tem acesso para deletar este usuário.';
+				$return['msg'] .= lang('You do not have access to delete user') . '.';
 				return $return;
 			}
 
-			// Check if the new_uid alrteady is in use.			
+			// Check if the new_uid is in use.			
 			if ( ! $this->ldap_functions->check_rename_new_uid($params['new_uid']) )
 			{
 				$return['status'] = false;
-				$return['msg'] = 'Novo login já está em uso.';
+				$return['msg'] = lang('New login already in use') . '.';
 				return $return;
 			}
@@ -1095,6 +1036,8 @@
     	    	{
 					$return['status'] = false;
-					$return['msg'] = "A renomeação de usuários só permitida com o cyrus versão 2.2 ou superior,";
-					$return['msg'] .= "\ne com a opção 'allowusermoves: yes' configurado no imapd.conf.";
+					$return['msg'] = "The rename user is only permitted with cyrus 2.2 or higher,";
+					$return['msg'] .= "\nand with the option 'allowusermoves: yes' set in imapd.conf.";
+
+
 					return $return;
 	        	}
@@ -1105,5 +1048,5 @@
 				{
 					$return['status'] = false;
-					$return['msg'] = "Erro ao renomear usuário no LDAP. Processo abortado.";
+					$return['msg'] = lang("Error rename user in LDAP") . '.';
 					return $return;
 				}
@@ -1117,5 +1060,5 @@
 					
 					$return['status'] = false;
-					$return['msg'] = "Erro ao renomear usuário no Cyrus. Processo abortado.";
+					$return['msg'] = lang("Erro rename user in Cyrus") . '.';
 					return $return;
 				}
@@ -1154,15 +1097,12 @@
 					else 
 					{
+						$return['msg'] .= $result['msg'] . lang("Error renome sieve script") . '.';
+					}
+					$sieve->sieve_logout();
+				}
+				else
+				{
 						$return['status'] = false;
-						$return['msg'] .= $result['msg'] . "Erro ao renomear script sieve, falha no envio do novo script." .
-															"\nCaixa postal e login alterados.";
-					}
-					$sieve->sieve_logout();
-				}
-				else
-				{
-						$return['status'] = false;
-						$return['msg'] .= $result['msg'] . "Erro ao renomear script sieve, falha no Login." .
-															"\nCaixa postal e login alterados.";
+						$return['msg'] .= $result['msg'] . lang("Error renome sieve script") . '.';
 				}
 
@@ -1170,5 +1110,5 @@
 				$this->ldap_functions->set_user_password($new_uid, $user_password);
 		
-				$this->db_functions->write_log("renomeado login do usuario $uid para $new_uid.",'','','','');
+				$this->db_functions->write_log("renamed user", "$uid -> $new_uid");
 
 				$return['exec_return'] = "";
