Index: trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php	(revision 46)
+++ trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php	(revision 57)
@@ -242,4 +242,5 @@
 				'display_spam_uid'				=> 'display:none',
 				'lang_general_information'		=> lang('General Information'),
+				'lang_corporative_information'	=> lang('Corporative Information'),
 				'lang_email_config'				=> lang('Email Config'),
 				'lang_groups_permission'		=> lang('Groups Permission'),
@@ -274,4 +275,11 @@
 				'ldap_context'					=> ldap_dn2ufn($GLOBALS['phpgw_info']['server']['ldap_context']),
 				
+				// Corporative Information
+				'display_corporative_information' => $this->functions->check_acl($manager_lid,'manipulate_corporative_information') ? '' : 'none',
+				'lang_employeenumber'			=> lang('Employee number'),
+				'lang_cpf'						=> lang('cpf'),
+				'lang_rg'						=> lang('rg'),
+				'lang_rguf'						=> lang('rguf'),
+				
 				//MAIL
 				'lang_activeemailaccount'		=> lang('Active email account'),
@@ -305,4 +313,5 @@
 				
 				//SAMBA ABA
+				'display_samba_suport'				=> $this->functions->check_acl($manager_lid,'edit_sambausers_attributes') ? '' : 'none',
 				'lang_samba_config'					=> lang('Samba Config'),
 				'lang_use_attrs_samba'				=> lang('Use samba attributes'),
@@ -536,4 +545,5 @@
 				'display_input_account_lid'		=> 'display:none',
 				'lang_general_information'		=> lang('General Information'),
+				'lang_corporative_information'	=> lang('Corporative Information'),
 				'lang_email_config'				=> lang('Email Config'),
 				'lang_groups_permission'		=> lang('Groups Permission'),
@@ -572,5 +582,16 @@
 				'phpgwaccountvisible_checked'	=> $user_info['phpgwaccountvisible'] == '-1' ? 'CHECKED' : '',
 
-				//MAIL BORD
+				// Corporative Information
+				'display_corporative_information'=> $this->functions->check_acl($manager_account_lid,'edit_sambausers_attributes') ? '' : 'none',
+				'lang_employeenumber'			=> lang('Employee number'),
+				'lang_cpf'						=> lang('cpf'),
+				'lang_rg'						=> lang('rg'),
+				'lang_rguf'						=> lang('rguf'),
+				'corporative_information_employeenumber' => $user_info['corporative_information_employeenumber'],
+				'corporative_information_cpf'			=> $user_info['corporative_information_cpf'],
+				'corporative_information_rg'			=> $user_info['corporative_information_rg'],
+				'corporative_information_rguf'			=> $user_info['corporative_information_rguf'],
+				
+				//MAIL
 				'disabled_quota_used'			=> 'disabled',
 				'lang_activeemailaccount'		=> lang('Active email account'),
