Ver Mensaje Individual
  #10 (permalink)  
Antiguo 02/05/2005, 08:55
Avatar de verinchi
verinchi
 
Fecha de Ingreso: septiembre-2004
Ubicación: Buenos Aires
Mensajes: 647
Antigüedad: 20 años, 7 meses
Puntos: 2
.

Hola U_goldman!
No respondí antes porque nos estabamos mudando de oficina y no tenía ni internet ni red para probar las cosas.
Aquí coloco el código que lo que debería hacer es reconocer el usuario en ActiveDirectory y cargarlo en una variable de sesión para un control de permisos de usuario.

Código:
 
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/manual_sql.asp" -->
<!--#include file="inc/controlador.asp" -->
<% 
strUser = Request.ServerVariables("AUTH_USER") 
matrizUser = Split(strUser, "\", -1)
For each item in request.servervariables
  Response.Write item & " = " & request.servervariables(item) & "<br>"
Next
Response.End
Dim Group
Dim User
Set User = GetObject("WinNT://"&dominio&"/"&matrizUser(1)&",user")
counter=0
For Each Group in User.Groups
 if  Group.Description="Manual" then
  If counter<>0 then comma="," end if
  Grupos=Grupos&comma&Group.name
  counter=counter+1
  guid=Group.guid
 end if
Next
If counter>1 then
 matrizNombre = Split(strNombre, ",", -1)
end if
If counter=1 then
 matrizNombre = Grupos
end if
SET RS_listaA=SERVER.CreateObject("ADODB.Recordset")
RS_listaA.ActiveConnection = MM_manual_sql_STRING
RS_listaA.SOURCE="Select dbo.seguridad.id_nivel FROM dbo.seguridad WHERE dbo.seguridad.nombre='"&Grupos&"'"
RS_listaA.CURSORTYPE=0
RS_listaA.CURSORLOCATION=2
RS_listaA.LOCKTYPE=1
RS_listaA.OPEN()
If ((RS_listaA.EOF)or(RS_listaA.BOF)) then
 grupo_existe=false
else 
 grupo_existe=true
 Session("grupo")=Grupos
 SET RS_listaB=SERVER.CreateObject("ADODB.Recordset")
 RS_listaB.ActiveConnection = MM_manual_sql_STRING
 RS_listaB.SOURCE="Select dbo.permisos.nombre, dbo.seguridad.orden_nivel FROM dbo.seguridad INNER JOIN dbo.permisos ON dbo.seguridad.cod_permiso=dbo.permisos.id_permiso WHERE dbo.seguridad.nombre='"&Grupos&"'"
 RS_listaB.CURSORTYPE=0
 RS_listaB.CURSORLOCATION=2
 RS_listaB.LOCKTYPE=1
 RS_listaB.OPEN()
 Session("permiso")=RS_listaB("nombre").value
 Session("orden")=RS_listaB("orden_nivel").value
end if
Session("user")=matrizUser(1)
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Bienvenido al Manual de Procedimientos del Banco do Brasil </title>
<% If grupo_existe=true Then %><meta http-equiv="refresh" content="5;URL=front/index.asp"><% End If %>
<link href="bdb_estilo.css" rel="stylesheet" type="text/css">
</head>
<body><br>
<br>
<br>
<div align="center" class="txt_nombre_pa">
  <p>Bienvenido/a <%=matrizUser(1)%> al Manual de Procedimientos del Banco do Brasil.<br>
  </p>
</div>
<div align="center" class="txt_normal_azul">
  <p>Configurando el Sistema...<br>
	<% If grupo_existe=false Then %>
	<span class="txt_tit_azul_14"><strong>Usted no tiene acceso al sistema .<br>
	Consulte con el administrador.</strong></span>  <% End If %>
</p>
</div>
</body>
</html>
<% 
RS_listaA.Close()
RS_listaA.activeconnection = nothing
Set RS_listaA = Nothing
If  grupo_existe=true then
 RS_listaB.Close()
 RS_listaB.activeconnection = nothing
 Set RS_listaB = Nothing
end if
%>
Si tenés idea de qué es lo que está fallando... realmente te lo agradecería.
Por otro lado... en un momento de la vida funcionó.
Luego, coloqué en el lugar del sitio virtual que había creado uno que no tenía los niveles de seguridad para laburar unas cosas que no lo necesitaban y ahora que configuro nuevamente el sitio virtual... ya no funciona.
Sé que algo estoy haciendo mal, pero en realidad no tengo idea de que es lo que hago mal.
Un saludo grande
__________________
Why can't we not be sober?
www.partitorium.com.ar