http://dieseyer.de • all rights reserved • © 2011 v11.4

</html>
<head>

<!--
'v5.5*************************************************************************
' File: Login2Server.hta
' Autor: dieseyer@gmx.de
' http://dieseyer.de
'
' Ermöglicht die Eingabe von Benutzer und Passwort für die
' Anmeldung an verschiedene Server einer anderen Domäne
'
'*****************************************************************************

SHOWINTASKBAR="no"
WINDOWSTATE="maximize"
-->
<HTA:APPLICATION ID="oHTA"

BORDER="none"
INNERBORDER="no"
SCROLL="No"
NAVIGABLE="no"
APPLICATIONNAME="Service.CD Anmeldung"
>

<title>Login 2 Server</title>

<style type="text/css">
TD {font-size:13Pt; color:#E0C000; font-style:bold; font-family:Verdana}
input {font-size:13pt; color:#202060; font-style:bold; font-family:Verdana}
H2 {font-size:24pt; color:#E0C000; font-style:bold; font-family:Verdana}
</style>

</head>

<script language="VBscript">

Option Explicit
Const Titel = "Login 2 Server"
Dim WSHNet : Set WSHNet = CreateObject("WScript.Network")
Dim WshShell : Set WSHShell = CreateObject("Wscript.Shell")

'-----------------------------------------------------------------------------
' Start - Einstellungen
'-----------------------------------------------------------------------------
' Wenn LgOn(3,x) leer ist, wird der eingegebene UserName verwendet -
' sonst z.B. LgOn(3,3)="server-DieSeyer"

' net use K: \\Server1\Share /user:LogDom\LogName
ReDim Preserve LgOn(5, 0) : LgOn(0,0)= "T:" : LgOn(1,0)= "\\ServerX\transfer" : LgOn(2,0)="InternX" : LgOn(3,0)=""
' ReDim Preserve LgOn(5, 1) : LgOn(0,1)= "R:" : LgOn(1,1)= "\\Server2\C$" : LgOn(2,1)="LogDom" : LgOn(3,1)=""
' ReDim Preserve LgOn(5, 2) : LgOn(0,2)= "S:" : LgOn(1,2)= "\\Server2\D$" : LgOn(2,2)="LogDom" : LgOn(3,2)=""
' ReDim Preserve LgOn(5, 3) : LgOn(0,3)= "L:" : LgOn(1,3)= "\\Server1\D$" : LgOn(2,3)="LogDom" : LgOn(3,3)="server-DieSeyer"

'-----------------------------------------------------------------------------

Dim i, Tx, Td, Text
Dim UserPwd, UserName

'*****************************************************************************
Function BeimLaden() ' ruft einige Routinen auf
'*****************************************************************************

Tx=""
Tx=Tx & "<input Type=""Text"" Name=""UserName"" VALUE=""%UserName%"" >   "
Tx=Tx & "<input Type=""Password"" Name=""UserPwd"" VALUE="""" > "
document.all.NamePwd.innerHTML = Tx

td = "<td style=""hight:25; border:1 solid blue""> "
Tx=""
For i = LBound( LgOn, 2 ) to UBound( LgOn, 2 ) ' für alle Spalten
Tx=Tx & "<table style=""border:1 solid blue; border-collapse:collapse; background-color:#2d3170;"">"
Tx=Tx & "<table style=""border:1 solid blue; border-collapse:collapse; background-color:#2d3170;"">"
Tx=Tx & " <colgroup> <col width=""30"" span=""1""><col width=""320"" span=""2""><col width=""25"" span=""1""></colgroup>"
Tx=Tx & " <tr style=""height:35; border:1 solid blue; font-size:8pt;"">"

Tx=Tx & td & LgOn(0, i ) & "</td>"
Tx=Tx & td & LgOn(1, i ) & "</td>"
If LgOn(3, i ) = "" Then Tx=Tx & td & LgOn(2, i ) & "\" & "%UserName%" & "</td>"
If not LgOn(3, i ) = "" Then Tx=Tx & td & LgOn(2, i ) & "\" & LgOn(3, i ) & "</td>"
Tx=Tx & td & i & "</td>"
Tx=Tx & "</tr></table>"
Next

document.all.NeuListAnzeige.innerHTML = Tx

End Function ' BeimLaden()



'*****************************************************************************
sub LoginStart()
'*****************************************************************************

UserName = Document.All.UserName.Value
If UserName = "" Then Msgbox "Ein Username ist erforderlich" : Exit Sub

UserPwd = Document.All.UserPwd.Value
If UserPwd = "" Then Msgbox "Ein Passwort ist erforderlich" : Exit Sub

Text = ""
For i = LBound( LgOn, 2 ) to UBound( LgOn, 2 ) ' für alle Spalten
Tx=""

If LgOn(3, i ) = "" Then Tx=Tx & LgOn(0, i ) & ", " & LgOn(1, i ) & ", , " & LgOn(2, i ) & "\" & UserName ' & ", " & UserPwd
If not LgOn(3, i ) = "" Then Tx=Tx & LgOn(0, i ) & ", " & LgOn(1, i ) & ", , " & LgOn(2, i ) & "\" & LgOn(3, i ) ' & ", " & UserPwd
Text = Text & "WSHNet.MapNetworkDrive " & Tx & vbCRLF ' : MsgBox Text, 4096, Titel

If LgOn(3, i ) = "" Then WSHNet.MapNetworkDrive LgOn(0, i ) , LgOn(1, i ) , , LgOn(2, i ) & "\" & UserName , UserPwd
If not LgOn(3, i ) = "" Then WSHNet.MapNetworkDrive LgOn(0, i ) , LgOn(1, i ) , , LgOn(2, i ) & "\" & LgOn(3, i ) , UserPwd
' WSHNet.MapNetworkDrive( strLocalName, strRemoteName ,[bUpdateProfile], [strUser] , [strPassword])

Next

Text = "Folgendes wurde erledigt:" & vbCRLF & vbCRLF & Text
MsgBox Text, , Titel

self.close
End Sub ' LoginStart()



</script>

<body onLoad="BeimLaden()" bgcolor="#202060" >

<form>


<center style="font-size:8pt; color:#E0C000; font-family:San-Serif,Verdana;">
<a href="http://dieseyer.de">dieseyer.de</a><br><br>
</center>
<center style="font-size:20pt; color:#E0C000; font-family:San-Serif,Verdana; font-weight:bold;">
Login 2 Server
</center>

<table border="0" cellspacing="20px" width="100%">
<tr>
<td bgcolor=#1d2160 align="center" cellspacing="20%" >
<fieldset><Legend align="Center"></legend>
<BR>
UserName                 Passwort  
<BR><BR>
<span id=NamePwd> </span>
<BR><BR>
<INPUT TYPE="Button" Name="Logon" value="Login starten" onClick="LoginStart()" >
<BR><BR>
</fieldset>
</td>
</tr>
</table>

<center>
<span id=NeuListAnzeige> </span>
</center>

</form>

</body>

</html>



http://dieseyer.de • all rights reserved • © 2011 v11.4