Index: trunk/expressoAdmin1_2/inc/class.user.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.user.inc.php	(revision 47)
+++ trunk/expressoAdmin1_2/inc/class.user.inc.php	(revision 57)
@@ -117,32 +117,54 @@
 				if (($this->current_config['expressoAdmin_samba_support'] == 'true') && ($params['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.";
-					}
-					else
-					{
-						$user_info['objectClass'][] 		= 'sambaSamAccount';
-						$user_info['loginShell']			= '/bin/bash';
-
-						$user_info['sambaSID']				= $params['sambadomain'] . '-' . ((2 * $id)+1000);
-						$user_info['sambaPrimaryGroupSID']	= $params['sambadomain'] . '-' . ((2 * $user_info['gidNumber'])+1001);
-
-						$user_info['sambaAcctFlags']		= $params['sambaacctflags'];
-			
-						$user_info['sambaLogonScript']		= $params['sambalogonscript'];
-						$user_info['homeDirectory']			= $params['sambahomedirectory'];
-			
-						$user_info['sambaLMPassword']		= exec('/home/expressolivre/mkntpwd -L '.$params['password1']);
-						$user_info['sambaNTPassword']		= exec('/home/expressolivre/mkntpwd -N '.$params['password1']);
-						$user_info['sambaPasswordHistory']	= '0000000000000000000000000000000000000000000000000000000000000000';
-			
-						$user_info['sambaPwdCanChange']		= strtotime("now");
-						$user_info['sambaPwdLastSet']		= strtotime("now");
-						$user_info['sambaPwdMustChange']	= '2147483647';
-					}
-				}
+					// Verifica o acesso do gerente aos atributos samba
+					if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_sambausers_attributes'))
+					{
+						//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.";
+						}
+						else
+						{
+							$user_info['objectClass'][] 		= 'sambaSamAccount';
+							$user_info['loginShell']			= '/bin/bash';
+	
+							$user_info['sambaSID']				= $params['sambadomain'] . '-' . ((2 * $id)+1000);
+							$user_info['sambaPrimaryGroupSID']	= $params['sambadomain'] . '-' . ((2 * $user_info['gidNumber'])+1001);
+
+							$user_info['sambaAcctFlags']		= $params['sambaacctflags'];
+			
+							$user_info['sambaLogonScript']		= $params['sambalogonscript'];
+							$user_info['homeDirectory']			= $params['sambahomedirectory'];
+			
+							$user_info['sambaLMPassword']		= exec('/home/expressolivre/mkntpwd -L '.$params['password1']);
+							$user_info['sambaNTPassword']		= exec('/home/expressolivre/mkntpwd -N '.$params['password1']);
+							$user_info['sambaPasswordHistory']	= '0000000000000000000000000000000000000000000000000000000000000000';
+			
+							$user_info['sambaPwdCanChange']		= strtotime("now");
+							$user_info['sambaPwdLastSet']		= strtotime("now");
+							$user_info['sambaPwdMustChange']	= '2147483647';
+						}
+					}
+				}
+				
+				// Verifica o acesso do gerente aos atributos corporativos
+				if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'manipulate_corporative_information'))
+				{
+					foreach ($params as $atribute=>$value)
+					{
+						$pos = strrpos($atribute, 'corporative_information_');
+						if ($pos !== false)
+						{
+							if ($params[$atribute])
+							{
+								$ldap_atribute = str_replace("corporative_information_", "", $atribute);
+								$user_info[$ldap_atribute] = $params[$atribute];
+							}
+						}
+					}
+				}
+				
 				$result = $this->ldap_functions->ldap_add_entry($dn, $user_info);
 				if (!$result['status'])
@@ -239,7 +261,7 @@
 			$old_values = $this->get_user_info($new_values['uidnumber'], $new_values['manager_context']);
 			$dn = 'uid=' . $old_values['uid'] . ',' . strtolower($old_values['context']);
-			
+
 			$diff = array_diff($new_values, $old_values);
-			
+
 			$manager_account_lid = $_SESSION['phpgw_session']['session_lid'];
 			if ((!$this->functions->check_acl($manager_account_lid,'edit_users')) &&
@@ -254,10 +276,4 @@
 
 			// Verifica o acesso do gerente
-			if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users'))
-			{
-				
-			}
-			
-			// Verifica o acesso do gerente
 			if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users'))
 			{
@@ -293,5 +309,5 @@
 					$ldap_mod_replace['sn'] = $new_values['sn'];
 					$ldap_mod_replace['cn'] = $new_values['givenname'] . ' ' . $new_values['sn'];
-					$this->db_functions->write_log("alterado sn do usuario",'',$dn,'','');
+					$this->db_functions->write_log("altera$ldap_mod_do sn do usuario",'',$dn,'','');
 				}
 				if ($diff['mail'])
@@ -349,5 +365,38 @@
 				}
 			}
-
+			
+			// REPLACE, ADD & REMOVE COPORATIVEs ATRIBUTES
+			// Verifica o acesso do gerente aos atributos corporativos
+			if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'manipulate_corporative_information'))
+			{
+				foreach ($new_values as $atribute=>$value)
+				{
+					$pos = strrpos($atribute, 'corporative_information_');
+					if ($pos !== false)
+					{
+						$ldap_atribute = str_replace("corporative_information_", "", $atribute);
+						// REPLACE ATTRS OF CORPORATIVE
+						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,'','');
+						}
+						//ADD ATTRS OF CORPORATIVE
+						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,'','');
+						}
+						//REMOVE ATTRS OF CORPORATIVE
+						elseif (($old_values[$atribute] != '') && ($new_values[$atribute] == ''))
+						{
+							$ldap_remove[$ldap_atribute] = array();
+							$this->db_functions->write_log("removido $ldap_atribute do usuario",'',$dn,'','');	
+						}
+					}
+				}
+			}
+			
 			//Suporte ao SAMBA
 			if ( ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users')) || 
@@ -512,5 +561,5 @@
 				}
 			}
