Patch level : 10.0
Files correlati : authoriz.exe lurch.exe Ricompilazione Demo : [ ] Commento : Aggiunti bottoni "veri" HTML+JavaScript al posto delle vecchie celle grige, che ne simulavano il comportamento grezzamente. git-svn-id: svn://10.65.10.50/branches/R_10_00@20850 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									cc7e2e812a
								
							
						
					
					
						commit
						91fb140565
					
				| @ -22,10 +22,8 @@ public: | ||||
| }; | ||||
| 
 | ||||
| TUserInfo::TUserInfo(const wxChar* user, const wxChar* host) | ||||
|          : m_strName(user), m_strHost(host),  | ||||
| 				   m_time(wxDateTime::Now()), m_nPrograms(0)  | ||||
| {  | ||||
| } | ||||
|          : m_strName(user), m_strHost(host), m_time(wxDateTime::Now()), m_nPrograms(0)  | ||||
| { } | ||||
| 
 | ||||
| WX_DECLARE_HASH_MAP( wxString, TUserInfo*, wxStringHash, wxStringEqual, TUsersHashMap ); | ||||
| 
 | ||||
| @ -239,9 +237,7 @@ wxString TAuthorizationServer::GarbleMD5(unsigned short n, const wxDateTime& dat | ||||
| // Implementare almeno queste due funzioni pure virtuali
 | ||||
| 
 | ||||
| const wxChar* TAuthorizationServer::GetAppName() const | ||||
| { | ||||
| 	return "Authorization"; | ||||
| } | ||||
| {	return wxT("Authorization"); } | ||||
| 
 | ||||
| bool TAuthorizationServer::IsMagicName(wxString& strFilename) const | ||||
| { | ||||
| @ -365,10 +361,10 @@ void TAuthorizationServer::GenerateIndex(wxString& strFilename) | ||||
| 	TXmlItem& tr6 = body.AddChild("tr"); | ||||
|   TXmlItem& al = tr6.AddChild("td").AddChild("a"); | ||||
| 	al.SetAttr("href", "Log"); al << "Log File"; | ||||
|   tr6.AddChild("td") << GetLogFileName(); | ||||
| 
 | ||||
| 	TXmlItem& tr7 = body.AddChild("tr"); | ||||
|   TXmlItem& as = tr7.AddChild("td").AddChild("a"); | ||||
| 	as.SetAttr("href", "stop.cgi"); as << "Stop the Server"; | ||||
|   TXmlItem& tr7 = body.AddChild("tr").AddChild("td").SetAttr("align", "center"); | ||||
|   AddLinkButton(tr7, _("Stop the Server"), wxT("stop.cgi")); | ||||
|      | ||||
| 	strFilename = GetTempFilename(); | ||||
| 	html.Save(strFilename); | ||||
| @ -673,7 +669,7 @@ void TAuthorizationServer::ProcessActivation(int nModule, bool act, wxSocketBase | ||||
| 		m_Dongle.Burn(); | ||||
| 		InitModules(); | ||||
| 	} | ||||
| 	wxString strFileName = "Modules"; | ||||
| 	wxString strFileName = wxT("Modules"); | ||||
| 	GenerateFile(strFileName); | ||||
| 	SendFile(strFileName, outs); | ||||
| } | ||||
| @ -981,7 +977,7 @@ bool TAuthorizationServer::Initialization() | ||||
| bool TAuthorizationServer::Deinitialization() | ||||
| { | ||||
| 	m_Dongle.Logout(); | ||||
| #ifdef WIN32 | ||||
| #ifdef __WXMSW__ | ||||
| 	// Definitely kill global atom
 | ||||
| 	for (ATOM a = ::GlobalFindAtom(ATOMIC_SEMAPHORE); | ||||
| 	     a != NULL; | ||||
|  | ||||
| @ -243,14 +243,25 @@ TXmlItem& TBaseServerApp::CreatePageBody(TXmlItem& html, wxString header) const | ||||
| 
 | ||||
| TXmlItem& TBaseServerApp::AddLinkButton(TXmlItem& body, const wxChar* strCaption, const wxChar* strHref) const | ||||
| { | ||||
|   /*
 | ||||
|   TXmlItem& table = body.AddChild("table"); | ||||
| 	table.SetAttr("border", "2"); table.SetAttr("bgcolor", "#C0C0C0"); | ||||
| 
 | ||||
| 	TXmlItem& td = table.AddChild("tr").AddChild("td"); | ||||
| 	td.SetAttr("align", "center"); | ||||
| 	td.AddChild("a").SetAttr("href", strHref) << strCaption; | ||||
| 	 | ||||
| 	return table; | ||||
|   */ | ||||
| 
 | ||||
|   TXmlItem& b = body.AddChild("button"); | ||||
| 	b.SetAttr("type", "button");  | ||||
|   wxString strScript; | ||||
|   strScript += "window.open('"; | ||||
|   strScript += strHref; | ||||
|   strScript += "', '_self')"; | ||||
|   b.SetAttr("onClick", strScript);  | ||||
|   b << strCaption; | ||||
| 	return b; | ||||
| } | ||||
| 
 | ||||
| void TBaseServerApp::MessageBox(const wxChar* caption, const wxChar* msg, wxSocketBase& outs) | ||||
| @ -266,9 +277,12 @@ void TBaseServerApp::MessageBox(const wxChar* caption, const wxChar* msg, wxSock | ||||
| 	td0.SetAttr("align", "justify"); | ||||
| 	td0.AddChild("h3") << msg; | ||||
| 
 | ||||
|   if (m_bRunning) // Aggiungi il bottone di ritorno solo se il server non si sta spegnendo
 | ||||
|   { | ||||
| 	  TXmlItem& td1 = table.AddChild("tr").AddChild("td"); | ||||
| 	  td1.SetAttr("align", "center"); | ||||
| 	AddLinkButton(td1, "Return to main page", "index.htm"); | ||||
| 	  AddLinkButton(td1, _("Return to main page"), "index.htm"); | ||||
|   } | ||||
| 
 | ||||
| 	const wxString strTmp = GetTempFilename(); | ||||
| 	html.Save(strTmp); | ||||
| @ -567,13 +581,16 @@ void TBaseServerApp::OnIdle(wxIdleEvent& evt) | ||||
| 
 | ||||
| 		if (CanProcessCommand(str, sock)) | ||||
| 		{ | ||||
| 			const wxSocketFlags flags = sock.GetFlags(); | ||||
| 			if (valid_socket) | ||||
|       { | ||||
|   			const wxSocketFlags flags = sock.GetFlags(); | ||||
| 				sock.SetFlags(wxSOCKET_WAITALL); | ||||
| 	  		ProcessCommand(str, sock); | ||||
| 			if (valid_socket) | ||||
| 				sock.SetFlags(flags); | ||||
|       } | ||||
|       else | ||||
|         ProcessCommand(str, sock); // Comandi come "UserLogout" vanno processati anche per socket non validi
 | ||||
| 		} | ||||
| 
 | ||||
| 		// Enable input events again.
 | ||||
| 
 | ||||
|  | ||||
| @ -83,8 +83,8 @@ bool TLurchServer::PingProcess(const wxString& strApp) | ||||
|     if (nTimeOut > 5000) nTimeOut = 5000; | ||||
| 
 | ||||
|     wxIPV4address ipAddress; | ||||
|     // ipAddress.AnyAddress(); //  Vadim Zetim lo consiglia ma non sempre funziona
 | ||||
|     ipAddress.LocalHost(); // Vadim Zetim lo sconsiglia ma pare funzionare
 | ||||
|     //ipAddress.AnyAddress();  // NON funziona con ESET
 | ||||
|     ipAddress.LocalHost();     // Pare funzionare sempre
 | ||||
|     ipAddress.Service(nPort); | ||||
|     wxSocketClient sSock(wxSOCKET_NOWAIT); | ||||
|     sSock.Connect(ipAddress, false); | ||||
| @ -99,7 +99,7 @@ bool TLurchServer::PingProcess(const wxString& strApp) | ||||
|         char buffer[8]; memset(buffer, 0, sizeof(buffer)); | ||||
|         sSock.Read(buffer, 4); | ||||
|         if (sSock.WaitForRead(0, 1)) // ... ma poi non aspetto qua :-)
 | ||||
|           bPinged = wxStrncmp(buffer, "PONG", 4) == 0; | ||||
|           bPinged = wxStrncmp(buffer, wxT("PONG"), 4) == 0; | ||||
|         sSock.Discard(); // Tralascia ulteriori dati in arrivo
 | ||||
|       } | ||||
|       else | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user