Index: /trunk/jabberit_messenger/templates/celepar/config.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/config.tpl	(revision 417)
+++ /trunk/jabberit_messenger/templates/celepar/config.tpl	(revision 439)
@@ -1,9 +1,5 @@
 <!-- BEGIN header -->
-<!--script type="text/javascript" src="instant_messenger/js/connector.js"></script>
-<script type="text/javascript" src="instant_messenger/js/xtools.js"></script>
-<script type="text/javascript" src="instant_messenger/controller.php?act=j.setup"></script>
-<script type="text/javascript">
-	var PostForm = new constructScript;
-</script-->
+<script type="text/javascript" src="jabberit_messenger/js/connector.js"></script>
+<script type="text/javascript" src="jabberit_messenger/controller.php?act=j.setup"></script>
 <form method="POST" action="{action_url}">
 <table border="0" align="center">
@@ -23,20 +19,20 @@
 
    <tr bgcolor="{row_on}">
-    <td>Digite o nome do Servidor Jabber:</td>
+    <td id="JETTI_name_jabberit_label">Digite o nome do Servidor Jabber:</td>
     <td><input type="text" id="JETTI_name_jabberit" name="newsettings[name_jabberit]" value="{value_name_jabberit}"></td>
    </tr>
 
    <tr bgcolor="{row_off}">
-    <td>Digite a porta do Servidor Jabber:</td>
+    <td id="JETTI_port_jabberit_label">Digite a porta do Servidor Jabber:</td>
     <td><input type="text" id="JETTI_port_jabberit" name="newsettings[port_jabberit]" value="{value_port_jabberit}"></td>
    </tr>
    
    <tr bgcolor="{row_on}">
-    <td>Digite Nome da Conexão:</td>
+    <td id="JETTI_resource_jabberit_label">Digite Nome da Conexão:</td>
     <td><input type="text" id="JETTI_resource_jabberit" name="newsettings[resource_jabberit]" value="{value_resource_jabberit}"></td>
    </tr>
    
    <tr bgcolor="{row_off}">
-    <td>Digite GroupChatServer :</td>
+    <td id="JETTI_group_chat_server_jabberit_label">Digite GroupChatServer :</td>
     <td><input type="text" id="JETTI_group_chat_server_jabberit" name="newsettings[group_chat_server_jabberit]" value="{value_group_chat_server_jabberit}" size="30"></td>
    </tr>
@@ -67,20 +63,20 @@
 
    <tr bgcolor="{row_on}">
-    <td>Servidor Ldap:</td>
+    <td id="JETTI_server_ldap_jabberit_label">Servidor Ldap:</td>
     <td><input type="text" id="JETTI_server_ldap_jabberit" name="newsettings[server_ldap_jabberit]" value="{value_server_ldap_jabberit}"></td>
    </tr>
 
    <tr bgcolor="{row_off}">
-    <td>Contexto:</td>
+    <td id="JETTI_context_ldap_jabberit_label">Contexto:</td>
     <td><input type="text" id="JETTI_context_ldap_jabberit" name="newsettings[context_ldap_jabberit]" value="{value_context_ldap_jabberit}" size="30"></td>
    </tr>
 
    <tr bgcolor="{row_on}">
-    <td>Usuário Ldap:</td>
+    <td id="JETTI_user_ldap_jabberit_label">Usuário Ldap:</td>
     <td><input type="text" id="JETTI_user_ldap_jabberit" name="newsettings[user_ldap_jabberit]" value="{value_user_ldap_jabberit}" size="30"></td>
    </tr>
 
    <tr bgcolor="{row_off}">
-    <td>Password:</td>
+    <td id="JETTI_password_ldap_jabberit_label">Password:</td>
     <td><input type="password" id="JETTI_password_ldap_jabberit" name="newsettings[password_ldap_jabberit]" value="{value_password_ldap_jabberit}"></td>
    </tr>
@@ -91,5 +87,5 @@
   <tr>
     <td colspan="2" align="center">
-      <input type="submit" name="submit" value="{lang_submit}"> <!--onclick="javascript:PostForm.sendf(document);return false;"-->
+      <input type="submit" name="submit" value="{lang_submit}" onclick="return constructScript.sendf(document);">
       <input type="submit" name="cancel" value="{lang_cancel}">
     </td>