-			
+
 			if ( ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_users')) || 
 			     ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'edit_sambausers_attributes')) )
@@ -640,5 +689,4 @@
 			if (count($ldap_remove))
 			{
-				
 				$result = $this->ldap_functions->remove_user_attributes($dn, $ldap_remove);
 				if (!$result['status'])
@@ -727,5 +775,4 @@
 			return $return;
 		}		
-		
 		
 		function get_user_info($uidnumber, $context)
@@ -1076,4 +1123,10 @@
 			}
 		}
+		
+		function write_log_from_ajax($params)
+		{
+			$this->db_functions->write_log($params['_action'],'',$params['userinfo'],'','');
+			return true;
+		}
 	}
 ?>
Index: trunk/expressoAdmin1_2/inc/class.bomanagers.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.bomanagers.inc.php	(revision 46)
+++ trunk/expressoAdmin1_2/inc/class.bomanagers.inc.php	(revision 57)
@@ -30,4 +30,5 @@
 			'lid'						=> $_POST['manager_lid'],
 			'context'					=> $_POST['context'],
+			
 			'add_users'					=> $_POST['add_users'],
 			'edit_users'				=> $_POST['edit_users'],
@@ -35,4 +36,5 @@
 			'rename_users'				=> $_POST['rename_users'],
 			'view_users'				=> $_POST['view_users'],
+			'manipulate_corporative_information' => $_POST['manipulate_corporative_information'],
 			'add_groups'				=> $_POST['add_groups'],
 			'edit_groups'				=> $_POST['edit_groups'],
@@ -42,4 +44,5 @@
 			'change_users_quote'		=> $_POST['change_users_quote'],
 			'set_user_default_password'	=> $_POST['set_user_default_password'],
+			'empty_user_inbox'			=> $_POST['empty_user_inbox'],
 			'edit_sambausers_attributes'=> $_POST['edit_sambausers_attributes'],
 			'edit_sambadomains'			=> $_POST['edit_sambadomains'],
@@ -54,5 +57,6 @@
 			'create_computers'			=> $_POST['create_computers'],
 			'edit_computers'			=> $_POST['edit_computers'],
-			'delete_computers'			=> $_POST['delete_computers'],			
+			'delete_computers'			=> $_POST['delete_computers'],
+					
 			'apps'						=> $_POST['applications_list']
 			);
@@ -60,7 +64,7 @@
 			// Soma os niveis de acesso criando uma ACL
 			$acl = 0;
-			$acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'];
+			$acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'] + $manager['manipulate_corporative_information'];
 			$acl = $acl + $manager['add_groups'] + $manager['edit_groups'] + $manager['delete_groups'] + $manager['edit_email_groups'];
-			$acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'];
+			$acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'] + $manager['empty_user_inbox'];
 			$acl = $acl + $manager['edit_sambausers_attributes'] + $manager['edit_sambadomains'];
 			$acl = $acl + $manager['add_email_lists'] + $manager['edit_email_lists'] + $manager['delete_email_lists'];
@@ -102,4 +106,5 @@
 			'lid'						=> $_POST['manager_lid'],
 			'context'					=> $_POST['context'],
+			
 			'add_users'					=> $_POST['add_users'],
 			'edit_users'				=> $_POST['edit_users'],
@@ -107,4 +112,5 @@
 			'rename_users'				=> $_POST['rename_users'],
 			'view_users'				=> $_POST['view_users'],
+			'manipulate_corporative_information' => $_POST['manipulate_corporative_information'],
 			'add_groups'				=> $_POST['add_groups'],
 			'edit_groups'				=> $_POST['edit_groups'],
@@ -114,4 +120,5 @@
 			'change_users_quote'		=> $_POST['change_users_quote'],
 			'set_user_default_password'	=> $_POST['set_user_default_password'],
+			'empty_user_inbox'			=> $_POST['empty_user_inbox'],
 			'edit_sambausers_attributes'=> $_POST['edit_sambausers_attributes'],
 			'edit_sambadomains'			=> $_POST['edit_sambadomains'],
