Avatar billede nordisk Nybegynder
06. april 2002 - 18:44 Der er 9 kommentarer og
1 løsning

Passwordet?

Hvor er selve passwordet i denne sætning:

<script language="JavaScript">
<!--

function CheckLogin() {
if (document.adminFrm.password.value == "") {document.adminFrm.password.focus();return false;}
}

// -->
</script>
Avatar billede Slettet bruger
06. april 2002 - 18:46 #1
Det er der slet ikke - da det bare checker om der er tomt i feltet. Det ville også være lidt lamt hvis man kunne se det i kilden ikke?
Avatar billede Slettet bruger
06. april 2002 - 18:46 #2
Det er lavet serverside
Avatar billede -sofus- Nybegynder
06. april 2002 - 18:47 #3
Det er jo bare en funktion som ser om feltet er tomt .
Avatar billede -sofus- Nybegynder
06. april 2002 - 18:47 #4
nåh. jeg er for langsom
Avatar billede nordisk Nybegynder
06. april 2002 - 18:48 #5
Så får i sku hele koden HEHE:
---------

<!-- #include file="simpelchat.inc" -->
<%
Response.Buffer = True

Mode = Request("mode")

If Mode = "" Then
End If

If Mode = "login" Then
%>
<html>

<head>
<title><%= ChatTitle %></title>
</head>

<frameset framespacing="1" border="0" frameborder="0" rows="25,*">
  <frame src="admin.asp?mode=admin_header" marginwidth="25" marginheight="0" scrolling="no" noresize>
  <frame src="admin.asp?mode=admin_login" marginwidth="20" marginheight="20" scrolling="auto" noresize>
  <noframes>
  <body>

  </body>
  </noframes>
</frameset>

</html>
<%
End If

If Mode = "admin_header" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor1 %>" text="<%= TextColor1 %>" link="<%= LinkColor1 %>" alink="<%= LinkColor1 %>" vlink="<%= LinkColor1 %>">

<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="middle" align="left"><b>Administrator funktioner</b></td>
  </tr>
</table>

</body>

</html>
<%
End If

If Mode = "admin_login" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
<script language="JavaScript">
<!--

function CheckLogin() {
if (document.adminFrm.password.value == "") {document.adminFrm.password.focus();return false;}
}

// -->
</script>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>" onload="java script:adminFrm.password.focus();">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Beskyttet område</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left">Skriv din adgangskode i boksen nedenfor.</td>
  </tr>
  <tr>
    <td valign="top" align="left">
      <table border="0" cellspacing="0" cellpadding="5">
        <form method="POST" action="admin.asp" name="adminFrm" onsubmit="java script:return CheckLogin();">
        <input type="hidden" name="mode" value="activate">
        <tr>
          <td valign="middle" align="left"><input type="password" name="password" size="15" maxlength="10" style="font-family: Verdana; font-size: 8 pt"></td>
          <td valign="middle" align="left"><input type="submit" value="Login" style="font-family: Verdana; font-size: 8 pt"></td>
        </tr>
        </form>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
End If

If Mode = "activate" Then
    If Request("password") = AdminPassword Then
        Response.Redirect "admin.asp?mode=activated&password=" & Request("password")
    Else
        Response.Redirect "admin.asp?mode=admin_login"
    End If
End If

If Mode = "activated" Then
    If Request("password") = AdminPassword Then
        If Request("action") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Hovedmenu</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser">Slet
      bruger</a> - <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeallusers">Slet
      alle brugere</a> - <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=resetmessages">Nustil
      beskeder</a></td>
  </tr>
</table>

</body>

</html>
<%
        End If
        If Request("action") = "removeuser" Then
            If Request("userid") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Slet bruger</u></b></td>
  </tr>
  <%
If Application("chatusers") = 1 Then
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Tilbage</a></td>
  </tr>
  <%
Else
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <%
End If
  %>
  <tr>
    <td valign="top" align="left">
      <table border="0" cellspacing="0" cellpadding="5">
        <%
If Application("chatusers") = 1 Then
        %>
        <tr>
          <td valign="top" align="left">Der er ingen aktive brugere i chatten.</td>
        </tr>
        <%
    Else
    For x = 1 To Application("chatusers")
        If Application("chatuser_" & x) <> Session("chatname") Then
        %>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser&amp;userid=<%= x %>">Slet</a></td>
          <td valign="top" align="left"><font color="#00FF00"><b><% Response.Write Application("chatuser_" & x) %></b></font></td>
        </tr>
        <%
        End If
    Next
