SCRIPT AUTENTIFICACIÓN
Publicado por Javier Oliver (1 intervención) el 22/06/2013 18:20:42
Hola.
Mi duda es la siguiente:
En el trabajo he de acceder a una página web con la que trabajamos, y cuando recibimos alguna alerta, me he de loguear en el tipico formulario de login que hayu en las páginas web con 10 usuarios disntintos para poder enviarles las alertas.
Desearia poder tener 10 scripts para que directamente al pinchar sobre cada uno de ellos se abriera la página web y habiendose validado ya con cada usuario y contraseña.
He estado investigando(lo mio no es la programación) y lo único que he conseguido averiguar es como poder abrir la página( a través de un script con VB) con el siguiente código:
Private Sub CommandButton4_Click()
Call Shell("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe www.twitter.com")
End Sub
Pongo como ejemplo la página de twitter pero ahi iria la página en cuestión.
Me da igual que el script sea en VB o en cualquier otro lenguaje. la página web a la que quiero acceder tiene varias funciones entre ellas una de vaidadFormulario, pero no se de que forma pasarle los parámetro.
¿Pódriáis echarme una mano?
Muchas gracias,
El codigo de la pagina web es el siguiente:
Mi duda es la siguiente:
En el trabajo he de acceder a una página web con la que trabajamos, y cuando recibimos alguna alerta, me he de loguear en el tipico formulario de login que hayu en las páginas web con 10 usuarios disntintos para poder enviarles las alertas.
Desearia poder tener 10 scripts para que directamente al pinchar sobre cada uno de ellos se abriera la página web y habiendose validado ya con cada usuario y contraseña.
He estado investigando(lo mio no es la programación) y lo único que he conseguido averiguar es como poder abrir la página( a través de un script con VB) con el siguiente código:
Private Sub CommandButton4_Click()
Call Shell("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe www.twitter.com")
End Sub
Pongo como ejemplo la página de twitter pero ahi iria la página en cuestión.
Me da igual que el script sea en VB o en cualquier otro lenguaje. la página web a la que quiero acceder tiene varias funciones entre ellas una de vaidadFormulario, pero no se de que forma pasarle los parámetro.
¿Pódriáis echarme una mano?
Muchas gracias,
El codigo de la pagina web es el siguiente:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<html xmlns:fo="http://www.w3.org/1999/XSL/Format">
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Servicios On-Line : Ministerio de Defensa : Acceder al servicio</title>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link href="/PortalPmc/css/defensa/estilo.css" type="text/css" rel="stylesheet">
<script src="/PortalPmc/scripts/defensa/carga.js" language="javascript"></script><script src="/PortalPmc/scripts/defensa/autenticacion.js" language="javascript"></script><script language="JavaScript">
<!--
function validarFormularioLogin(form) {
// Deben de rellenarse todos los campos
var valido = true;
if (valido && form.login.value=='') {
alert("Por favor, introduzca un usuario y una clave de acceso para poder acceder al servicio.");
form.login.focus();
valido=false;
}
if (valido && form.password.value=='') {
alert("Por favor, introduzca un usuario y una clave de acceso para poder acceder al servicio.");
form.password.focus();
valido=false;
}
// Control del Login -- debe ser un telefono o un email
//if (valido && !esTelefono(form.login.value) && !esEmail(form.login.value)) {
// Control del Login -- debe ser un telefono o cabecera+extension
if (valido && (!esNumerico(form.login.value) || form.login.value.length<9)) {
alert("El login indicado no es correcto. Pruebe de nuevo");
form.login.focus();
valido=false;
}
if (valido) { // Si todo OK hacemos submit
form.submit();
}
}
//-->
</script><script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
if(window.screen)if(isCenter)if(isCenter=="true"){
var myLeft = (screen.width-myWidth)/2;
var myTop = (screen.height-myHeight)/2;
features+=(features!='')?',':'';
features+=',left='+myLeft+',top='+myTop;
}
window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}
function abrir(theURL) {
alert("abrir");
abrirVentana(theURL,'','width=550,height=475,scrollbars=yes,top=100,left=150');
}
function abrirVentana(theURL,winName,features) {
personaliza = window.open(theURL,winName,features);
}
//-->
</script>
</head>
<body marginheight="0" marginwidth="10" topmargin="0" leftmargin="10">
<table cellpadding="1" cellspacing="0" border="0" width="760">
<tr>
<td valign="top"><a target="_blank" href="www.mde.es"><img src="/PortalPmc/imagenes/defensa/banner.gif" border="0"></a></td>
</tr>
<tr>
<td align="center" bgcolor="#017DC5" valign="top">
<table bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td rowspan="4"><img width="5" src="/PortalPmc/imagenes/defensa/transparente.gif"></td><td><img src="/PortalPmc/imagenes/defensa/transparente.gif"></td><td align="center">
<table cellpadding="2" cellspacing="3" border="0">
<tr>
<td width="458" height="15">
<p>Usuario: introduzca su número de móvil público (9 dígitos) o su número de extensión fija precedida de 630308536.<br> Clave de acceso: la que tenga asignada por el administrador del sistema.<br> Alta en el sistema: debe solicitarse a través de su Coordinador CIS. Los Coordinadores CIS realizarán la petición a través de la aplicación SCANS </p>
</td>
</tr>
</table>
</td><td rowspan="4"><img width="135" src="/PortalPmc/imagenes/defensa/transparente.gif"></td>
</tr>
<tr>
<td><img height="15" src="/PortalPmc/imagenes/defensa/transparente.gif"></td>
</tr>
<tr>
<td>
<table cellpadding="1" cellspacing="0" border="0" width="135">
<tr>
<td><img height="1" width="1" src="/PortalPmc/imagenes/defensa/transparente.gif"></td>
</tr>
<tr>
<td bgcolor="#017DC5">
<table bgcolor="white" cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td class="textoresaltado">CENTRO DE<br>ATENCIÓN AL<br>USUARIO</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="textoresaltado">RPV 8164400</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="textoresaltado">PÚBLICO<br>913954400</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img height="1" width="1" src="/PortalPmc/imagenes/defensa/transparente.gif"></td>
</tr>
<tr>
<td><img src="/PortalPmc/imagenes/defensa/logo_ccea.gif"></td>
</tr>
<tr>
<td><img height="1" width="1" src="/PortalPmc/imagenes/defensa/transparente.gif"></td>
</tr>
</table>
</td><td valign="top" align="center">
<form action="/PortalPmc/servlet/PortalPmc" method="post" name="f">
<input value="inicio-servicios" name="PAGE" type="hidden">
<table align="center" cellpadding="0" cellspacing="0" border="0">
<tr bgcolor="#017DC5">
<td align="left" valign="top" width="12"><img src="/PortalPmc/imagenes/defensa/1t.gif" height="12" width="12"></td><td width="340" height="15" valign="middle"><img src="/PortalPmc/imagenes/defensa/C_tt.gif" height="6" width="12"><img src="/PortalPmc/imagenes/defensa/T_inicio.gif" height="9" width="95"></td><td align="right" valign="top" width="12"><img src="/PortalPmc/imagenes/defensa/2t.gif" height="12" width="12"></td>
</tr>
<tr>
<td valign="top" width="12"><img src="/PortalPmc/imagenes/defensa/P_azul.gif" height="90" width="1"></td><td width="340">
<table cellspacing="0" cellpadding="0" border="0" height="70" width="340">
<tr valign="middle">
<td height="25" width="235"><font><img src="/PortalPmc/imagenes/defensa/tpoflecha.gif" height="7" width="10">Usuario:</font></td><td valign="middle" align="left" height="20" width="150"><input maxlength="46" size="12" name="login" type="text"></td>
</tr>
<tr>
<td height="25" width="235"><font><img src="/PortalPmc/imagenes/defensa/tpoflecha.gif" height="7" width="10">Clave de Acceso:</font></td><td valign="middle" align="left" height="20" width="150"><input maxlength="16" size="12" name="password" type="password"></td>
</tr>
<tr>
<td colspan="2">
<table align="center" cellpadding="0" cellspacing="0" border="0" width="340">
<tr align="center" valign="middle">
<td width="170" align="right" height="15"><font size="1" color="#F45712" face="Verdana, Arial, Helvetica, sans-serif"><a href="javascript:validarFormularioLogin(document.f)"><img src="/PortalPmc/imagenes/defensa/bt-aceptar.gif" hspace="15" border="0" height="10" width="58"></a></font></td><td width="170" align="left" height="25"><font size="1" color="#F45712" face="Verdana, Arial, Helvetica, sans-serif"><a href="javascript:document.f.reset()"><img src="/PortalPmc/imagenes/defensa/bt-borrar.gif" hspace="15" height="10" width="58"></a></font></td>
</tr>
</table>
</td>
</tr>
</table>
</td><td align="right" valign="top" width="12"><img src="/PortalPmc/imagenes/defensa/P_azul.gif" height="90" width="1"></td>
</tr>
<tr bgcolor="#017DC5">
<td align="left" valign="bottom" width="12"><img src="/PortalPmc/imagenes/defensa/4t.gif" height="12" width="12"></td><td width="340" eight="15" valign="bottom"><img src="/PortalPmc/imagenes/defensa/transparente.gif" height="1" width="1"></td><td valign="bottom" align="right" width="12"><img src="/PortalPmc/imagenes/defensa/3t.gif" height="12" width="12"></td>
</tr>
</table>
</form>
<table cellpadding="2" cellspacing="3" border="0">
<tr>
<td valign="top" width="458" height="15">
<p>
<b>Si tiene algún problema para acceder al servicio, contacte con nuestro Centro de Atención al Usuario.</b>
</p>
</td>
</tr>
</table>
</td><script>
document.f.login.focus();
</script>
</tr>
<tr>
<td><img height="15" src="/PortalPmc/imagenes/defensa/transparente.gif"></td>
</tr>
<tr>
<td colspan="4" align="center" height="1">
<table bgcolor="#017DC5" width="100%">
<tr valign="middle" align="center">
<td width="91"><a href="javascript:optimizado('/PortalPmc/servlet/PortalPmc?PAGE=public-telegal&opcion=telegal')"><font color="#FFFFFF"><u>Texto Legal</u></font></a></td><td width="549"><font color="#FFFFFF"> @ Ministerio de Defensa</font></td><td width="123"><a href="javascript:optimizado('/PortalPmc/servlet/PortalPmc?PAGE=public-telegal&opcion=optimizado')"><font color="#FFFFFF"><u>Optimizado para...</u></font></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Valora esta pregunta


0