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)
|
TUserInfo::TUserInfo(const wxChar* user, const wxChar* host)
|
||||||
: m_strName(user), m_strHost(host),
|
: m_strName(user), m_strHost(host), m_time(wxDateTime::Now()), m_nPrograms(0)
|
||||||
m_time(wxDateTime::Now()), m_nPrograms(0)
|
{ }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
WX_DECLARE_HASH_MAP( wxString, TUserInfo*, wxStringHash, wxStringEqual, TUsersHashMap );
|
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
|
// Implementare almeno queste due funzioni pure virtuali
|
||||||
|
|
||||||
const wxChar* TAuthorizationServer::GetAppName() const
|
const wxChar* TAuthorizationServer::GetAppName() const
|
||||||
{
|
{ return wxT("Authorization"); }
|
||||||
return "Authorization";
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TAuthorizationServer::IsMagicName(wxString& strFilename) const
|
bool TAuthorizationServer::IsMagicName(wxString& strFilename) const
|
||||||
{
|
{
|
||||||
@ -365,10 +361,10 @@ void TAuthorizationServer::GenerateIndex(wxString& strFilename)
|
|||||||
TXmlItem& tr6 = body.AddChild("tr");
|
TXmlItem& tr6 = body.AddChild("tr");
|
||||||
TXmlItem& al = tr6.AddChild("td").AddChild("a");
|
TXmlItem& al = tr6.AddChild("td").AddChild("a");
|
||||||
al.SetAttr("href", "Log"); al << "Log File";
|
al.SetAttr("href", "Log"); al << "Log File";
|
||||||
|
tr6.AddChild("td") << GetLogFileName();
|
||||||
|
|
||||||
TXmlItem& tr7 = body.AddChild("tr");
|
TXmlItem& tr7 = body.AddChild("tr").AddChild("td").SetAttr("align", "center");
|
||||||
TXmlItem& as = tr7.AddChild("td").AddChild("a");
|
AddLinkButton(tr7, _("Stop the Server"), wxT("stop.cgi"));
|
||||||
as.SetAttr("href", "stop.cgi"); as << "Stop the Server";
|
|
||||||
|
|
||||||
strFilename = GetTempFilename();
|
strFilename = GetTempFilename();
|
||||||
html.Save(strFilename);
|
html.Save(strFilename);
|
||||||
@ -673,7 +669,7 @@ void TAuthorizationServer::ProcessActivation(int nModule, bool act, wxSocketBase
|
|||||||
m_Dongle.Burn();
|
m_Dongle.Burn();
|
||||||
InitModules();
|
InitModules();
|
||||||
}
|
}
|
||||||
wxString strFileName = "Modules";
|
wxString strFileName = wxT("Modules");
|
||||||
GenerateFile(strFileName);
|
GenerateFile(strFileName);
|
||||||
SendFile(strFileName, outs);
|
SendFile(strFileName, outs);
|
||||||
}
|
}
|
||||||
@ -961,7 +957,7 @@ bool TAuthorizationServer::Initialization()
|
|||||||
::GlobalAddAtom(ATOMIC_SEMAPHORE); // Same as old Frontend.exe
|
::GlobalAddAtom(ATOMIC_SEMAPHORE); // Same as old Frontend.exe
|
||||||
#endif
|
#endif
|
||||||
const int delay = GetConfigInt("Delay", 10);
|
const int delay = GetConfigInt("Delay", 10);
|
||||||
m_MaxTries = GetConfigInt("MaxTries", 8);
|
m_MaxTries = GetConfigInt("MaxTries", 8);
|
||||||
|
|
||||||
if (m_MaxTries < 8)
|
if (m_MaxTries < 8)
|
||||||
m_MaxTries = 8;
|
m_MaxTries = 8;
|
||||||
@ -981,7 +977,7 @@ bool TAuthorizationServer::Initialization()
|
|||||||
bool TAuthorizationServer::Deinitialization()
|
bool TAuthorizationServer::Deinitialization()
|
||||||
{
|
{
|
||||||
m_Dongle.Logout();
|
m_Dongle.Logout();
|
||||||
#ifdef WIN32
|
#ifdef __WXMSW__
|
||||||
// Definitely kill global atom
|
// Definitely kill global atom
|
||||||
for (ATOM a = ::GlobalFindAtom(ATOMIC_SEMAPHORE);
|
for (ATOM a = ::GlobalFindAtom(ATOMIC_SEMAPHORE);
|
||||||
a != NULL;
|
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& TBaseServerApp::AddLinkButton(TXmlItem& body, const wxChar* strCaption, const wxChar* strHref) const
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
TXmlItem& table = body.AddChild("table");
|
TXmlItem& table = body.AddChild("table");
|
||||||
table.SetAttr("border", "2"); table.SetAttr("bgcolor", "#C0C0C0");
|
table.SetAttr("border", "2"); table.SetAttr("bgcolor", "#C0C0C0");
|
||||||
|
|
||||||
TXmlItem& td = table.AddChild("tr").AddChild("td");
|
TXmlItem& td = table.AddChild("tr").AddChild("td");
|
||||||
td.SetAttr("align", "center");
|
td.SetAttr("align", "center");
|
||||||
td.AddChild("a").SetAttr("href", strHref) << strCaption;
|
td.AddChild("a").SetAttr("href", strHref) << strCaption;
|
||||||
|
|
||||||
return table;
|
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)
|
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.SetAttr("align", "justify");
|
||||||
td0.AddChild("h3") << msg;
|
td0.AddChild("h3") << msg;
|
||||||
|
|
||||||
TXmlItem& td1 = table.AddChild("tr").AddChild("td");
|
if (m_bRunning) // Aggiungi il bottone di ritorno solo se il server non si sta spegnendo
|
||||||
td1.SetAttr("align", "center");
|
{
|
||||||
AddLinkButton(td1, "Return to main page", "index.htm");
|
TXmlItem& td1 = table.AddChild("tr").AddChild("td");
|
||||||
|
td1.SetAttr("align", "center");
|
||||||
|
AddLinkButton(td1, _("Return to main page"), "index.htm");
|
||||||
|
}
|
||||||
|
|
||||||
const wxString strTmp = GetTempFilename();
|
const wxString strTmp = GetTempFilename();
|
||||||
html.Save(strTmp);
|
html.Save(strTmp);
|
||||||
@ -567,12 +581,15 @@ void TBaseServerApp::OnIdle(wxIdleEvent& evt)
|
|||||||
|
|
||||||
if (CanProcessCommand(str, sock))
|
if (CanProcessCommand(str, sock))
|
||||||
{
|
{
|
||||||
const wxSocketFlags flags = sock.GetFlags();
|
|
||||||
if (valid_socket)
|
if (valid_socket)
|
||||||
|
{
|
||||||
|
const wxSocketFlags flags = sock.GetFlags();
|
||||||
sock.SetFlags(wxSOCKET_WAITALL);
|
sock.SetFlags(wxSOCKET_WAITALL);
|
||||||
ProcessCommand(str, sock);
|
ProcessCommand(str, sock);
|
||||||
if (valid_socket)
|
|
||||||
sock.SetFlags(flags);
|
sock.SetFlags(flags);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ProcessCommand(str, sock); // Comandi come "UserLogout" vanno processati anche per socket non validi
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable input events again.
|
// Enable input events again.
|
||||||
|
@ -79,12 +79,12 @@ bool TLurchServer::PingProcess(const wxString& strApp)
|
|||||||
if (nPort > 0)
|
if (nPort > 0)
|
||||||
{
|
{
|
||||||
int nTimeOut = m_PingTimer.GetInterval()/3; // msec
|
int nTimeOut = m_PingTimer.GetInterval()/3; // msec
|
||||||
if (nTimeOut < 1000) nTimeOut = 1000; else
|
if (nTimeOut < 1000) nTimeOut = 1000; else
|
||||||
if (nTimeOut > 5000) nTimeOut = 5000;
|
if (nTimeOut > 5000) nTimeOut = 5000;
|
||||||
|
|
||||||
wxIPV4address ipAddress;
|
wxIPV4address ipAddress;
|
||||||
// ipAddress.AnyAddress(); // Vadim Zetim lo consiglia ma non sempre funziona
|
//ipAddress.AnyAddress(); // NON funziona con ESET
|
||||||
ipAddress.LocalHost(); // Vadim Zetim lo sconsiglia ma pare funzionare
|
ipAddress.LocalHost(); // Pare funzionare sempre
|
||||||
ipAddress.Service(nPort);
|
ipAddress.Service(nPort);
|
||||||
wxSocketClient sSock(wxSOCKET_NOWAIT);
|
wxSocketClient sSock(wxSOCKET_NOWAIT);
|
||||||
sSock.Connect(ipAddress, false);
|
sSock.Connect(ipAddress, false);
|
||||||
@ -99,7 +99,7 @@ bool TLurchServer::PingProcess(const wxString& strApp)
|
|||||||
char buffer[8]; memset(buffer, 0, sizeof(buffer));
|
char buffer[8]; memset(buffer, 0, sizeof(buffer));
|
||||||
sSock.Read(buffer, 4);
|
sSock.Read(buffer, 4);
|
||||||
if (sSock.WaitForRead(0, 1)) // ... ma poi non aspetto qua :-)
|
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
|
sSock.Discard(); // Tralascia ulteriori dati in arrivo
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -324,8 +324,8 @@ void TLurchServer::GenerateFile(wxString& strFilename)
|
|||||||
wxString strVer; strVer.Printf(wxT("%d.%d.%d"), v, t, p);
|
wxString strVer; strVer.Printf(wxT("%d.%d.%d"), v, t, p);
|
||||||
AddTableRow(panel, wxT("Version"), strVer);
|
AddTableRow(panel, wxT("Version"), strVer);
|
||||||
|
|
||||||
wxString strFreq; strFreq << m_PingTimer.GetInterval()/1000;
|
wxString strFreq; strFreq << m_PingTimer.GetInterval()/1000;
|
||||||
AddTableRow(panel, wxT("Ping Frequency"), strFreq);
|
AddTableRow(panel, wxT("Ping Frequency"), strFreq);
|
||||||
|
|
||||||
html.Save(strFilename);
|
html.Save(strFilename);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user