@@ -127,4 +134,5 @@
 			'edit_computers'			=> $_POST['edit_computers'],
 			'delete_computers'			=> $_POST['delete_computers'],
+			
 			'apps'						=> $_POST['applications_list']
 			);
@@ -132,7 +140,7 @@
 			// Soma os niveis de acesso criando uma ACL
 			$acl = 0;
-			$acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'];
+			$acl = $acl + $manager['add_users'] + $manager['edit_users'] + $manager['delete_users'] + $manager['rename_users'] + $manager['view_users'] + $manager['manipulate_corporative_information'];
 			$acl = $acl + $manager['add_groups'] + $manager['edit_groups'] + $manager['delete_groups'] + $manager['edit_email_groups'];
-			$acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'];
+			$acl = $acl + $manager['change_users_password'] + $manager['change_users_quote'] + $manager['set_user_default_password'] + $manager['empty_user_inbox'];
 			$acl = $acl + $manager['edit_sambausers_attributes'] + $manager['edit_sambadomains'];
 			$acl = $acl + $manager['add_email_lists'] + $manager['edit_email_lists'] + $manager['delete_email_lists'];
Index: trunk/expressoAdmin1_2/inc/class.imap_functions.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.imap_functions.inc.php	(revision 47)
+++ trunk/expressoAdmin1_2/inc/class.imap_functions.inc.php	(revision 57)
@@ -1,6 +1,9 @@
 <?php
+
+include_once('class.functions.inc.php');
 
 class imap_functions
 {
+	var $functions;
 	var $imap;
 	var $imapDelimiter;
@@ -17,4 +20,5 @@
 		$this->imapDelimiter= $_SESSION['phpgw_info']['expresso']['email_server']['imapDelimiter'];
 		$this->imap 		= imap_open('{'.$this->imap_server.':'.$this->imap_port.'/novalidate-cert}', $this->imap_admin, $this->imap_passwd, OP_HALFOPEN);
+		$this->functions	= new functions;
 	}
 	
@@ -72,6 +76,6 @@
 		else
 		{
-			$quota['mailquota'] = ($get_quota['limit'] / 1024);
-			$quota['mailquota_used'] = ($get_quota['usage'] / 1024);
+			$quota['mailquota'] = round (($get_quota['limit'] / 1024), 2);
+			$quota['mailquota_used'] = round (($get_quota['usage'] / 1024), 2);
 		}
 			
@@ -116,3 +120,62 @@
 		return $result;
 	}
+	
+	function empty_inbox($params)
+	{
+		// Verifica o acesso do gerente
+		if (!$this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'empty_user_inbox'))
+		{
+			$result['status'] = false;
+			$result['msg'] = 'Você não tem acesso para executar esta operação.';
+			return $result;
+		}
+		
+		if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes')
+		{
+			$imap_options = '/tls/novalidate-cert';
+		}
+		else
+		{
+			$imap_options = '/notls/novalidate-cert';
+		}
+
+		
+		$result['status'] = true;
+		$uid = $params['uid'];
+		
+		$return_setacl = imap_setacl($this->imap, "user" . $this->imapDelimiter . $uid, $this->imap_admin, 'lrswipcda');
+		
+		if ($return_setacl)
+		{
+			//$mbox_stream = imap_open('{'.$this->imap_server.':'.$this->imap_port.$imap_options.'/user="'.$uid.'"}', $this->imap_admin, $this->imap_passwd);
+			$mbox_stream = imap_open('{'.$this->imap_server.':'.$this->imap_port.$imap_options .'}user'. $this->imapDelimiter . $uid, $this->imap_admin, $this->imap_passwd);
+			
+			$check = imap_mailboxmsginfo($mbox_stream);
+			$inbox_size = (string)(round ((($check->Size)/(1024*1024)), 2));
+			
+			$return_imap_delete = imap_delete($mbox_stream,'1:*');
+			imap_close($mbox_stream, CL_EXPUNGE);
+			
+			imap_setacl ($this->imap, "user" . $this->imapDelimiter . $uid, $this->imap_admin, '');
+			
+			if ($return_imap_delete)
+			{
+				$result['inbox_size'] = $inbox_size;
+				
+				$get_user_quota = @imap_get_quotaroot($this->imap,"user" . $this->imapDelimiter . $uid);
+				$result['mailquota_used'] = (string)(round(($get_user_quota['usage']/1024), 2));
+			}
+			else
+			{
+				$result['status'] = false;
+				$result['msg'] = "Nao foi possivel esvaziar a caixa postal do usuario:\n" . imap_last_error();
+			}
+		}
+		else
+		{
+			$result['status'] = false;
+			$result['msg'] = "Nao foi possivel modificar a acl do usuario:\n" . imap_last_error();
+		}
+		return $result;
+	}
 }
