Autenticazione nascosta su sito Liferay (era: help tirocinio web management)

logan1984

Nuovo Utente
25 Ott 2010
3
0
0
ciao a tutti spero mi possiate essere di aiuto vi espongo il mio problema,
sto facendo un progetto di web managment per l'universita . Mi è stato chiesto
di fare in modo che l'autenticazione ad un sito sia nascota ma non ci riesco
vi posto il codice html della pagina
HTML:
<html><head>
<script>
readCk = function(name)
{
	var nameEQ = name + "=";
	var ca = top.document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

var lang = readCk('lang');

top.gLangSettingSet = false;

if(lang)
	top.gLangSetting = lang;
else
	top.gLangSetting = "EN";

top.gLangSettingSet=true; 
</script>
<link href="../style/login.css" rel="stylesheet" type="text/css">
  <title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script src="../lib/ui.js"></script>
	<script src="../lib/eLang.js"></script>
	<script>
		document.write("<script language = \"Javascript\", src = \"../str/" + top.gLangSetting + "/global_str.js\"><\/script>");
		document.write("<script language = \"Javascript\", src = \"../str/" + top.gLangSetting + "/login_str.js\"><\/script>");
	</script>

	<script src="../impl/login_imp.js"></script>

	<script>
	onload = function() {
		if (top.gLangSettingSet == true) {
			doInit();
		}
	}
	</script>
</head><body>
	
    <table style="margin: 0px; padding: 0px;" border="0" cellpadding="0" cellspacing="0" width="100%">
		<tbody><tr>
			<td id="headerleft" width="412"><img src="http://forum.masterdrive.it/html-xml-css-javascript-dom-9/res/banner_left.png" alt="" height="63" width="412"></td>
			<td id="headermiddle"> <img src="http://forum.masterdrive.it/html-xml-css-javascript-dom-9/res/banner_background.png" alt="" border="0" height="63" width="100%"></td>

			<td id="headerright" width="407"><img src="http://forum.masterdrive.it/html-xml-css-javascript-dom-9/res/banner_right.png" alt="" height="63" width="407"></td>
		</tr>
		</tbody></table>

		&nbsp;
			<p>&nbsp;</p>
		
	        
		
    <div align="center">
    <div class="shadow">
    <h3>

<script>document.writeln(eLang.getString("login", "STR_LOGIN_PLS_LOGIN"));</script>
</h3>
    <div class="loginBox">
         <div class="lbFields">
              <form action="javascript://">
                    <p id="msglbl">
<script>document.writeln(eLang.getString("login", "STR_LOGIN_PLS_LOGIN"));</script>
</p>
                    <label style="width:85px; text-align:left;">
<script>document.writeln(eLang.getString("login", "STR_LOGIN_USERNAME"));</script>

 </label><input id="login_username" name="T1" size="20" style="width:146px;" tabindex="1" type="text"><br><br>
                    <label style="width:85px; text-align:left;">
<script>document.writeln(eLang.getString("login", "STR_LOGIN_PASSWORD"));</script>
 </label><input id="login_password" name="T2" size="20" style="width:146px;" tabindex="2" type="password"><br><br>
                    <input value="Login" class="button" name="Login" onclick="DoLogin();" type="submit">
              </form>
         </div> 
   
    </div>
    </div>

    </div>

</body></html>
questo e il codice sotto
<script src="../impl/login_imp.js"></script>
HTML:
function doInit() {
     // TODO: add page initialization code
    //first check what the reason is for us to be in the login page
    var validate_prevlogin = xmit.get({url:"/rpc/WEBSES/validate.asp",onrcv:validate_prevlogin_resp, status:''});
    document.getElementById('login_username').focus();
    
    //clear previous lastpage cookies
    
    fnCookie.erase('lastNav');
    fnCookie.erase('lastPage');
    fnCookie.erase('lItem');
    fnCookie.erase('lastHiLit');
}

var errorcodes = new Array();
errorcodes[9] = eLang.getString('common','STR_LOGINERRORCODE_9'); //fresh browser window
errorcodes[8] = eLang.getString('common','STR_LOGINERRORCODE_8'); //logged out properly and cookie is set to logged out
errorcodes[7] = eLang.getString('common','STR_LOGINERRORCODE_7');
errorcodes[6] = errorcodes[5] = errorcodes[4] = eLang.getString('common','STR_LOGINERRORCODE_4');
errorcodes[3] = eLang.getString('common','STR_LOGINERRORCODE_3');
errorcodes[2] = eLang.getString('common','STR_LOGINERRORCODE_2');
errorcodes[1] = eLang.getString('common','STR_LOGINERRORCODE_1');





var DoLogin = function()
{
    //note that we have to give the full path for the RPC page here since we are still not initialized fully
    if(document.getElementById('login_username').value == "root"){
        document.getElementById('msglbl').innerHTML = eLang.getString('common','STR_LOGINERRORCODE_7');
        document.getElementById('login_password').value = "";
        document.getElementById('login_password').focus();
        return false;
    }
    var login_rpc = xmit.getset({url:"/rpc/WEBSES/create.asp",onrcv:login_resp, status:'',timeout:60});
    login_rpc.add("WEBVAR_USERNAME",document.getElementById('login_username').value);
    login_rpc.add("WEBVAR_PASSWORD",document.getElementById('login_password').value);
    login_rpc.send();
    return false;

}

var login_resp = function()
{

    login_retval = WEBVAR_JSONVAR_WEB_SESSION.HAPI_STATUS;

    if(login_retval != 0)
    {
        document.getElementById('msglbl').innerHTML = eLang.getString('common','STR_LOGINERRORCODE_7');
        //document.getElementById('login_username').value = "";
        document.getElementById('login_password').value = "";
        document.getElementById('login_password').focus();

        return;
    }
    login_cookie = WEBVAR_JSONVAR_WEB_SESSION.WEBVAR_STRUCTNAME_WEB_SESSION[0].SESSION_COOKIE;
    document.cookie = "SessionCookie="+login_cookie+";path=/";
    document.cookie = "Username=" + document.getElementById('login_username').value + ";path=/";
    document.location = "/index.html";


}


var validate_prevlogin_resp = function()
{

    errcod = WEBVAR_JSONVAR_WEB_SESSION_VALIDATE.HAPI_STATUS;
    if(errcod != 0 || errorcodes[errcod] != undefined)
    {
        //alert(errcod + " " + errorcodes[errcod]);
        document.getElementById('msglbl').innerHTML = errorcodes[errcod];
    }
}

document.onkeypress = function(e)
{
    if(!e) e = window.event;
    
    if(e.keyCode==13)
    {
        DoLogin();
    }
}
quando vado ad immettere i dati non li passa la server
di norma quando l'ho fatto per altri siti nell'action mettevo l'url
della pagina di login e nel premere il pulsante di login mi autenticava
inoltre nella form c'era il metodo post cosa che in questo non ho riscontrato


spero di essermi espresso bene grazie a tutti dell'eventuale aiuto
ps lavoro sotto liferay perche il progetto deve essere integrato con il portale universitario fatto con liferay
 
Discussioni simili
Autore Titolo Forum Risposte Data
C Autenticazione a due fattori FB Social Media Marketing 0
MarcoGrazia Gestire lista campi vuoti in fase di autenticazione jQuery 1
felino Script PHP per leggere un file JSON. autenticazione? PHP 4
F Sistema di autenticazione e pagamento PHP 3
M Login Autenticazione Sviluppo app per Android 0
E [ASP.Net] Autenticazione integrata windows ASP.NET 0
G get userinfo da autenticazione oauth2 Javascript 0
P Salvare i dati restituiti dopo autenticazione OAuth2 Javascript 0
M Richiesta ajax con autenticazione base non funziona ! Ajax 0
E sistema di autenticazione PHP 4
Marco_88 Autenticazione PHP/OOP campi vuoti PHP 26
M Creazione sito con autenticazione utente (registrazione) PHP 3
R Sessioni, cookies e token di autenticazione PHP 0
Y Automatizzare OAuth2 ed autenticazione ASP.NET 0
R problemi di autenticazione PHP 0
B Scaricare file xml dopo autenticazione http PHP 1
M Problema doppia autenticazione HTML e CSS 4
Monital Autenticazione utenti joomla Joomla 0
Q sessione autenticazione PHP 3
M OOP e autenticazione PHP 4
max_400 Proteggere login con autenticazione database PHP 19
U Inviare una mail con autenticazione smtp PHP 4
B autenticazione iis Apache 4
A Autenticazione automatica su server ftp tramite programma in ASP Classic ASP 2
catellostefano Autenticazione a linux da php PHP 16
codesurfer Autenticazione LDAP PHP 0
F dubbio autenticazione windows reti lan Reti LAN e Wireless 4
A autenticazione con php PHP 5
E Problemi con autenticazione PHP 8
A PHP e sistema di autenticazione PHP 2
E DISPERATO! autenticazione dietro PROXY PHP 4
N classe per la gestione dell'autenticazione Snippet PHP 0
A Autenticazione sicura e Case sensitive Classic ASP 0
S autenticazione via url server apache Apache 0
S Problema reindizzamento dopo autenticazione PHP 4
M Dreamweaver Autenticazione utente Webdesign e Grafica 2
H autenticazione sessione ajax/php Ajax 2
T Form Autenticazione PHP 1
M [VB6] Crystal report e Autenticazione Win MSSQL Programmazione 0
P [PHP] Problema autenticazione mail PHP 0
A Problema con autenticazione e header() PHP 0
I ASP: autenticazione tramite password Classic ASP 4
I Dopo autenticazione non mi redireziona alla pagina. Classic ASP 3
G Autenticazione Utenti: Asp e Access 2000 Classic ASP 1
G consiglio acquisto telecamera nascosta in sensore allarme IP Cam e Videosorveglianza 0
Mer556 [HTML] TOP BAR A DISCESA NASCOSTA HTML e CSS 1
M Funzione copia nascosta Javascript 0
A mappa del sito nascosta HTML e CSS 6
F "Link Stampa" per stampare una pagina nascosta Javascript 4
Monital stringa di codice nascosta come tradurla? PHP 2

Discussioni simili