MythTV  master
myth.cpp
Go to the documentation of this file.
1 // Program Name: myth.cpp
3 // Created : Jan. 19, 2010
4 //
5 // Copyright (c) 2010 David Blain <dblain@mythtv.org>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //
25 
26 #include "myth.h"
27 #include <backendcontext.h>
28 
29 #include <QDir>
30 #include <QFileInfo>
31 #include <QCryptographicHash>
32 #include <QHostAddress>
33 #include <QUdpSocket>
34 
35 #include "config.h"
36 #include "version.h"
37 #include "mythversion.h"
38 #include "mythcorecontext.h"
39 #include "mythcoreutil.h"
40 #include "mythdbcon.h"
41 #include "mythlogging.h"
42 #include "storagegroup.h"
43 #include "dbutil.h"
44 #include "hardwareprofile.h"
45 #include "mythtimezone.h"
46 #include "mythdate.h"
47 #include "mythversion.h"
48 #include "serviceUtil.h"
49 #include "scheduler.h"
50 
51 #if QT_VERSION < QT_VERSION_CHECK(5,10,0)
52 #define qEnvironmentVariable getenv
53 #endif
54 
56 //
58 
60 {
61  QString sSecurityPin = gCoreContext->GetSetting( "SecurityPin", "");
62 
63  if ( sSecurityPin.isEmpty() )
64  throw( QString( "No Security Pin assigned. Run mythtv-setup to set one." ));
65  //SB: UPnPResult_HumanInterventionRequired,
66 
67  if ((sSecurityPin != "0000" ) && ( sPin != sSecurityPin ))
68  throw( QString( "Not Authorized" ));
69  //SB: UPnPResult_ActionNotAuthorized );
70 
72 
73  // ----------------------------------------------------------------------
74  // Check for DBHostName of "localhost" and change to public name or IP
75  // ----------------------------------------------------------------------
76 
77  QString sServerIP = gCoreContext->GetBackendServerIP();
78  //QString sPeerIP = pRequest->GetPeerAddress();
79 
80  if ((params.m_dbHostName.compare("localhost",Qt::CaseInsensitive)==0
81  || params.m_dbHostName == "127.0.0.1"
82  || params.m_dbHostName == "::1")
83  && !sServerIP.isEmpty()) // &&
84  //(sServerIP != sPeerIP ))
85  {
86  params.m_dbHostName = sServerIP;
87  }
88 
89  // If dbHostName is an IPV6 address with scope,
90  // remove the scope. Unescaped % signs are an
91  // xml violation
92  QString dbHostName(params.m_dbHostName);
93  QHostAddress addr;
94  if (addr.setAddress(dbHostName))
95  {
96  addr.setScopeId(QString());
97  dbHostName = addr.toString();
98  }
99  // ----------------------------------------------------------------------
100  // Create and populate a ConnectionInfo object
101  // ----------------------------------------------------------------------
102 
103  auto *pInfo = new DTC::ConnectionInfo();
104  DTC::DatabaseInfo *pDatabase = pInfo->Database();
105  DTC::WOLInfo *pWOL = pInfo->WOL();
106  DTC::VersionInfo *pVersion = pInfo->Version();
107 
108  pDatabase->setHost ( dbHostName );
109  pDatabase->setPing ( params.m_dbHostPing );
110  pDatabase->setPort ( params.m_dbPort );
111  pDatabase->setUserName ( params.m_dbUserName );
112  pDatabase->setPassword ( params.m_dbPassword );
113  pDatabase->setName ( params.m_dbName );
114  pDatabase->setType ( params.m_dbType );
115  pDatabase->setLocalEnabled ( params.m_localEnabled );
116  pDatabase->setLocalHostName( params.m_localHostName );
117 
118  pWOL->setEnabled ( params.m_wolEnabled );
119  pWOL->setReconnect ( params.m_wolReconnect.count() );
120  pWOL->setRetry ( params.m_wolRetry );
121  pWOL->setCommand ( params.m_wolCommand );
122 
123  pVersion->setVersion ( MYTH_SOURCE_VERSION );
124  pVersion->setBranch ( MYTH_SOURCE_PATH );
125  pVersion->setProtocol ( MYTH_PROTO_VERSION );
126  pVersion->setBinary ( MYTH_BINARY_VERSION );
127  pVersion->setSchema ( MYTH_DATABASE_VERSION );
128 
129  // ----------------------------------------------------------------------
130  // Return the pointer... caller is responsible to delete it!!!
131  // ----------------------------------------------------------------------
132 
133  return pInfo;
134 }
135 
137 //
139 
141 {
142  if (!gCoreContext)
143  throw( QString( "No MythCoreContext in GetHostName." ));
144 
145  return gCoreContext->GetHostName();
146 }
148 //
150 
151 QStringList Myth::GetHosts( )
152 {
153  MSqlQuery query(MSqlQuery::InitCon());
154 
155  if (!query.isConnected())
156  throw( QString( "Database not open while trying to load list of hosts" ));
157 
158  query.prepare(
159  "SELECT DISTINCTROW hostname "
160  "FROM settings "
161  "WHERE (not isNull( hostname ))");
162 
163  if (!query.exec())
164  {
165  MythDB::DBError("MythAPI::GetHosts()", query);
166 
167  throw( QString( "Database Error executing query." ));
168  }
169 
170  // ----------------------------------------------------------------------
171  // return the results of the query
172  // ----------------------------------------------------------------------
173 
174  QStringList oList;
175 
176  while (query.next())
177  oList.append( query.value(0).toString() );
178 
179  return oList;
180 }
181 
183 //
185 
186 QStringList Myth::GetKeys()
187 {
188  MSqlQuery query(MSqlQuery::InitCon());
189 
190  if (!query.isConnected())
191  throw( QString("Database not open while trying to load settings"));
192 
193  query.prepare("SELECT DISTINCTROW value FROM settings;" );
194 
195  if (!query.exec())
196  {
197  MythDB::DBError("MythAPI::GetKeys()", query);
198 
199  throw( QString( "Database Error executing query." ));
200  }
201 
202  // ----------------------------------------------------------------------
203  // return the results of the query
204  // ----------------------------------------------------------------------
205 
206  QStringList oResults;
207 
208  //pResults->setObjectName( "KeyList" );
209 
210  while (query.next())
211  oResults.append( query.value(0).toString() );
212 
213  return oResults;
214 }
215 
217 //
219 
221  const QString &sHostName )
222 {
223  MSqlQuery query(MSqlQuery::InitCon());
224 
225  if (!query.isConnected())
226  throw( QString("Database not open while trying to list "
227  "Storage Group Dirs"));
228 
229  if (!sGroupName.isEmpty() && !sHostName.isEmpty())
230  {
231  query.prepare("SELECT id, groupname, hostname, dirname "
232  "FROM storagegroup "
233  "WHERE groupname = :GROUP AND hostname = :HOST "
234  "ORDER BY groupname, hostname, dirname" );
235  query.bindValue(":HOST", sHostName);
236  query.bindValue(":GROUP", sGroupName);
237  }
238  else if (!sHostName.isEmpty())
239  {
240  query.prepare("SELECT id, groupname, hostname, dirname "
241  "FROM storagegroup "
242  "WHERE hostname = :HOST "
243  "ORDER BY groupname, hostname, dirname" );
244  query.bindValue(":HOST", sHostName);
245  }
246  else if (!sGroupName.isEmpty())
247  {
248  query.prepare("SELECT id, groupname, hostname, dirname "
249  "FROM storagegroup "
250  "WHERE groupname = :GROUP "
251  "ORDER BY groupname, hostname, dirname" );
252  query.bindValue(":GROUP", sGroupName);
253  }
254  else
255  {
256  query.prepare("SELECT id, groupname, hostname, dirname "
257  "FROM storagegroup "
258  "ORDER BY groupname, hostname, dirname" );
259  }
260 
261  if (!query.exec())
262  {
263  MythDB::DBError("MythAPI::GetStorageGroupDirs()", query);
264 
265  throw( QString( "Database Error executing query." ));
266  }
267 
268  // ----------------------------------------------------------------------
269  // return the results of the query plus R/W and size information
270  // ----------------------------------------------------------------------
271 
272  auto* pList = new DTC::StorageGroupDirList();
273 
274  while (query.next())
275  {
276  DTC::StorageGroupDir *pStorageGroupDir = pList->AddNewStorageGroupDir();
277  QFileInfo fi(query.value(3).toString());
278  int64_t free = 0;
279  int64_t total = 0;
280  int64_t used = 0;
281 
282  free = getDiskSpace(query.value(3).toString(), total, used);
283 
284  pStorageGroupDir->setId ( query.value(0).toInt() );
285  pStorageGroupDir->setGroupName ( query.value(1).toString() );
286  pStorageGroupDir->setHostName ( query.value(2).toString() );
287  pStorageGroupDir->setDirName ( query.value(3).toString() );
288  pStorageGroupDir->setDirRead ( fi.isReadable() );
289  pStorageGroupDir->setDirWrite ( fi.isWritable() );
290  pStorageGroupDir->setKiBFree ( free );
291  }
292 
293  return pList;
294 }
295 
297 //
299 
300 bool Myth::AddStorageGroupDir( const QString &sGroupName,
301  const QString &sDirName,
302  const QString &sHostName )
303 {
304  MSqlQuery query(MSqlQuery::InitCon());
305 
306  if (!query.isConnected())
307  throw( QString("Database not open while trying to add Storage Group "
308  "dir"));
309 
310  if (sGroupName.isEmpty())
311  throw ( QString( "Storage Group Required" ));
312 
313  if (sDirName.isEmpty())
314  throw ( QString( "Directory Name Required" ));
315 
316  if (sHostName.isEmpty())
317  throw ( QString( "HostName Required" ));
318 
319  query.prepare("SELECT COUNT(*) "
320  "FROM storagegroup "
321  "WHERE groupname = :GROUPNAME "
322  "AND dirname = :DIRNAME "
323  "AND hostname = :HOSTNAME;");
324  query.bindValue(":GROUPNAME", sGroupName );
325  query.bindValue(":DIRNAME" , sDirName );
326  query.bindValue(":HOSTNAME" , sHostName );
327  if (!query.exec())
328  {
329  MythDB::DBError("MythAPI::AddStorageGroupDir()", query);
330 
331  throw( QString( "Database Error executing query." ));
332  }
333 
334  if (query.next())
335  {
336  if (query.value(0).toInt() > 0)
337  return false;
338  }
339 
340  query.prepare("INSERT storagegroup "
341  "( groupname, dirname, hostname ) "
342  "VALUES "
343  "( :GROUPNAME, :DIRNAME, :HOSTNAME );");
344  query.bindValue(":GROUPNAME", sGroupName );
345  query.bindValue(":DIRNAME" , sDirName );
346  query.bindValue(":HOSTNAME" , sHostName );
347 
348  if (!query.exec())
349  {
350  MythDB::DBError("MythAPI::AddStorageGroupDir()", query);
351 
352  throw( QString( "Database Error executing query." ));
353  }
354 
355  return true;
356 }
357 
359 //
361 
362 bool Myth::RemoveStorageGroupDir( const QString &sGroupName,
363  const QString &sDirName,
364  const QString &sHostName )
365 {
366  MSqlQuery query(MSqlQuery::InitCon());
367 
368  if (!query.isConnected())
369  throw( QString("Database not open while trying to remove Storage "
370  "Group dir"));
371 
372  if (sGroupName.isEmpty())
373  throw ( QString( "Storage Group Required" ));
374 
375  if (sDirName.isEmpty())
376  throw ( QString( "Directory Name Required" ));
377 
378  if (sHostName.isEmpty())
379  throw ( QString( "HostName Required" ));
380 
381  query.prepare("DELETE "
382  "FROM storagegroup "
383  "WHERE groupname = :GROUPNAME "
384  "AND dirname = :DIRNAME "
385  "AND hostname = :HOSTNAME;");
386  query.bindValue(":GROUPNAME", sGroupName );
387  query.bindValue(":DIRNAME" , sDirName );
388  query.bindValue(":HOSTNAME" , sHostName );
389  if (!query.exec())
390  {
391  MythDB::DBError("MythAPI::AddStorageGroupDir()", query);
392 
393  throw( QString( "Database Error executing query." ));
394  }
395 
396  return true;
397 }
398 
400 //
402 
404 {
405  auto *pResults = new DTC::TimeZoneInfo();
406 
407  pResults->setTimeZoneID( MythTZ::getTimeZoneID() );
408  pResults->setUTCOffset( MythTZ::calc_utc_offset() );
409  pResults->setCurrentDateTime( MythDate::current(true) );
410 
411  return pResults;
412 }
413 
415 //
417 
418 QString Myth::GetFormatDate(const QDateTime &Date, bool ShortDate)
419 {
421  if (ShortDate)
423 
424  return MythDate::toString(Date, dateFormat);
425 }
426 
428 //
430 
431 QString Myth::GetFormatDateTime(const QDateTime &DateTime, bool ShortDate)
432 {
434  if (ShortDate)
436 
437  return MythDate::toString(DateTime, dateFormat);
438 }
439 
441 //
443 
444 QString Myth::GetFormatTime(const QDateTime &Time)
445 {
446  return MythDate::toString(Time, MythDate::kTime);
447 }
448 
450 //
452 
453 QDateTime Myth::ParseISODateString(const QString& DateTimeString)
454 {
455  QDateTime dateTime = QDateTime::fromString(DateTimeString, Qt::ISODate);
456 
457  if (!dateTime.isValid())
458  throw QString( "Unable to parse DateTimeString" );
459 
460  return dateTime;
461 }
462 
464 //
466 
467 DTC::LogMessageList *Myth::GetLogs( const QString &HostName,
468  const QString &Application,
469  int PID,
470  int TID,
471  const QString &Thread,
472  const QString &Filename,
473  int Line,
474  const QString &Function,
475  const QDateTime &FromTime,
476  const QDateTime &ToTime,
477  const QString &Level,
478  const QString &MsgContains )
479 {
480  auto *pList = new DTC::LogMessageList();
481 
482  MSqlQuery query(MSqlQuery::InitCon());
483 
484  // Get host name list
485  QString sql = "SELECT DISTINCT host FROM logging ORDER BY host ASC";
486  if (!query.exec(sql))
487  {
488  MythDB::DBError("Retrieving log host names", query);
489  delete pList;
490  throw( QString( "Database Error executing query." ));
491  }
492  while (query.next())
493  {
494  DTC::LabelValue *pLabelValue = pList->AddNewHostName();
495  QString availableHostName = query.value(0).toString();
496  pLabelValue->setValue ( availableHostName );
497  pLabelValue->setActive ( availableHostName == HostName );
498  pLabelValue->setSelected( availableHostName == HostName );
499  }
500  // Get application list
501  sql = "SELECT DISTINCT application FROM logging ORDER BY application ASC";
502  if (!query.exec(sql))
503  {
504  MythDB::DBError("Retrieving log applications", query);
505  delete pList;
506  throw( QString( "Database Error executing query." ));
507  }
508  while (query.next())
509  {
510  DTC::LabelValue *pLabelValue = pList->AddNewApplication();
511  QString availableApplication = query.value(0).toString();
512  pLabelValue->setValue ( availableApplication );
513  pLabelValue->setActive ( availableApplication == Application );
514  pLabelValue->setSelected( availableApplication == Application );
515  }
516 
517  if (!HostName.isEmpty() && !Application.isEmpty())
518  {
519  // Get log messages
520  sql = "SELECT host, application, pid, tid, thread, filename, "
521  " line, function, msgtime, level, message "
522  " FROM logging "
523  " WHERE host = COALESCE(:HOSTNAME, host) "
524  " AND application = COALESCE(:APPLICATION, application) "
525  " AND pid = COALESCE(:PID, pid) "
526  " AND tid = COALESCE(:TID, tid) "
527  " AND thread = COALESCE(:THREAD, thread) "
528  " AND filename = COALESCE(:FILENAME, filename) "
529  " AND line = COALESCE(:LINE, line) "
530  " AND function = COALESCE(:FUNCTION, function) "
531  " AND msgtime >= COALESCE(:FROMTIME, msgtime) "
532  " AND msgtime <= COALESCE(:TOTIME, msgtime) "
533  " AND level <= COALESCE(:LEVEL, level) "
534  ;
535  if (!MsgContains.isEmpty())
536  {
537  sql.append(" AND message LIKE :MSGCONTAINS ");
538  }
539  sql.append(" ORDER BY msgtime ASC;");
540 
541 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
542  QVariant ullNull = QVariant(QVariant::ULongLong);
543 #else
544  QVariant ullNull = QVariant(QMetaType(QMetaType::ULongLong));
545 #endif
546  query.prepare(sql);
547 
548  query.bindValue(":HOSTNAME", (HostName.isEmpty()) ? QString() : HostName);
549  query.bindValue(":APPLICATION", (Application.isEmpty()) ? QString() :
550  Application);
551  query.bindValue(":PID", ( PID == 0 ) ? ullNull : (qint64)PID);
552  query.bindValue(":TID", ( TID == 0 ) ? ullNull : (qint64)TID);
553  query.bindValue(":THREAD", (Thread.isEmpty()) ? QString() : Thread);
554  query.bindValue(":FILENAME", (Filename.isEmpty()) ? QString() : Filename);
555  query.bindValue(":LINE", ( Line == 0 ) ? ullNull : (qint64)Line);
556  query.bindValue(":FUNCTION", (Function.isEmpty()) ? QString() : Function);
557  query.bindValue(":FROMTIME", (FromTime.isValid()) ? FromTime : QDateTime());
558  query.bindValue(":TOTIME", (ToTime.isValid()) ? ToTime : QDateTime());
559  query.bindValue(":LEVEL", (Level.isEmpty()) ? ullNull :
560  (qint64)logLevelGet(Level));
561 
562  if (!MsgContains.isEmpty())
563  {
564  query.bindValue(":MSGCONTAINS", "%" + MsgContains + "%" );
565  }
566 
567  if (!query.exec())
568  {
569  MythDB::DBError("Retrieving log messages", query);
570  delete pList;
571  throw( QString( "Database Error executing query." ));
572  }
573 
574  while (query.next())
575  {
576  DTC::LogMessage *pLogMessage = pList->AddNewLogMessage();
577 
578  pLogMessage->setHostName( query.value(0).toString() );
579  pLogMessage->setApplication( query.value(1).toString() );
580  pLogMessage->setPID( query.value(2).toInt() );
581  pLogMessage->setTID( query.value(3).toInt() );
582  pLogMessage->setThread( query.value(4).toString() );
583  pLogMessage->setFilename( query.value(5).toString() );
584  pLogMessage->setLine( query.value(6).toInt() );
585  pLogMessage->setFunction( query.value(7).toString() );
586  pLogMessage->setTime(MythDate::as_utc(query.value(8).toDateTime()));
587  pLogMessage->setLevel( logLevelGetName(
588  (LogLevel_t)query.value(9).toInt()) );
589  pLogMessage->setMessage( query.value(10).toString() );
590  }
591  }
592 
593  return pList;
594 }
595 
597 //
599 
601 {
602  auto *pList = new DTC::FrontendList();
603  QMap<QString, Frontend*> frontends;
604  if (OnLine)
605  frontends = gBackendContext->GetConnectedFrontends();
606  else
607  frontends = gBackendContext->GetFrontends();
608 
609  for (auto * fe : qAsConst(frontends))
610  {
611  DTC::Frontend *pFrontend = pList->AddNewFrontend();
612  pFrontend->setName(fe->m_name);
613  pFrontend->setIP(fe->m_ip.toString());
614  int port = gCoreContext->GetNumSettingOnHost("FrontendStatusPort",
615  fe->m_name, 6547);
616  pFrontend->setPort(port);
617  pFrontend->setOnLine(fe->m_connectionCount > 0);
618  }
619 
620  return pList;
621 }
622 
624 //
626 
627 QString Myth::GetSetting( const QString &sHostName,
628  const QString &sKey,
629  const QString &sDefault )
630 {
631  if (sKey.isEmpty())
632  throw( QString("Missing or empty Key (settings.value)") );
633 
634  if (sHostName == "_GLOBAL_")
635  {
636  MSqlQuery query(MSqlQuery::InitCon());
637 
638  query.prepare("SELECT data FROM settings "
639  "WHERE value = :VALUE "
640  "AND (hostname IS NULL)" );
641 
642  query.bindValue(":VALUE", sKey );
643 
644  if (!query.exec())
645  {
646  MythDB::DBError("API Myth/GetSetting ", query);
647  throw( QString( "Database Error executing query." ));
648  }
649 
650  return query.next() ? query.value(0).toString() : sDefault;
651  }
652 
653  QString hostname = sHostName;
654 
655  if (sHostName.isEmpty())
657 
658  return gCoreContext->GetSettingOnHost(sKey, hostname, sDefault);
659 }
660 
662 //
664 
665 DTC::SettingList *Myth::GetSettingList(const QString &sHostName)
666 {
667 
668  MSqlQuery query(MSqlQuery::InitCon());
669 
670  if (!query.isConnected())
671  {
672  throw( QString("Database not open while trying to load settings for host: %1")
673  .arg( sHostName ));
674  }
675 
676  auto *pList = new DTC::SettingList();
677 
678  //pList->setObjectName( "Settings" );
679  pList->setHostName ( sHostName );
680 
681  // ------------------------------------------------------------------
682  // Looking to return all Setting for supplied hostname
683  // ------------------------------------------------------------------
684 
685  if (sHostName.isEmpty())
686  {
687  query.prepare("SELECT value, data FROM settings "
688  "WHERE (hostname IS NULL)" );
689  }
690  else
691  {
692  query.prepare("SELECT value, data FROM settings "
693  "WHERE (hostname = :HOSTNAME)" );
694 
695  query.bindValue(":HOSTNAME", sHostName );
696  }
697 
698  if (!query.exec())
699  {
700  // clean up unused object we created.
701 
702  delete pList;
703 
704  MythDB::DBError("MythAPI::GetSetting() w/o key ", query);
705  throw( QString( "Database Error executing query." ));
706  }
707 
708  while (query.next())
709  pList->Settings().insert( query.value(0).toString(), query.value(1) );
710 
711  return pList;
712 }
713 
715 //
717 
718 bool Myth::PutSetting( const QString &sHostName,
719  const QString &sKey,
720  const QString &sValue )
721 {
722  if (!sKey.isEmpty())
723  {
724  return gCoreContext->SaveSettingOnHost( sKey, sValue, sHostName );
725  }
726 
727  throw ( QString( "Key Required" ));
728 }
729 
731 //
733 
734 bool Myth::ChangePassword( const QString &sUserName,
735  const QString &sOldPassword,
736  const QString &sNewPassword )
737 {
738  LOG(VB_GENERAL, LOG_NOTICE, "ChangePassword is deprecated, use "
739  "ManageDigestUser.");
740 
741  return ( ManageDigestUser("ChangePassword", sUserName, sOldPassword,
742  sNewPassword, "") );
743 }
744 
746 //
748 
749 bool Myth::TestDBSettings( const QString &sHostName,
750  const QString &sUserName,
751  const QString &sPassword,
752  const QString &sDBName,
753  int dbPort)
754 {
755  bool bResult = false;
756 
757  QString db("mythconverg");
758  int port = 3306;
759 
760  if (!sDBName.isEmpty())
761  db = sDBName;
762 
763  if (dbPort != 0)
764  port = dbPort;
765 
766  bResult = TestDatabase(sHostName, sUserName, sPassword, db, port);
767 
768  return bResult;
769 }
770 
772 //
774 
775 bool Myth::SendMessage( const QString &sMessage,
776  const QString &sAddress,
777  int udpPort,
778  int Timeout)
779 {
780  bool bResult = false;
781 
782  if (sMessage.isEmpty())
783  return bResult;
784 
785  if (Timeout < 0 || Timeout > 999)
786  Timeout = 0;
787 
788  QString xmlMessage =
789  "<mythmessage version=\"1\">\n"
790  " <text>" + sMessage + "</text>\n"
791  " <timeout>" + QString::number(Timeout) + "</timeout>\n"
792  "</mythmessage>";
793 
794  QHostAddress address = QHostAddress::Broadcast;
795  unsigned short port = 6948;
796 
797  if (!sAddress.isEmpty())
798  address.setAddress(sAddress);
799 
800  if (udpPort != 0)
801  port = udpPort;
802 
803  auto *sock = new QUdpSocket();
804  QByteArray utf8 = xmlMessage.toUtf8();
805  int size = utf8.length();
806 
807  if (sock->writeDatagram(utf8.constData(), size, address, port) < 0)
808  {
809  LOG(VB_GENERAL, LOG_ERR,
810  QString("Failed to send UDP/XML packet (Message: %1 "
811  "Address: %2 Port: %3")
812  .arg(sMessage, sAddress, QString::number(port)));
813  }
814  else
815  {
816  LOG(VB_GENERAL, LOG_DEBUG,
817  QString("UDP/XML packet sent! (Message: %1 Address: %2 Port: %3")
818  .arg(sMessage,
819  address.toString().toLocal8Bit(),
820  QString::number(port)));
821  bResult = true;
822  }
823 
824  sock->deleteLater();
825 
826  return bResult;
827 }
828 
829 bool Myth::SendNotification( bool bError,
830  const QString &Type,
831  const QString &sMessage,
832  const QString &sOrigin,
833  const QString &sDescription,
834  const QString &sImage,
835  const QString &sExtra,
836  const QString &sProgressText,
837  float fProgress,
838  int Duration,
839  bool bFullscreen,
840  uint Visibility,
841  uint Priority,
842  const QString &sAddress,
843  int udpPort )
844 {
845  bool bResult = false;
846 
847  if (sMessage.isEmpty())
848  return bResult;
849 
850  if (Duration < 0 || Duration > 999)
851  Duration = -1;
852 
853  QString xmlMessage =
854  "<mythnotification version=\"1\">\n"
855  " <text>" + sMessage + "</text>\n"
856  " <origin>" + (sOrigin.isNull() ? tr("MythServices") : sOrigin) + "</origin>\n"
857  " <description>" + sDescription + "</description>\n"
858  " <timeout>" + QString::number(Duration) + "</timeout>\n"
859  " <image>" + sImage + "</image>\n"
860  " <extra>" + sExtra + "</extra>\n"
861  " <progress_text>" + sProgressText + "</progress_text>\n"
862  " <progress>" + QString::number(fProgress) + "</progress>\n"
863  " <fullscreen>" + (bFullscreen ? "true" : "false") + "</fullscreen>\n"
864  " <visibility>" + QString::number(Visibility) + "</visibility>\n"
865  " <priority>" + QString::number(Priority) + "</priority>\n"
866  " <type>" + (bError ? "error" : Type) + "</type>\n"
867  "</mythnotification>";
868 
869  QHostAddress address = QHostAddress::Broadcast;
870  unsigned short port = 6948;
871 
872  if (!sAddress.isEmpty())
873  address.setAddress(sAddress);
874 
875  if (udpPort != 0)
876  port = udpPort;
877 
878  auto *sock = new QUdpSocket();
879  QByteArray utf8 = xmlMessage.toUtf8();
880  int size = utf8.length();
881 
882  if (sock->writeDatagram(utf8.constData(), size, address, port) < 0)
883  {
884  LOG(VB_GENERAL, LOG_ERR,
885  QString("Failed to send UDP/XML packet (Notification: %1 "
886  "Address: %2 Port: %3")
887  .arg(sMessage, sAddress, QString::number(port)));
888  }
889  else
890  {
891  LOG(VB_GENERAL, LOG_DEBUG,
892  QString("UDP/XML packet sent! (Notification: %1 Address: %2 Port: %3")
893  .arg(sMessage,
894  address.toString().toLocal8Bit(), QString::number(port)));
895  bResult = true;
896  }
897 
898  sock->deleteLater();
899 
900  return bResult;
901 }
902 
904 //
906 
908 {
909  bool bResult = false;
910 
911  DBUtil dbutil;
913  QString filename;
914 
915  LOG(VB_GENERAL, LOG_NOTICE, "Performing API invoked DB Backup.");
916 
917  status = DBUtil::BackupDB(filename);
918 
919  if (status == kDB_Backup_Completed)
920  {
921  LOG(VB_GENERAL, LOG_NOTICE, "Database backup succeeded.");
922  bResult = true;
923  }
924  else
925  LOG(VB_GENERAL, LOG_ERR, "Database backup failed.");
926 
927  return bResult;
928 }
929 
931 //
933 
934 bool Myth::CheckDatabase( bool repair )
935 {
936  LOG(VB_GENERAL, LOG_NOTICE, "Performing API invoked DB Check.");
937 
938  bool bResult = DBUtil::CheckTables(repair);
939 
940  if (bResult)
941  LOG(VB_GENERAL, LOG_NOTICE, "Database check complete.");
942  else
943  LOG(VB_GENERAL, LOG_ERR, "Database check failed.");
944 
945  return bResult;
946 }
947 
949 {
950  auto *scheduler = dynamic_cast<Scheduler*>(gCoreContext->GetScheduler());
951  scheduler->DelayShutdown();
952  LOG(VB_GENERAL, LOG_NOTICE, "Shutdown delayed 5 minutes for external application.");
953  return true;
954 }
955 
957 //
959 
961 {
963  LOG(VB_GENERAL, LOG_NOTICE, "Profile Submission...");
964  profile.GenerateUUIDs();
965  bool bResult = profile.SubmitProfile();
966  if (bResult)
967  LOG(VB_GENERAL, LOG_NOTICE, "Profile Submitted.");
968 
969  return bResult;
970 }
971 
973 //
975 
977 {
979  LOG(VB_GENERAL, LOG_NOTICE, "Profile Deletion...");
980  profile.GenerateUUIDs();
981  bool bResult = profile.DeleteProfile();
982  if (bResult)
983  LOG(VB_GENERAL, LOG_NOTICE, "Profile Deleted.");
984 
985  return bResult;
986 }
987 
989 //
991 
993 {
994  QString sProfileURL;
995 
997  profile.GenerateUUIDs();
998  sProfileURL = profile.GetProfileURL();
999  LOG(VB_GENERAL, LOG_NOTICE, QString("ProfileURL: %1").arg(sProfileURL));
1000 
1001  return sProfileURL;
1002 }
1003 
1005 //
1007 
1009 {
1010  QString sProfileUpdate;
1011 
1013  profile.GenerateUUIDs();
1014  QDateTime tUpdated;
1015  tUpdated = profile.GetLastUpdate();
1016  sProfileUpdate = tUpdated.toString(
1017  gCoreContext->GetSetting( "DateFormat", "MM.dd.yyyy"));
1018 
1019  return sProfileUpdate;
1020 }
1021 
1023 //
1025 
1027 {
1028  QString sProfileText;
1029 
1031  sProfileText = HardwareProfile::GetHardwareProfile();
1032 
1033  return sProfileText;
1034 }
1035 
1037 //
1039 
1041 {
1042 
1043  // ----------------------------------------------------------------------
1044  // Create and populate a Configuration object
1045  // ----------------------------------------------------------------------
1046 
1047  auto *pInfo = new DTC::BackendInfo();
1048  DTC::BuildInfo *pBuild = pInfo->Build();
1049  DTC::EnvInfo *pEnv = pInfo->Env();
1050  DTC::LogInfo *pLog = pInfo->Log();
1051 
1052  pBuild->setVersion ( MYTH_SOURCE_VERSION );
1053  pBuild->setLibX264 ( CONFIG_LIBX264 );
1054  pBuild->setLibDNS_SD ( CONFIG_LIBDNS_SD );
1055  pEnv->setLANG ( qEnvironmentVariable("LANG") );
1056  pEnv->setLCALL ( qEnvironmentVariable("LC_ALL") );
1057  pEnv->setLCCTYPE ( qEnvironmentVariable("LC_CTYPE") );
1058  pEnv->setHOME ( qEnvironmentVariable("HOME") );
1059  pEnv->setMYTHCONFDIR ( qEnvironmentVariable("MYTHCONFDIR") );
1060  pLog->setLogArgs ( logPropagateArgs );
1061 
1062  // ----------------------------------------------------------------------
1063  // Return the pointer... caller is responsible to delete it!!!
1064  // ----------------------------------------------------------------------
1065 
1066  return pInfo;
1067 
1068 }
1069 
1071 //
1073 
1074 bool Myth::ManageDigestUser( const QString &sAction,
1075  const QString &sUserName,
1076  const QString &sPassword,
1077  const QString &sNewPassword,
1078  const QString &sAdminPassword )
1079 {
1080 
1081  DigestUserActions sessionAction = DIGEST_USER_ADD;
1082 
1083  if (sAction == "Add")
1084  sessionAction = DIGEST_USER_ADD;
1085  else if (sAction == "Remove")
1086  sessionAction = DIGEST_USER_REMOVE;
1087  else if (sAction == "ChangePassword")
1088  sessionAction = DIGEST_USER_CHANGE_PW;
1089  else
1090  {
1091  LOG(VB_GENERAL, LOG_ERR, QString("Action must be Add, Remove or "
1092  "ChangePassword, not '%1'")
1093  .arg(sAction));
1094  return false;
1095  }
1096 
1097  return MythSessionManager::ManageDigestUser(sessionAction, sUserName,
1098  sPassword, sNewPassword,
1099  sAdminPassword);
1100 }
1101 
1103 //
1105 
1106 bool Myth::ManageUrlProtection( const QString &sServices,
1107  const QString &sAdminPassword )
1108 {
1109  if (!MythSessionManager::IsValidUser("admin"))
1110  {
1111  LOG(VB_GENERAL, LOG_ERR, QString("Backend has no '%1' user!")
1112  .arg("admin"));
1113  return false;
1114  }
1115 
1116  if (MythSessionManager::CreateDigest("admin", sAdminPassword) !=
1118  {
1119  LOG(VB_GENERAL, LOG_ERR, QString("Incorrect password for user: %1")
1120  .arg("admin"));
1121  return false;
1122  }
1123 
1124  QStringList serviceList = sServices.split(",");
1125 
1126  serviceList.removeDuplicates();
1127 
1128  QStringList protectedURLs;
1129 
1130  if (serviceList.size() == 1 && serviceList.first() == "All")
1131  {
1132  for (const QString& service : KnownServices)
1133  protectedURLs << '/' + service;
1134  }
1135  else if (serviceList.size() == 1 && serviceList.first() == "None")
1136  {
1137  protectedURLs << "Unprotected";
1138  }
1139  else
1140  {
1141  for (const QString& service : serviceList)
1142  {
1143  if (KnownServices.contains(service))
1144  protectedURLs << '/' + service;
1145  else
1146  LOG(VB_GENERAL, LOG_ERR, QString("Invalid service name: '%1'")
1147  .arg(service));
1148  }
1149  }
1150 
1151  if (protectedURLs.isEmpty())
1152  {
1153  LOG(VB_GENERAL, LOG_ERR, "No valid Services were found");
1154  return false;
1155  }
1156 
1157  return gCoreContext->SaveSettingOnHost("HTTP/Protected/Urls",
1158  protectedURLs.join(';'), "");
1159 }
serviceUtil.h
Myth::GetBackendInfo
DTC::BackendInfo * GetBackendInfo(void) override
Definition: myth.cpp:1040
Scheduler
Definition: scheduler.h:45
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:812
MythSessionManager::IsValidUser
static bool IsValidUser(const QString &username)
Check if the given user exists but not whether there is a valid session open for them!
Definition: mythsession.cpp:151
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:124
hardwareprofile.h
MythSessionManager::GetPasswordDigest
static QString GetPasswordDigest(const QString &username)
Load the password digest for comparison in the HTTP Auth code.
Definition: mythsession.cpp:224
KnownServices
const QStringList KnownServices
Definition: serviceUtil.h:57
Myth::BackupDatabase
bool BackupDatabase(void) override
Definition: myth.cpp:907
DTC::BuildInfo
Definition: buildInfo.h:22
Myth::DelayShutdown
bool DelayShutdown(void) override
Definition: myth.cpp:948
MythDate::toString
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
Definition: mythdate.cpp:80
MusicMetadata::Filename
QString Filename(bool find=true)
Definition: musicmetadata.cpp:965
DatabaseParams::m_dbHostName
QString m_dbHostName
database server
Definition: mythdbparams.h:22
DTC::SettingList
Definition: settingList.h:23
Myth::GetStorageGroupDirs
DTC::StorageGroupDirList * GetStorageGroupDirs(const QString &GroupName, const QString &HostName) override
Definition: myth.cpp:220
dbutil.h
backendcontext.h
DTC::FrontendList
Definition: frontendList.h:24
Myth::RemoveStorageGroupDir
bool RemoveStorageGroupDir(const QString &GroupName, const QString &DirName, const QString &HostName) override
Definition: myth.cpp:362
DIGEST_USER_CHANGE_PW
@ DIGEST_USER_CHANGE_PW
Definition: mythsession.h:13
Myth::GetSetting
QString GetSetting(const QString &HostName, const QString &Key, const QString &Default) override
Definition: myth.cpp:627
Myth::ProfileSubmit
bool ProfileSubmit(void) override
Definition: myth.cpp:960
MythCoreContext::GetScheduler
MythScheduler * GetScheduler(void)
Definition: mythcorecontext.cpp:1889
Myth::AddStorageGroupDir
bool AddStorageGroupDir(const QString &GroupName, const QString &DirName, const QString &HostName) override
Definition: myth.cpp:300
LogMessageList
QList< LogMessage * > LogMessageList
Definition: loggingserver.h:128
getDiskSpace
int64_t getDiskSpace(const QString &file_on_disk, int64_t &total, int64_t &used)
Definition: mythcoreutil.cpp:43
MythDate::as_utc
QDateTime as_utc(const QDateTime &old_dt)
Returns copy of QDateTime with TimeSpec set to UTC.
Definition: mythdate.cpp:23
DTC::TimeZoneInfo
Definition: timeZoneInfo.h:20
MythTZ::getTimeZoneID
QString getTimeZoneID(void)
Returns the zoneinfo time zone ID or as much time zone information as possible.
Definition: mythtimezone.cpp:56
DatabaseParams
Structure containing the basic Database parameters.
Definition: mythdbparams.h:10
DTC::ConnectionInfo
Definition: connectionInfo.h:24
Myth::GetHostName
QString GetHostName() override
Definition: myth.cpp:140
DTC::VersionInfo
Definition: versionInfo.h:22
Scheduler::DelayShutdown
void DelayShutdown()
Definition: scheduler.cpp:3030
mythcoreutil.h
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:197
mythdbcon.h
TestDatabase
bool TestDatabase(const QString &dbHostName, const QString &dbUserName, QString dbPassword, QString dbName, int dbPort)
Definition: mythdbcon.cpp:38
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythSessionManager::CreateDigest
static QByteArray CreateDigest(const QString &username, const QString &password)
Generate a digest string.
Definition: mythsession.cpp:536
Myth::SendMessage
bool SendMessage(const QString &Message, const QString &Address, int udpPort, int Timeout) override
Definition: myth.cpp:775
DBUtil::CheckTables
static bool CheckTables(bool repair=false, const QString &options="QUICK")
Checks database tables.
Definition: dbutil.cpp:278
DatabaseParams::m_dbType
QString m_dbType
database type (MySQL, Postgres, etc.)
Definition: mythdbparams.h:28
MythCoreContext::GetDatabaseParams
DatabaseParams GetDatabaseParams(void)
Definition: mythcorecontext.h:148
Myth::GetFormatDate
QString GetFormatDate(const QDateTime &Date, bool ShortDate) override
Definition: myth.cpp:418
gBackendContext
BackendContext * gBackendContext
Definition: backendcontext.cpp:12
myth.h
DTC::LogInfo
Definition: logInfo.h:22
MythDate::kDateTimeShort
@ kDateTimeShort
Default local time.
Definition: mythdate.h:24
scheduler.h
MythDate::current
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
DatabaseParams::m_wolReconnect
std::chrono::seconds m_wolReconnect
seconds to wait for reconnect
Definition: mythdbparams.h:35
mythversion.h
Myth::TestDBSettings
bool TestDBSettings(const QString &HostName, const QString &UserName, const QString &Password, const QString &DBName, int dbPort) override
Definition: myth.cpp:749
Myth::GetConnectionInfo
DTC::ConnectionInfo * GetConnectionInfo(const QString &Pin) override
Definition: myth.cpp:59
Myth::GetTimeZone
DTC::TimeZoneInfo * GetTimeZone() override
Definition: myth.cpp:403
DTC::LogMessageList
Definition: logMessageList.h:15
DatabaseParams::m_dbPort
int m_dbPort
database port
Definition: mythdbparams.h:24
mythdate.h
DTC::WOLInfo
Definition: wolInfo.h:22
mythlogging.h
logLevelGetName
QString logLevelGetName(LogLevel_t level)
Map a log level enumerated value back to the name.
Definition: logging.cpp:816
DTC::LogMessage
Definition: logMessage.h:20
MythSessionManager::ManageDigestUser
static bool ManageDigestUser(DigestUserActions action, const QString &username, const QString &password, const QString &newPassword, const QString &adminPassword)
Manage digest user entries.
Definition: mythsession.cpp:550
hardwareprofile.scan.profile
profile
Definition: scan.py:99
DTC::VersionInfo::Version
QString Version
Definition: versionInfo.h:29
DatabaseParams::m_dbHostPing
bool m_dbHostPing
Can we test connectivity using ping?
Definition: mythdbparams.h:23
DTC::StorageGroupDir
Definition: storageGroupDir.h:14
DTC::StorageGroupDirList
Definition: storageGroupDirList.h:14
HardwareProfile
Definition: hardwareprofile.h:16
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
MythCoreContext::GetBackendServerIP
QString GetBackendServerIP(void)
Returns the IP address of the locally defined backend IP.
Definition: mythcorecontext.cpp:1028
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:200
BackendContext::GetFrontends
QMap< QString, Frontend * > GetFrontends() const
Definition: backendcontext.h:52
Myth::GetFormatDateTime
QString GetFormatDateTime(const QDateTime &DateTime, bool ShortDate) override
Definition: myth.cpp:431
logLevelGet
LogLevel_t logLevelGet(const QString &level)
Map a log level name back to the enumerated value.
Definition: logging.cpp:794
Myth::ProfileUpdated
QString ProfileUpdated(void) override
Definition: myth.cpp:1008
kDB_Backup_Completed
@ kDB_Backup_Completed
Definition: dbutil.h:13
HardwareProfile::GetHardwareProfile
static QString GetHardwareProfile(void)
Definition: hardwareprofile.cpp:263
Myth::ProfileDelete
bool ProfileDelete(void) override
Definition: myth.cpp:976
MythDate::kAutoYear
@ kAutoYear
Add year only if different from current year.
Definition: mythdate.h:28
DigestUserActions
DigestUserActions
Definition: mythsession.h:10
MythDate::kDateShort
@ kDateShort
Default local time.
Definition: mythdate.h:20
DBUtil
Aggregates database and DBMS utility functions.
Definition: dbutil.h:30
MythCoreContext::GetNumSettingOnHost
int GetNumSettingOnHost(const QString &key, const QString &host, int defaultval=0)
Definition: mythcorecontext.cpp:967
DBUtil::BackupDB
static MythDBBackupStatus BackupDB(QString &filename, bool disableRotation=false)
Requests a backup of the database.
Definition: dbutil.cpp:190
Myth::PutSetting
bool PutSetting(const QString &HostName, const QString &Key, const QString &Value) override
Definition: myth.cpp:718
storagegroup.h
DatabaseParams::m_dbPassword
QString m_dbPassword
DB password.
Definition: mythdbparams.h:26
PID
Contains Packet Identifier numeric values.
Definition: mpegtables.h:206
Myth::SendNotification
bool SendNotification(bool Error, const QString &Type, const QString &Message, const QString &Origin, const QString &Description, const QString &Image, const QString &Extra, const QString &ProgressText, float Progress, int Duration, bool Fullscreen, uint Visibility, uint Priority, const QString &Address, int udpPort) override
Definition: myth.cpp:829
DatabaseParams::m_wolRetry
int m_wolRetry
times to retry to reconnect
Definition: mythdbparams.h:36
DatabaseParams::m_dbName
QString m_dbName
database name
Definition: mythdbparams.h:27
MSqlQuery::isConnected
bool isConnected(void) const
Only updated once during object creation.
Definition: mythdbcon.h:134
uint
unsigned int uint
Definition: compat.h:140
MythDBBackupStatus
MythDBBackupStatus
Definition: dbutil.h:9
DIGEST_USER_REMOVE
@ DIGEST_USER_REMOVE
Definition: mythsession.h:12
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
DTC::EnvInfo
Definition: envInfo.h:22
Myth::GetKeys
QStringList GetKeys() override
Definition: myth.cpp:186
MythDate::fromString
QDateTime fromString(const QString &dtstr)
Converts kFilename && kISODate formats to QDateTime.
Definition: mythdate.cpp:30
MythDate::kSimplify
@ kSimplify
Do Today/Yesterday/Tomorrow transform.
Definition: mythdate.h:26
BackendContext::GetConnectedFrontends
QMap< QString, Frontend * > GetConnectedFrontends() const
Definition: backendcontext.h:51
MYTH_BINARY_VERSION
#define MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
Definition: mythversion.h:15
MYTH_PROTO_VERSION
#define MYTH_PROTO_VERSION
Increment this whenever the MythTV network protocol changes.
Definition: mythversion.h:47
MythTZ::calc_utc_offset
int calc_utc_offset(void)
Definition: mythtimezone.cpp:24
Myth::CheckDatabase
bool CheckDatabase(bool Repair) override
Definition: myth.cpp:934
Myth::ManageDigestUser
bool ManageDigestUser(const QString &Action, const QString &UserName, const QString &Password, const QString &NewPassword, const QString &AdminPassword) override
Definition: myth.cpp:1074
Myth::GetLogs
DTC::LogMessageList * GetLogs(const QString &HostName, const QString &Application, int PID, int TID, const QString &Thread, const QString &Filename, int Line, const QString &Function, const QDateTime &FromTime, const QDateTime &ToTime, const QString &Level, const QString &MsgContains) override
Definition: myth.cpp:467
mythcorecontext.h
DTC::BackendInfo
Definition: backendInfo.h:24
DatabaseParams::m_wolCommand
QString m_wolCommand
command to use for wake-on-lan
Definition: mythdbparams.h:37
MythCoreContext::GetSettingOnHost
QString GetSettingOnHost(const QString &key, const QString &host, const QString &defaultval="")
Definition: mythcorecontext.cpp:950
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:893
MythDate::ISODate
@ ISODate
Default UTC.
Definition: mythdate.h:17
DatabaseParams::m_dbUserName
QString m_dbUserName
DB user name.
Definition: mythdbparams.h:25
DTC::DatabaseInfo
Definition: databaseInfo.h:22
Myth::ParseISODateString
QDateTime ParseISODateString(const QString &DateTime) override
Definition: myth.cpp:453
MythDate::kDateFull
@ kDateFull
Default local time.
Definition: mythdate.h:19
MythCoreContext::GetHostName
QString GetHostName(void)
Definition: mythcorecontext.cpp:862
MYTH_DATABASE_VERSION
#define MYTH_DATABASE_VERSION
Increment this whenever the MythTV core database schema changes.
Definition: mythversion.h:77
DIGEST_USER_ADD
@ DIGEST_USER_ADD
Definition: mythsession.h:11
Myth::GetSettingList
DTC::SettingList * GetSettingList(const QString &HostName) override
Definition: myth.cpp:665
logPropagateArgs
QString logPropagateArgs
Definition: logging.cpp:85
Myth::ChangePassword
bool ChangePassword(const QString &UserName, const QString &OldPassword, const QString &NewPassword) override
Definition: myth.cpp:734
Myth::GetHosts
QStringList GetHosts() override
Definition: myth.cpp:151
kDB_Backup_Unknown
@ kDB_Backup_Unknown
Definition: dbutil.h:11
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
DatabaseParams::m_localEnabled
bool m_localEnabled
true if localHostName is not default
Definition: mythdbparams.h:30
MythDate::kDateTimeFull
@ kDateTimeFull
Default local time.
Definition: mythdate.h:23
Myth::ManageUrlProtection
bool ManageUrlProtection(const QString &Services, const QString &AdminPassword) override
Definition: myth.cpp:1106
MythDate::kTime
@ kTime
Default local time.
Definition: mythdate.h:22
Myth::ProfileText
QString ProfileText(void) override
Definition: myth.cpp:1026
DatabaseParams::m_wolEnabled
bool m_wolEnabled
true if wake-on-lan params are used
Definition: mythdbparams.h:34
build_compdb.filename
filename
Definition: build_compdb.py:21
DatabaseParams::m_localHostName
QString m_localHostName
name used for loading/saving settings
Definition: mythdbparams.h:31
MythCoreContext::SaveSettingOnHost
bool SaveSettingOnHost(const QString &key, const QString &newValue, const QString &host)
Definition: mythcorecontext.cpp:915
DTC::Frontend
Definition: libs/libmythservicecontracts/datacontracts/frontend.h:24
Priority
Definition: channelsettings.cpp:191
mythtimezone.h
Myth::ProfileURL
QString ProfileURL(void) override
Definition: myth.cpp:992
Myth::GetFormatTime
QString GetFormatTime(const QDateTime &Time) override
Definition: myth.cpp:444
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:922
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:837
DTC::LabelValue
Definition: labelValue.h:19
Myth::GetFrontends
DTC::FrontendList * GetFrontends(bool OnLine) override
Definition: myth.cpp:600