Index: trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 46)
+++ trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php	(revision 57)
@@ -207,4 +207,5 @@
 				'lang_rename_user'				=> lang('Rename users'),
 				'lang_view_user'				=> lang('View users'),
+				'lang_manipulate_corporative_information' => lang('Manipulate corporative information'),
 				'lang_add_groups'				=> lang('Add groups'),
 				'lang_edit_groups'				=> lang('Edit groups'),
@@ -214,4 +215,5 @@
 				'lang_change_users_quote'		=> lang('Change users quote'),
 				'lang_set_user_default_password'=> lang('Set default users password'),
+				'lang_empty_user_inbox'			=> lang('Empty user inbox'),
 				'lang_edit_sambausers_attributes'=> lang('Edit SAMBA users attributes'),
 				'lang_edit_sambadomains'		=> lang('Edit SAMBA domains'),
@@ -233,4 +235,6 @@
 				'add_users' 					=> $_POST['add_users'] != '' ? 'checked' : '',
 				'edit_users'					=> $_POST['edit_users'] != '' ? 'checked' : '',
+				'view_users' 					=> $_POST['view_users'] != '' ? 'checked' : '',
+				'manipulate_corporative_information' => $_POST['manipulate_corporative_information'] != '' ? 'checked' : '',
 				'delete_users' 					=> $_POST['delete_users'] != '' ? 'checked' : '',
 				'add_groups' 					=> $_POST['add_groups'] != '' ? 'checked' : '',
@@ -335,4 +339,5 @@
 				$_POST['rename_users'] 			= $acl['rename_users'];
 				$_POST['view_users'] 			= $acl['view_users'];
+				$_POST['manipulate_corporative_information'] = $acl['manipulate_corporative_information'];
 				$_POST['add_groups']			= $acl['add_groups'];
 				$_POST['edit_groups']			= $acl['edit_groups'];
@@ -342,4 +347,5 @@
 				$_POST['change_users_quote']	= $acl['change_users_quote'];
 				$_POST['set_user_default_password']	= $acl['set_user_default_password'];
+				$_POST['empty_user_inbox']		= $acl['empty_user_inbox'];
 				$_POST['edit_sambausers_attributes'] = $acl['edit_sambausers_attributes'];
 				$_POST['edit_sambadomains'] 	= $acl['edit_sambadomains'];
@@ -453,4 +459,5 @@
 				'lang_rename_user'				=> lang('Rename users'),
 				'lang_view_user'				=> lang('View users'),
+				'lang_manipulate_corporative_information' => lang('Manipulate corporative information'),
 				'lang_add_groups'				=> lang('Add groups'),
 				'lang_edit_groups'				=> lang('Edit groups'),
@@ -460,4 +467,5 @@
 				'lang_change_users_quote'		=> lang('Change users quote'),
 				'lang_set_user_default_password'=> lang('Set default user password'),
+				'lang_empty_user_inbox'			=> lang('Empty user inbox'),
 				'lang_edit_sambausers_attributes'=> lang('Edit SAMBA users attributes'),
 				'lang_edit_sambadomains'		=> lang('Edit SAMBA domains'),
@@ -483,4 +491,5 @@
 				'rename_users' 					=> $_POST['rename_users'] != '' ? 'checked' : '',
 				'view_users' 					=> $_POST['view_users'] != '' ? 'checked' : '',
+				'manipulate_corporative_information' => $_POST['manipulate_corporative_information'] != '' ? 'checked' : '',
 				'add_groups' 					=> $_POST['add_groups'] != '' ? 'checked' : '',
 				'edit_groups'					=> $_POST['edit_groups'] != '' ? 'checked' : '',
