diff --git a/trunk/WEB-INF/classes/siprp/pagina/doGetListaEmpresas.java b/trunk/WEB-INF/classes/siprp/pagina/doGetListaEmpresas.java
index 293d80dc..f535211a 100644
--- a/trunk/WEB-INF/classes/siprp/pagina/doGetListaEmpresas.java
+++ b/trunk/WEB-INF/classes/siprp/pagina/doGetListaEmpresas.java
@@ -25,17 +25,20 @@ public class doGetListaEmpresas extends siprpServlet{
HttpSession session = req.getSession(false);
Vector links = new Vector();
Vector desc = new Vector();
+String empresa_nome;
try
{
userRole = (String)session.getAttribute(super.sessionUserRole);
-
- if (userRole == null)
+empresa_nome = ( String ) session.getAttribute( sessionCompanyName );
+
+ if (userRole == null)
{
throw new IllegalStateException();
}
if ( userRole.equals ( super.superUserRole ) )
{
+empresa_nome = null;
Class.forName(super.bdDriver);
con = DriverManager.getConnection( bdUrl, bdUsername, bdPassword );
dbQuery = new StringBuffer();
@@ -62,7 +65,8 @@ public class doGetListaEmpresas extends siprpServlet{
session.setAttribute( sessionEstabelecimentoId, null );
HashMap hmValues = new HashMap();
-hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
+//hmValues.put( "empresa_nome", session.getAttribute( sessionCompanyName ) );
+hmValues.put( "empresa_nome", empresa_nome );
hmValues.put( "empresa_id", session.getAttribute( sessionEmpresaId ) );
hmValues.put( "estabelecimento_id", session.getAttribute( sessionEstabelecimentoId ) );
hmValues.put( "userRole", userRole );
diff --git a/trunk/WEB-INF/classes/siprp/pagina/doGetListaEstabelecimentos.java b/trunk/WEB-INF/classes/siprp/pagina/doGetListaEstabelecimentos.java
index 092af37b..2b12dffc 100644
--- a/trunk/WEB-INF/classes/siprp/pagina/doGetListaEstabelecimentos.java
+++ b/trunk/WEB-INF/classes/siprp/pagina/doGetListaEstabelecimentos.java
@@ -26,7 +26,7 @@ public class doGetListaEstabelecimentos extends siprpServlet{
Vector links = new Vector();
Vector desc = new Vector();
try
- {
+ {
userRole = (String)session.getAttribute(super.sessionUserRole);
empresaId = (String)session.getAttribute(super.sessionEmpresaId);
diff --git a/trunk/WEB-INF/classes/siprp/pagina/doPostLogin.java b/trunk/WEB-INF/classes/siprp/pagina/doPostLogin.java
index 1689fede..7065b42b 100644
--- a/trunk/WEB-INF/classes/siprp/pagina/doPostLogin.java
+++ b/trunk/WEB-INF/classes/siprp/pagina/doPostLogin.java
@@ -71,12 +71,14 @@ if( userRole.equals( "manager" ) )
session.setAttribute( sessionCompanyName, null );
session.setAttribute( sessionEstabelecimentoId, null );
hmValues.put( templateQuery, super.queryStringEmpresas );
+new doGetListaEmpresas( req, res );
}
else
{
session.setAttribute( sessionCompanyName, nomeEmpresa( con, userRole ) );
session.setAttribute( sessionEstabelecimentoId, "-1" );
hmValues.put( templateQuery, super.queryStringEstabelecimentos );
+new doGetListaEstabelecimentos( req, res );
}
diff --git a/trunk/WEB-INF/classes/siprp/pagina/siprpServlet.java b/trunk/WEB-INF/classes/siprp/pagina/siprpServlet.java
index 0d4c7c77..652a84e1 100644
--- a/trunk/WEB-INF/classes/siprp/pagina/siprpServlet.java
+++ b/trunk/WEB-INF/classes/siprp/pagina/siprpServlet.java
@@ -31,7 +31,7 @@ public class siprpServlet extends HttpServlet
public static final String indexTemplate = "index.html";
public static final String authenticatedUserTemplate = "user.html";
-public static final String errorTemplate = "error.html";
+public static final String errorTemplate = "frame_erro.html";
public static final String mainTemplate = "main.html";
//public static final String criticalErrorTemplate = "critical.html";
@@ -61,7 +61,7 @@ public static final String errorTemplate = "error.html";
public static final String sessionEstabelecimentoId="estabelecimentoId";
public static final String sessionTrabalhadorId="trabalhadorId";
public static final String sessionCompanyName = "sessionCompanyName";
- public static final int sessionTimeout =300; // segundos
+ public static final int sessionTimeout = 3600; // segundos
public static final String servletName="siprpWeb";
public static final String superUserRole="manager";
diff --git a/trunk/html/erro.html b/trunk/html/erro.html
new file mode 100644
index 00000000..8a9353b4
--- /dev/null
+++ b/trunk/html/erro.html
@@ -0,0 +1,44 @@
+
+
+
+
+ SIPRP - Erro
+
+
+
+
+
+ erro
+
+
+
+
+
+
+
+
+
+
+
+
+ Por razões de segurança o tempo da sua sessão expirou
+ Por favor efectue novamente o seu login.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/trunk/html/frame_erro.html b/trunk/html/frame_erro.html
new file mode 100644
index 00000000..527ebcb1
--- /dev/null
+++ b/trunk/html/frame_erro.html
@@ -0,0 +1,216 @@
+
+
+
+
+
+ SIPRP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ notícias
+
+
+
+
+
+
+
+
+
+
+
+ A SIPRP apresenta o
+seu novo site em www.siprp.pt.
+
+Além de conteúdos sobre a empresa e o grupo, é
+disponibilizado um portal online com funcionalidades para os seus
+clientes.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/trunk/html/user.html b/trunk/html/user.html
index 7f268709..7db2168b 100644
--- a/trunk/html/user.html
+++ b/trunk/html/user.html
@@ -135,13 +135,14 @@ td.box6
-
+
+ $userName logout »
@@ -158,20 +159,20 @@ td.box6
-
+
- #if( $userRole == "manager" )
+ #if( $userRole == "manager" && $empresa_nome )
Empresa: $!empresa_nome
#else
- Empresa: $empresa_nome
+ Empresa: $!empresa_nome
#end
-
+
@@ -210,12 +211,14 @@ td.box6
- #if( $query == "estabelecimentos" )
- #set( $listaTitle = "Estabelecimentos" )
+ #if( $query == "empresas" )
+ #set( $listaTitle = "empresas" )
+ #elseif( $query == "estabelecimentos" )
+ #set( $listaTitle = "estabelecimentos" )
#elseif( $query == "trabalhadores" )
- #set( $listaTitle = "Funcionários" )
+ #set( $listaTitle = "funcionários" )
#else ##( $query == "trabalhador" )
- #set( $listaTitle = "" )
+ #set( $listaTitle = "funcionário" )
#end
@@ -223,7 +226,7 @@ td.box6
$listaTitle
-
+
#if ($query == "trabalhador")