End If
        %>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
            Else
                If Request("confirm") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Slet bruger</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <tr>
    <td valign="top" align="left">
      <table border="0" width="100%" cellspacing="0" cellpadding="5">
        <tr>
          <td valign="top" align="left">Slet <font color="#00FF00"><b><%= Application("chatuser_" & Request("userid")) %></b></font>
            fra den aktive brugerliste?</td>
        </tr>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser&amp;userid=<%= Request("userid") %>&amp;confirm=yes">Ja</a>
            / <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeuser">Nej</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
                Else
                    For x = MaxPublicMessages To 2 Step -1
                        Application("publicmessage_" & x) = Application("publicmessage_" & x-1)
                    Next
                    Application("publicmessage_1") = "<b><font color='" & SystemColor & "'>Chatten : Admin har smidt " & Application("chatuser_" & Request("userid")) & " af chatten...</font></b>"
                    Application("chatusers") = Application("chatusers") - 1
                    Application("chatuser_" & Request("userid")) = ""
                    Response.Redirect "admin.asp?mode=activated&password=" & Request("password") & "&action=removeuser"
                End If
            End If
        End If
        If Request("action") = "removeallusers" Then
            If Request("confirm") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Slet alle brugere</u></b></td>
  </tr>
  <%
If Application("chatusers") = 1 Then
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Tilbage</a></td>
  </tr>
  <%
Else
  %>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <%
End If
  %>
  <tr>
    <td valign="top" align="left">
      <table border="0" width="100%" cellspacing="0" cellpadding="5">
        <%
If Application("chatusers") = 1 Then
        %>
        <tr>
          <td valign="top" align="left">Der er ingen aktive brugere i chatten.</td>
        </tr>
        <%
    Else
        %>
        <tr>
          <td valign="top" align="left">Slet alle brugere fra den aktive brugerliste?</td>
        </tr>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=removeallusers&amp;confirm=yes">Ja</a>
            / <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Nej</a></td>
        </tr>
        <%
End If
        %>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
            Else
                For x = MaxPublicMessages To 2 Step -1
                    Application("publicmessage_" & x) = Application("publicmessage_" & x-1)
                Next
                Application("publicmessage_1") = "<b><font color='" & SystemColor & "'>Chatten : Admin har smidt alle brugere af chatten...</font></b>"
                For x = 1 To Application("chatusers")
                    If Application("chatuser_" & x) <> Session("chatname") Then
                        Application("chatusers") = Application("chatusers") - 1
                        Application("chatuser_" & x) = ""
                    End If
                Next
                Response.Redirect "admin.asp?mode=activated&password=" & Request("password")
            End If
        End If
        If Request("action") = "resetmessages" Then
            If Request("confirm") = "" Then
%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<style>
<!--
td          { font-family: Verdana; font-size: 8 pt }
-->
</style>
</head>

<body bgcolor="<%= BGColor2 %>" text="<%= TextColor2 %>" link="<%= LinkColor2 %>" alink="<%= LinkColor2 %>" vlink="<%= LinkColor2 %>">

<table border="0" width="100%" cellspacing="0" cellpadding="5">
  <tr>
    <td valign="top" align="left"><b><u>Nulstil beskeder</u></b></td>
  </tr>
  <tr>
    <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Annuller</a></td>
  </tr>
  <tr>
    <td valign="top" align="left">
      <table border="0" width="100%" cellspacing="0" cellpadding="5">
        <tr>
          <td valign="top" align="left">Nulstil beskederne i chatten?</td>
        </tr>
        <tr>
          <td valign="top" align="left"><a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>&amp;action=resetmessages&amp;confirm=yes">Ja</a>
            / <a href="admin.asp?mode=activated&amp;password=<%= Request("password") %>">Nej</a></td>
        </tr>
      </table>
    </td>
  </tr>
</table>

</body>

</html>
<%
            Else
                For x = 1 to MaxPublicMessages
                    Application("publicmessage_" & x) = ""
                Next
                Application("publicmessage_1") = "<b><font color='" & SystemColor & "'>Chatten : Admin har nulstillet chatten...</font></b>"
                Response.Redirect "admin.asp?mode=activated&password=" & Request("password")
            End If
        End If
    Else
        Response.Redirect "admin.asp?mode=admin_login"
    End If
End If
%>


-----
Slut fra Nordisk
Avatar billede Slettet bruger
06. april 2002 - 18:50 #6
Password = AdminPassword som er en variabel som måske er i din .inc fil?
Avatar billede nordisk Nybegynder
06. april 2002 - 18:52 #7
Nåja tak for hjælpen!
Avatar billede -sofus- Nybegynder
06. april 2002 - 18:54 #8
Den ligger her:
If Request("password") = AdminPassword Then

udskift adminpassword med det password du skal bruge
Avatar billede -sofus- Nybegynder
06. april 2002 - 18:54 #9
argh! jeg giver op...
Avatar billede nordisk Nybegynder
06. april 2002 - 18:55 #10
HEHEHE
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester