committ modifiche per codice user

git-svn-id: https://keyhammer.ath.cx/svn/GMW/trunk@170 365432ac-a1b5-4ffd-bb28-6d3099d32164
This commit is contained in:
ermanno
2010-07-29 15:38:39 +00:00
parent 2f9ad213ed
commit 06b2ebff38
9 changed files with 75 additions and 16 deletions
+1
View File
@@ -203,6 +203,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
<Folder Include="logs\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
+1 -1
View File
@@ -3,7 +3,7 @@
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<StartPageUrl>Login.aspx</StartPageUrl>
<StartPageUrl>Default.aspx</StartPageUrl>
<StartAction>SpecificPage</StartAction>
<AspNetDebugging>True</AspNetDebugging>
<NativeDebugging>False</NativeDebugging>
@@ -21,16 +21,8 @@ namespace GMW_Term.WebUserControls
btnLoginPage.Text = "Login";
btnButtonsHome.Text = "Home";
/*
* se c'è in sessione uno username valido:
* non mostra login - non mostra label login - mostra username in alto -
* mostra due pulsanti per andare a Home pulsanti e per fare nuovo login
*
* se non c'è in sessione username
* mostra login con label - mostra solo un pulsante cioè fai login
*/
// se username è vuoto
// se username è valorizzato...
if (verificaOperatoreInSessione())
{
btnLoginPage.Text = "Rifai Login";
@@ -38,7 +30,7 @@ namespace GMW_Term.WebUserControls
btnButtonsHome.Visible = true;
lblData.Text = "Your data here...";
}
// se non è valorizzato chiede di effettuare login...
else
{
// sistema visualizzazione
@@ -62,8 +54,32 @@ namespace GMW_Term.WebUserControls
lblData.Text = "Inserire Operatore!";
break;
case tipoCodiceBarcode.Operatore:
memLayer.ML.setSessionVal("username", txtInput.Text);
Response.Redirect("Home.aspx");
// codice per ricavare user e dominio
string dominio = TermClass.termin.getDominioDaCodSoggetto(txtInput.Text);
string username = TermClass.termin.getUserDaCodSoggetto(txtInput.Text);
user_std _utente = new user_std();
user_std.UtSn.isForcedUser = true;
bool fatto = _utente.startUpUtente(dominio, username);
if (fatto)
{
memLayer.ML.setSessionVal("username", txtInput.Text);
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio, username);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
//if (Login_ok != null)
//{
// Login_ok(this, new EventArgs());
//}
Response.Redirect("Home.aspx");
}
else
{
// avvisa che il codice è errato
lblData.Text = "Utente " + txtInput.Text + " non registrato nel database utenti";
txtInput.Text = "";
}
break;
case tipoCodiceBarcode.ListaPrelievo:
lblData.Text = "Inserire Operatore!";
@@ -91,8 +107,30 @@ namespace GMW_Term.WebUserControls
lblData.Text = "Codice non riconosciuto: " + txtInput.Text;
break;
case tipoCodiceBarcode.Operatore:
memLayer.ML.setSessionVal("username", txtInput.Text);
Response.Redirect("Home.aspx");
string dominio = TermClass.termin.getDominioDaCodSoggetto(txtInput.Text);
string username = TermClass.termin.getUserDaCodSoggetto(txtInput.Text);
user_std _utente = new user_std();
user_std.UtSn.isForcedUser = true;
bool fatto = _utente.startUpUtente(dominio, username);
if (fatto)
{
memLayer.ML.setSessionVal("username", txtInput.Text);
string _rigaLog = String.Format("User {0} has forced user identity ok: logged as \t {1}\\{2}", Page.User.Identity.Name, dominio, username);
SteamWare.logger.lg.scriviLog(_rigaLog, SteamWare.tipoLog.INFO);
//if (Login_ok != null)
//{
// Login_ok(this, new EventArgs());
//}
Response.Redirect("Home.aspx");
}
else
{
// avvisa che il codice è errato
lblData.Text = "Utente " + txtInput.Text + " non registrato nel database utenti";
txtInput.Text = "";
}
break;
case tipoCodiceBarcode.ListaPrelievo:
lblData.Text = "Codice Lista Prelievo: " + txtInput.Text;
@@ -18,8 +18,19 @@ namespace GMW_Term.WebUserControls
// ricava dalla sessione il valore nome utente
//string nomeUtente = (string)(Session["loginName"]);
string nomeUtente = memLayer.ML.StringSessionObj("username");
// string nomeUtente = memLayer.ML.StringSessionObj("username");
string nomeUtente = "";
try
{
nomeUtente = String.Format("{0}", user_std.UtSn.CognomeNome);
}
catch
{
}
// se non vuoto scrive altrimenti no
if (!(String.IsNullOrEmpty(nomeUtente)))
{
Binary file not shown.
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
29/07/2010 17:10:28 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\ermanno
29/07/2010 17:24:05 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\ermanno
29/07/2010 17:26:03 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\ermanno
29/07/2010 17:27:10 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\ermanno
29/07/2010 17:28:35 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\ermanno
29/07/2010 17:29:58 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\ermanno
29/07/2010 17:30:12 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\marco
29/07/2010 17:30:20 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\samuele
29/07/2010 17:30:24 [INFO] - User STEAMWAREWIN\ermanno has forced user identity ok: logged as STEAMWAREWIN\marco
Binary file not shown.