[Zope] Problem SESSION with Zope 2.7.3b1-0

André Amram Duque andre.duque at varig.com
Thu Dec 9 13:40:54 EST 2004


Skipped content of type multipart/alternative-------------- next part --------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Macro definição template/html -->
<html metal:define-macro="master">
<head>
<!--Slot de cabeçalho -->
<metal:head define-slot="head"/>
<title>::: | DF-10 On-line | :::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link  href="static/css/estilos.css" rel="stylesheet" type="text/css">
<script TYPE="text/javascript" LANGUAGE="JavaScript" SRC="static/js/checar.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<!-- / Slot de cabeçalho -->

<body OnLoad="begintimer()" background="static/imagem/fundo_tabela.jpg"> 
<map name="Map">
  <area shape="rect" coords="583,5,754,45"  onClick="abrir_janela();" href="#" alt="http://iwww.varig.com.br"></map>
<map name="Map2">
  <area shape="rect" coords="0,1,142,14"  onClick="tela_impressao();" href="#">
</map>

<table width="100%" height="100%"  border="0" align="center"  cellpadding="2" cellspacing="0" >
  <tr>
    <td height="667" align="center" valign="middle" background="static/imagem/fundo_tabela.jpg"> 

      <!-- Primeiras linhas da tabela com figura e menubar  -->
      <table width="760" height="420" border="1" align="center" cellpadding="0" cellspacing="0">
        <tr valign="top">
          <td align="center" valign="top" ><img src="static/imagem/cabecalho.jpg" width="760" height="77" border="0" usemap="#Map"></td>
        </tr>
        <tr>
          <td height='16' align='center' valign='middle' bgcolor="#F5F5F5"  class='fundo1'>
           <span><nobr><span class='menu_linkseg'>&nbsp;
		     <a href="tela_abertura.html" class='menu_linkseg'>Página Inicial</a> &nbsp;&nbsp;|&nbsp;&nbsp;
           <a href="tela_solicitacao.html" class='menu_linkseg'>Preencher Formulário</a> &nbsp;&nbsp;|&nbsp;&nbsp;	
           <a href="tela_acompanhamento.html" class='menu_linkseg'>Acompanhamento</a> &nbsp;&nbsp;|&nbsp;&nbsp; 
		    <a href="#" onclick="tela_normas()" class='menu_linkseg'>Norma de Investimentos</a> &nbsp;&nbsp;|&nbsp;&nbsp;	
           <!-- (AD)Administrador visualiza -->
           <span tal:condition="python:request.SESSION.get('tipoAcesso') == 'AD'">
             <a href="tela_manutencao.html" class='menu_linkseg'>Manutenção</a> &nbsp;&nbsp;|&nbsp;&nbsp; 
           </span>  
           <!-- (AD)Administrador e (GE)Gerente visualiza relatório -->  
           <span tal:condition="python:request.SESSION.get('tipoAcesso') == 'AD' or  request.SESSION.get('tipoAcesso') == 'GE'">
             <a href="tela_relatorio.html" class='menu_linkseg'>Relatório</a>&nbsp;&nbsp;|&nbsp;&nbsp;
           </span>
            <a href="template/tela_download.html" class='menu_linkseg'>Arquivos</a> &nbsp;&nbsp;|&nbsp;&nbsp;	
   
           <a href="#" class='menu_linkseg' onClick="Logout();">Logout</a><a name="Topo"></a>
           </span><nobr></span>
          </td>
        </tr>
        
        <td width="760" height="610" valign="top"  align="left" bgcolor="#F5F5F5">     
           <!--Slot body -->
              <span metal:define-slot="body"></span>
                 
           <!--Slot body -->
        </td>
      </table> 
   </td>    
 </tr>

</table>

</body>
</html>














-------------- next part --------------
# 
# Metodo para validação de usuário na aplicação
# Variavel emailUsuario guarda em sessão nome/email corporativo 
# Variavel tipoAcesso guarda em sessão tipo de acesso a aplicação
#
from Products.PythonScripts.standard import html_quote
from AccessControl import getSecurityManager

request  = container.REQUEST
RESPONSE = request.RESPONSE
SESSION  = request.SESSION

context.portal_skins.updateSkinCookie()

emailUsuario = getSecurityManager().getUser().getUserName().upper()
SESSION["emailUsuario"] = emailUsuario

tipoAcesso = ""
resultSetTipoUsuario = container.zsql_consulta_usuario_tipo_acesso(email_usuario=emailUsuario)
if len(resultSetTipoUsuario):
  tipoAcesso = container.zsql_consulta_usuario_tipo_acesso(email_usuario=emailUsuario)[0][0].upper()

SESSION["tipoAcesso"] = tipoAcesso

if context.portal_membership.isAnonymousUser():
   RESPONSE.expireCookie('__ac', path='/')
   RESPONSE.redirect('index_html?msg=*** USUÁRIO OU SENHA INVÁLIDO ! ***')
   return 0

RESPONSE.redirect('abre_tela.html')


More information about the Zope mailing list