Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 16 su 16
  1. #11
    Questa è la pagina di log in

    codice:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    
    <%
    ' *** Validate request to log in to this site.
    MM_LoginAction = Request.ServerVariables("URL")
    If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
    MM_valUsername=CStr(Request.Form("user"))
    If MM_valUsername <> "" Then
      MM_fldUserAuthorization="Permesso"
      MM_redirectLoginSuccess="index.asp"
      MM_redirectLoginFailed="login.asp"
      MM_flag="ADODB.Recordset"
      set MM_rsUser = Server.CreateObject(MM_flag)
      MM_rsUser.ActiveConnection = MM_conn_teammeccanica_STRING
      MM_rsUser.Source = "SELECT Nome_completo, PWD"
      If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
      MM_rsUser.Source = MM_rsUser.Source & " FROM q_user WHERE Nome_completo='" & Replace(MM_valUsername,"'","''") &"' AND PWD='" & Replace(Request.Form("textfield2"),"'","''") & "'"
      MM_rsUser.CursorType = 0
      MM_rsUser.CursorLocation = 2
      MM_rsUser.LockType = 3
      MM_rsUser.Open
      If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then 
        ' username and password match - this is a valid user
        Session("MM_Username") = MM_valUsername
        If (MM_fldUserAuthorization <> "") Then
          Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
        Else
          Session("MM_UserAuthorization") = ""
        End If
        if CStr(Request.QueryString("accessdenied")) <> "" And true Then
          MM_redirectLoginSuccess = Request.QueryString("accessdenied")
        End If
        MM_rsUser.Close
        Response.Redirect(MM_redirectLoginSuccess)
      End If
      MM_rsUser.Close
      Response.Redirect(MM_redirectLoginFailed)
    End If
    %>
    <% 
    Session("User") = CStr(Request.Form("user"))
    %>
    <%
    Session.Timeout=60
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    
    <title>Team Meccanica - Tecnico</title>
    
    
    
    
    <link href="Css/gestione.css" rel="stylesheet" type="text/css" /></head>
    
    <body>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="20%" valign="top" class="altosx"><h1>[img]Img/logo%20team.jpg[/img]</h1></td>
        <td width="80%" valign="top" class="altodx"><table width="600" border="0" cellspacing="0" cellpadding="00">
          <tr>
            <td width="100" class="bigmenu">Commerciale</td>
            <td width="100" class="bigmenu">Tecnico</td>
            <td width="100" class="bigmenu">Acquisti</td>
            <td width="100" class="bigmenu">Magazzino</td>
            <td width="100" class="bigmenu">Amministrazione</td>
            <td width="100" class="bigmenu">Utilit&agrave;</td>
          </tr>
        </table>
        <hr />
          <table width="400" border="0" cellspacing="0" cellpadding="00">
            <tr>
              <td width="50%"></td>
              <td width="50%"></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td width="20%" valign="top" class="bassosx">
    <table width="100%" border="0" cellspacing="0" cellpadding="00">
            <tr>
              <td>Utente: - IN FASE DI REGISTRAZIONE - </td>
            </tr>
            <tr>
              <td></td>
            </tr>
            <tr>
              <td>Team Meccanica  &gt; LOGIN </td>
            </tr>
            <tr>
              <td></td>
            </tr>
    
            <tr>
              <td></td>
            </tr>
            <tr>
              <td></td>
            </tr>
          </table>
        _</td>
        <td width="80%" valign="top" class="bassodx">
          <table width="100%" height="454" border="0" cellpadding="00" cellspacing="0">
            <tr>
              <td valign="top"><form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
                <table width="100%" border="0" cellspacing="1" cellpadding="1">
                  <tr>
                    <td width="30%">Username:</td>
                    <td><label>
                      <input name="user" type="text" id="user" />
                    </label></td>
                  </tr>
                  <tr>
                    <td>Password:</td>
                    <td><label>
                      <input type="password" name="textfield2" />
                    </label></td>
                  </tr>
                  <tr>
                    <td colspan="2"><label>
                      <div align="center">
                        <input type="submit" name="Submit" value="Invia" />
                      </div>
                      </label></td>
                    </tr>
                </table>
                        </form>
              
    
    </p>
                
    
     </p>            
    
    </p></td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td width="20%"></td>
        <td width="80%"></td>
      </tr>
    </table>
    </body>
    </html>

  2. #12
    Utente di HTML.it L'avatar di albis
    Registrato dal
    May 2002
    Messaggi
    912
    sulla riga che valorizza la session non ci passa nemmeno
    viene redirezionato prima
    quindi dovresti spostare quella riga prima.
    ma è inutile c'è gia una variabile di sessione valorizzata con lo user
    Session("MM_Username")
    Forza la magica ROMA

  3. #13
    quindi basta che io usi MM_Username?

  4. #14
    Utente di HTML.it L'avatar di albis
    Registrato dal
    May 2002
    Messaggi
    912
    si
    Forza la magica ROMA

  5. #15
    OK funziona con MM_Username

  6. #16
    C'è un altro problema...
    Non mi filtra gli accessi...
    Es, un utente con permesso A riesce ad entrare in questa pagina (e non dovrebbe farlo!!!):
    codice:
    <%
    ' *** Restrict Access To Page: Grant or deny access to this page
    MM_authorizedUsers="C,AC,BC,CD,CE,ABC,ACD,ACE,BCE,BCD,CDE,ABCD,ABCE,ACDE,BCDE,ABCDE"
    MM_authFailedURL="login.asp"
    MM_grantAccess=false
    If Session("MM_Username") <> "" Then
      If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
             (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
        MM_grantAccess = true
      End If
    End If
    If Not MM_grantAccess Then
      MM_qsChar = "?"
      If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
      MM_referrer = Request.ServerVariables("URL")
      if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
      MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
      Response.Redirect(MM_authFailedURL)
    End If
    %>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.