Index: /trunk/jabberit_messenger/templates/celepar/setup.js
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/setup.js	(revision 439)
+++ /trunk/jabberit_messenger/templates/celepar/setup.js	(revision 439)
@@ -0,0 +1,72 @@
+(function()
+{
+	// Envio para o PHP
+	var _conn   = new JITConnector('jabberit_messenger/');
+	
+	function getInputs(pDocument)
+	{
+		var form = pDocument.forms[0];
+		var values = "";
+		var field_blank = false;
+
+		for( var i = 0 ; i < form.elements.length; i++ )	
+		{
+		
+			switch(form.elements[i].type)
+			{
+				case "text" :
+							if ( form.elements[i].value != "" )
+							{
+								values += form.elements[i].id.toUpperCase() + ";" + escape(form.elements[i].value) + "\n";
+								document.getElementById(form.elements[i].id + "_label").style.color = "black";
+							}						
+							else
+								if( form.elements[i].id.toUpperCase() != "JETTI_GROUP_CHAT_SERVER_JABBERIT")
+								{
+									document.getElementById(form.elements[i].id + "_label").style.color = "red";
+									field_blank = true;
+								}
+							break;
+
+				case "password"	:
+							if ( form.elements[i].value == "" )
+							{
+								document.getElementById(form.elements[i].id + "_label").style.color = "red";
+								field_blank = true;
+							}
+							else
+							{
+								values += form.elements[i].id.toUpperCase() + ";" + escape(form.elements[i].value) + "\n";
+								document.getElementById(form.elements[i].id + "_label").style.color = "black";
+							}
+							break;
+			}
+		}
+
+		if(!field_blank)
+		{
+			values = values.substring(0,(values.length - 1 ));
+			_conn.go("$this.FileDefine.getParams","val=" + values);
+			return true;
+		}
+		else
+		{
+			alert('Preencha os campos obrigatórios. Estão em vermelho !');
+			return false;
+		}
+	}
+
+	function sendf()
+	{
+		var doc = ( arguments.length == 1) ? arguments[0] : false;
+
+		if( doc )
+			return getInputs(doc);
+	}
+
+	function constructScript(){}
+
+	constructScript.prototype.sendf = sendf;
+	window.constructScript = new constructScript;
+}
+)();
Index: /trunk/jabberit_messenger/inc/getphoto.php
===================================================================
--- /trunk/jabberit_messenger/inc/getphoto.php	(revision 417)
+++ /trunk/jabberit_messenger/inc/getphoto.php	(revision 439)
@@ -22,13 +22,18 @@
 	private $context;
 	private $photo_user = array();
+	private $handle;
+
 
 	function __construct()
 	{
-		$this->host		= "localhost";
-		$this->dn		= "uid=expresso-admin,ou=celepar,dc=ecelepar10612,dc=pr,dc=gov,dc=br";
-		$this->passwd	= "senha";
-		$this->context	= "dc=ecelepar10612,dc=pr,dc=gov,dc=br";
+		require_once('conf_Ldap_Photos.php');
+		$this->handle   = unserialize(base64_decode($CONF_SERVER));
 		
-		$this->refer  	= true;
+		$this->host		= $this->handle['host'];
+		$this->context	= $this->handle['context'];
+		$this->dn		= $this->handle['dn'];
+		$this->passwd	= $this->handle['passwd'];
+		
+		$this->refer  	= false;
 		$this->version3 = true;
 	}
@@ -166,4 +171,4 @@
 	}
 }
+
 ?>
-
Index: /trunk/jabberit_messenger/inc/controller.xml
===================================================================
--- /trunk/jabberit_messenger/inc/controller.xml	(revision 417)
+++ /trunk/jabberit_messenger/inc/controller.xml	(revision 439)
@@ -26,4 +26,5 @@
 			<item ref="images" js="images" />
 			<item ref="show_hidden" js="show_hidden" />
+			<item ref="setup" js="setup" path="/var/www/expresso/jabberit_messenger/templates/celepar/"/>
 		</js>
 		<php path="/var/www/expresso/jabberit_messenger/inc" suffix=".class.php">
@@ -34,4 +35,5 @@
 			<item ref="ldap_im" alias="photo_ldap" class="ldap_im" method="photo_ldap" prefix="class." suffix=".inc.php"/>
 			<item ref="ujabber" alias="AddNewContact" class="ujabber" method="AddNewContact" prefix="class." suffix=".inc.php"/>
+			<item ref="FileDefine" alias="getParams" class="FileDefine" method="getParams" prefix="class." suffix=".inc.php"/>			
 		</php>
 		<xml></xml>