@@ -490,4 +499,5 @@
 				'change_users_quote'			=> $_POST['change_users_quote'] != '' ? 'checked' : '',
 				'set_user_default_password'		=> $_POST['set_user_default_password'] != '' ? 'checked' : '',
+				'empty_user_inbox'				=> $_POST['empty_user_inbox'] != '' ? 'checked' : '',
 				'edit_sambausers_attributes'	=> $_POST['edit_sambausers_attributes'] != '' ? 'checked' : '',
 				'edit_sambadomains'				=> $_POST['edit_sambadomains'] != '' ? 'checked' : '',
Index: trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 46)
+++ trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php	(revision 57)
@@ -3,4 +3,5 @@
 define('PHPGW_API_INC','../phpgwapi/inc');	
 include_once(PHPGW_API_INC.'/class.common.inc.php');
+include_once('class.functions.inc.php');
 
 class ldap_functions
@@ -8,4 +9,5 @@
 	var $ldap;
 	var $current_config;
+	var $functions;
 	
 	function ldap_functions(){
@@ -14,8 +16,10 @@
 		$common = new common();
 		$this->ldap = $common->ldapConnect();
+		$this->functions = new functions;
 	}
 	
 	function validate_fields($params)
 	{
+		$result['status'] = true;
 		$params = unserialize($params['attributes']);
 		$type = $params['type'];
@@ -24,7 +28,5 @@
 		$mail = $params['mail'];
 		$mailalternateaddress = $params['mailalternateaddress'];
-
-		$result['status'] = true;
-		
+				
 		if ($_SESSION['phpgw_info']['expresso']['global_denied_users'][$uid])
 		{
@@ -657,4 +659,13 @@
 			array_pop($a_tmp);
 			$result['sambasid'] = implode("-", $a_tmp);
+		}
+
+		// Verifica o acesso do gerente aos atributos corporativos
+		if ($this->functions->check_acl($_SESSION['phpgw_session']['session_lid'], 'manipulate_corporative_information'))
+		{
+			$result['corporative_information_employeenumber']= $entry[0]['employeenumber'][0];
+			$result['corporative_information_cpf']			= $entry[0]['cpf'][0];
+			$result['corporative_information_rg']			= $entry[0]['rg'][0];
+			$result['corporative_information_rguf']			= $entry[0]['rguf'][0];
 		}
 		
Index: trunk/expressoAdmin1_2/inc/class.functions.inc.php
===================================================================
--- trunk/expressoAdmin1_2/inc/class.functions.inc.php	(revision 47)
+++ trunk/expressoAdmin1_2/inc/class.functions.inc.php	(revision 57)
@@ -66,4 +66,8 @@
 						return true;
 					break;
+				case manipulate_corporative_information:
+					if ($array_acl[manipulate_corporative_information])
+						return true;
+					break;
 				case change_users_password:
 					if ($array_acl[change_users_password])
@@ -76,4 +80,8 @@
 				case set_user_default_password:
 					if ($array_acl[set_user_default_password])
+						return true;
+					break;
+				case empty_user_inbox:
+					if (($array_acl[empty_user_inbox]) && ($array_acl[edit_users]))
 						return true;
 					break;
@@ -186,5 +194,5 @@
 		
 		// Make a array read humam
-		// Last acl:	33.554.432, 67.108.864
+		// Last acl:	33.554.432, 67.108.864, 134.217.728, 134.217.728, 268.435.456
 		function make_array_acl($acl)
 		{
@@ -194,4 +202,5 @@
 			$array_acl['rename_users'] = $acl & 8388608;
 			$array_acl['view_users'] = $acl & 33554432;
+			$array_acl['manipulate_corporative_information'] = $acl & 268435456;
 			$array_acl['add_groups'] = $acl & 16;
 			$array_acl['edit_groups'] = $acl & 32;
@@ -201,4 +210,5 @@
 			$array_acl['change_users_quote'] = $acl & 262144;
 			$array_acl['set_user_default_password'] = $acl & 524288;
+			$array_acl['empty_user_inbox'] = $acl & 134217728;
 			$array_acl['edit_sambausers_attributes'] = $acl & 32768;
 			$array_acl['edit_sambadomains'] = $acl & 16777216;
