mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
[RemoteTimers] add possibility to transfer all timers at once via webif
Use: http://boxip/control/sendalltimers?ip=10.1.1.xxx&force=1 http://boxip/control/sendalltimers?name=record%20box&force=true if parameter name is given, it has to be in timerlist as remote box. if parameter ip and name is given, ip is used. if parameter force is set, all checks are disabled, and the local timer will be deleted even the transfer was not successful.
This commit is contained in:
@@ -209,6 +209,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]=
|
||||
{"crypt", &CControlAPI::CryptCGI, "text/plain"},
|
||||
// timer
|
||||
{"timer", &CControlAPI::TimerCGI, "text/plain"},
|
||||
{"sendalltimers", &CControlAPI::TimerSendCGI, "text/plain"},
|
||||
// bouquet editing
|
||||
{"setbouquet", &CControlAPI::setBouquetCGI, "text/plain"},
|
||||
{"savebouquet", &CControlAPI::saveBouquetCGI, "text/plain"},
|
||||
@@ -335,7 +336,34 @@ void CControlAPI::TimerCGI(CyhookHandler *hh)
|
||||
hh->SendError();
|
||||
}
|
||||
|
||||
void CControlAPI::TimerSendCGI(CyhookHandler *hh)
|
||||
{
|
||||
hh->outStart();
|
||||
|
||||
if (NeutrinoAPI->Timerd->isTimerdAvailable())
|
||||
{
|
||||
if (!hh->ParamList.empty())
|
||||
{
|
||||
bool force = (hh->ParamList["force"] == "1") || (hh->ParamList["force"] == "true");
|
||||
if(!hh->ParamList["ip"].empty())
|
||||
{
|
||||
NeutrinoAPI->SendAllTimers(hh->ParamList["ip"],force);
|
||||
hh->SendOk();
|
||||
}
|
||||
else if(!hh->ParamList["name"].empty())
|
||||
{
|
||||
NeutrinoAPI->SendAllTimers(NeutrinoAPI->GetRemoteBoxIP(decodeString(hh->ParamList["name"])),force);
|
||||
hh->SendOk();
|
||||
}
|
||||
else
|
||||
hh->SendError();
|
||||
}
|
||||
}
|
||||
else
|
||||
hh->SendError();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void CControlAPI::SetModeCGI(CyhookHandler *hh)
|
||||
{
|
||||
if (!(hh->ParamList.empty()))
|
||||
|
Reference in New Issue
Block a user