Index: /trunk/jabberit_messenger/inc/class.FileDefine.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.FileDefine.inc.php	(revision 439)
+++ /trunk/jabberit_messenger/inc/class.FileDefine.inc.php	(revision 439)
@@ -0,0 +1,72 @@
+<?php
+ /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
+
+class FileDefine
+{
+
+	final function getParams($pParam)
+	{
+		$array_values = explode("\n", $pParam['val']);	
+		$infoServer = array();
+
+		foreach($array_values as $tmp )
+		{
+			$nvalue = explode(";", $tmp);
+			
+			switch(trim($nvalue[0]))
+			{
+				case "JETTI_SERVER_LDAP_JABBERIT" :
+							$infoServer['host'] = $nvalue[1];							
+							break;			
+			
+				case "JETTI_CONTEXT_LDAP_JABBERIT" :	
+							$infoServer['context'] = $nvalue[1];
+							break;
+			
+				case "JETTI_USER_LDAP_JABBERIT" :
+							$infoServer['dn'] = $nvalue[1];
+							break;
+			
+				case "JETTI_PASSWORD_LDAP_JABBERIT" :
+							$infoServer['passwd'] = $nvalue[1];				
+							break;
+			}
+		}
+		
+		$this->writeFile($infoServer);
+	}
+
+	private final function writeFile($pContent)
+    {
+ 	
+		$filename = dirname(__FILE__).'/conf_Ldap_Photos.php';
+		$caracter = "$";
+		$content = "<?php ".$caracter."CONF_SERVER="."\"" . base64_encode(serialize($pContent)) ."\""." ?>";
+
+		if (!$handle = fopen($filename, 'w'))
+		{
+			echo "Não foi possível abrir o arquivo : \n($filename)";
+			exit;
+		}
+		
+		if (fwrite($handle, $content) === FALSE)
+		{
+			echo "Não foi possível escrever no arquivo : \n($filename)";
+			exit;
+		}
+		
+		echo "Arquivo : \n $filename \ncriado com sucesso !!";
+		fclose($handle);
+    }
+
+}
+?>
Index: /trunk/jabberit_messenger/js/load.js
===================================================================
--- /trunk/jabberit_messenger/js/load.js	(revision 417)
+++ /trunk/jabberit_messenger/js/load.js	(revision 439)
@@ -41,15 +41,30 @@
 	function addIcon()
 	{
-		var StatusBar = '';
-		if((StatusBar = document.getElementById('divStatusBar')))
-		{
-			var _div = document.createElement('div');
-			_div.appendChild(StatusBar.parentNode.removeChild(StatusBar.previousSibling));
-			StatusBar.parentNode.insertBefore(_div,StatusBar);
+		/**
+		 * Criada o elemento(div) jabberWriteMsg, dentro da função write_msg do módulo expressoMail1_2,
+		 * quando estiver habilitada a opção fora de escritório nos filtros. 
+		 */
+		
+		if(document.getElementById('jabberWriteMsg'))
+			var StatusBar = document.getElementById('jabberWriteMsg');
+		else
+			var StatusBar = document.getElementById('divStatusBar');
+		
+		if(StatusBar)
+		{
+			if( StatusBar.id != 'jabberWriteMsg' )
+			{
+				var _div = document.createElement('div');
+				_div.appendChild(StatusBar.parentNode.removeChild(StatusBar.previousSibling));
+				StatusBar.parentNode.insertBefore(_div,StatusBar);
+			}
 
 			StatusBar.style.paddingLeft = '33px';
-
+			
+			var divJabber = document.createElement('div');
+				divJabber.setAttribute('id', 'JabberMessenger');
+			
 			var _status = top.document.createElement('div');
-				_status.setAttribute('id', 'jabberit_status');
+				_status.setAttribute('id', 'jabberit_login');
 				_status.style.background = 'no-repeat';
 				_status.style.backgroundImage = 'url(' + jabberit_group_open.src + ')';
@@ -63,5 +78,5 @@
 				_status.style.cursor = 'pointer';
 
-			StatusBar.insertBefore(_status, StatusBar.firstChild);
+			divJabber.insertBefore(_status,divJabber.firstChild);
 
 			var _menu;
@@ -70,9 +85,10 @@
 				_menu.style.backgroundColor = 'cecece';
 				_menu.style.display = 'none';
-				_menu.style.margin = '20px 0 0 -15px';
+				_menu.style.margin = '20px 5px 0px -15px';
 				_menu.style.position = 'absolute';
 				_menu.style.zIndex = '99999';
 				_menu.style.border = '1px dashed #000';
-			StatusBar.insertBefore(_menu, StatusBar.firstChild);
+				
+			divJabber.insertBefore(_menu, divJabber.firstChild);
 
 			var _menu_div = top.document.createElement('div');
@@ -87,6 +103,8 @@
 				_menu_div.style.width = '18px';
 				_menu_div.style.cursor = 'pointer';
+				_menu_div.style.zindex = '99999999';
 			
-			StatusBar.insertBefore(_menu_div, StatusBar.firstChild);
+			divJabber.insertBefore(_menu_div, divJabber.firstChild);
+			StatusBar.insertBefore(divJabber, StatusBar.firstChild);			
 			
 			configEvents(_menu_div,'onclick',showWindow);
@@ -103,5 +121,5 @@
 					];
 
-					var _style_text = 'cursor: pointer; padding:2px 4px 2px 20px; background: no-repeat url(' + jabberit_group_close.src + ');';
+					var _style_text = 'cursor: pointer; padding:2px 2px 2px 15px; background: no-repeat url(' + jabberit_group_close.src + ');';					
 
 					var _xml = _xtools.xml('menu');
@@ -405,4 +423,5 @@
 	Load.prototype.setPrefe = setPreferences;
 	Load.prototype.closeW = closeWindow;
+	Load.prototype.adIcon = addIcon;
 	window.loadscript = new Load;
 
