1 Commits

Author SHA1 Message Date
Mario Fetka
8b51dbf723 Imported Upstream version 3.3.0 2017-10-20 15:00:08 +02:00
174 changed files with 4395 additions and 6727 deletions

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin main site
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-14 13:43:23 +0100 (Wed, 14 Mar 2012) $
// Author : $LastChangedBy: rouven $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1296 $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Administration overview
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Alarming overview
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-08 15:13:31 +0100 (Wed, 08 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1189 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : File editor cgi.cfg
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-07 10:38:34 +0100 (Wed, 07 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1275 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@@ -38,7 +38,7 @@ $intConfigId = $arrConfigSet[0];
$myConfigClass->getConfigData($intConfigId,"method",$intMethod);
$myConfigClass->getConfigData($intConfigId,"nagiosbasedir",$strBaseDir);
$strConfigfile = str_replace("//","/",$strBaseDir."/cgi.cfg");
$strLocalBackup = str_replace("//","/",$strBaseDir."/cgi.cfg_old_").date("YmdHis",mktime());
$strLocalBackup = str_replace("//","/",$strBaseDir."/cgi.cfg_old_").date("YmdHis",time());
//
// Convert Windows to UNIX
// =======================

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Command definitions
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Command line visualization
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Commands overview
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-08 15:13:31 +0100 (Wed, 08 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1189 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

8
admin/configtargets.php Executable file → Normal file
View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin configuration target administration
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2011-12-01 15:20:17 +0100 (Do, 01. Dez 2011) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1137 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Contactgroup definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Contact definitions
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-04-20 12:39:53 +0200 (Fri, 20 Apr 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1323 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Contact template definitions
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

8
admin/datadomain.php Executable file → Normal file
View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin domain administration
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2011-12-01 15:20:17 +0100 (Do, 01. Dez 2011) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1137 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin file deletion
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin file deletion
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Download config file
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Group administration
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin time definition list
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Help text editor
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Host dependencies definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Host escalation definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Host extended information definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Hostgroup definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Host definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-04-17 12:09:50 +0200 (Tue, 17 Apr 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1321 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Hosttemplate definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin configuration verification
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-07 10:38:34 +0100 (Wed, 07 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1275 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin information dialog
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin logbook
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-01-13 07:40:23 +0100 (Fri, 13 Jan 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1158 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Menu access administration
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin specials overview
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-08 15:13:31 +0100 (Wed, 08 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1189 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin timeperiod definitions
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin timeperiod definitions
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-07 10:38:34 +0100 (Wed, 07 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1275 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@@ -38,7 +38,7 @@ $intConfigId = $arrConfigSet[0];
$myConfigClass->getConfigData($intConfigId,"method",$intMethod);
$myConfigClass->getConfigData($intConfigId,"nagiosbasedir",$strBaseDir);
$myConfigClass->getConfigData($intConfigId,"conffile",$strConfigfile);
$strLocalBackup = $strConfigfile."_old_".date("YmdHis",mktime());
$strLocalBackup = $strConfigfile."_old_".date("YmdHis",time());
//
// Convert Windows to UNIX
// =======================

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Password administration
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Service dependencies definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Service escalation definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Service extended information definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin servicegroup definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Service definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-04-17 12:09:50 +0200 (Tue, 17 Apr 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1321 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Service template definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Settings configuration
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Specials overview
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-08 15:13:31 +0100 (Wed, 08 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1189 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Support page
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-01-27 09:59:02 +0100 (Fre, 27. Jan 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1182 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Template definition list
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-04-05 08:11:59 +0200 (Thu, 05 Apr 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1315 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Admin time definition list
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Timeperiod definitions
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-09 07:43:00 +0100 (Fri, 09 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1282 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Tools overview
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : User administration
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Variable definition list
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-27 13:01:17 +0100 (Mon, 27 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1257 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Configuration verification
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-09-24 14:42:29 +0200 (Mon, 24 Sep 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1347 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@@ -342,7 +342,7 @@ if ($chkButValue4 != "") {
}
if (file_exists($strPidfile) && isset($arrExec[0])) {
if (file_exists($strCommandfile) && is_writable($strCommandfile)) {
$strCommandString = "[".mktime()."] RESTART_PROGRAM;".mktime();
$strCommandString = "[".time()."] RESTART_PROGRAM;".time()."\n";
$timeout = 3;
$old = ini_set('default_socket_timeout', $timeout);
$resCmdFile = fopen($strCommandfile,"w");
@@ -379,7 +379,7 @@ if ($chkButValue4 != "") {
$myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage);
} else {
if (is_array($myConfigClass->sendSSHCommand('ls '.$strCommandfile))) {
$strCommandString = "[".mktime()."] RESTART_PROGRAM;".mktime();
$strCommandString = "[".time()."] RESTART_PROGRAM;".time()."\n";
$arrInfo = ssh2_sftp_stat($myConfigClass->resSFTP, $strCommandfile);
$intFileStamp1 = $arrInfo['mtime'];
$arrResult = $myConfigClass->sendSSHCommand('echo "'.$strCommandString.'" >> '.$strCommandfile);

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Command line visualization
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2011-10-31 15:42:09 +0100 (Mo, 31. Okt 2011) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1118 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : CSS content definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2011-10-27 09:50:16 +0200 (Thu, 27 Oct 2011) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1111 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
/////////////////////////////////////////////////////////////////////////////*/
/* Content main div */

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : field language variables (for replace in templates)
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : CSS Main definition
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
/////////////////////////////////////////////////////////////////////////////*/
body {

49
debian/README.Debian vendored
View File

@@ -1,49 +0,0 @@
NagiosQL for Debian
-------------------
NagiosQL comes with a web based installer. For security reason you have to
enable it manually:
sudo touch /usr/share/nagiosql/htdocs/install/ENABLE_INSTALLER
Start your browser and enter http://<yourhost>/nagiosql.
After installation, you must remove the file ENABLE_INSTALLER, otherwise
you can' start using NagiosQL:
sudo rm /usr/share/nagiosql/htdocs/install/ENABLE_INSTALLER
In the Webfrontend of NagiosQL login in as user Admin and go to
Administration/Domains -> domain 'localhost'. Please check the settings and
change it to your needs.
For security reasons nagios.cfg and cgi.cfg are not writeable to www-data
as NagiosQL request it. You can read the config files through the web
frontend, but not edit. Unfortunately NagiosQL requests a writeable
nagios.cfg for adding domains or changing values of existing domains.
You can perform the following steps to change permissions of nagios.cfg and
cgi.cfg permanently:
dpkg-statoverride --update --add nagios www-data 0664 /etc/nagios4/nagios.cfg
dpkg-statoverride --update --add nagios www-data 0664 /etc/nagios4/cgi.cfg
Additional remarks:
- this package comes with a configured domain 'localhost' and uses the
following pathes:
/etc/nagiosql/domains/localhost = misc nagios objects
/etc/nagiosql/domains/localhost/hosts = host object
/etc/nagiosql/domains/localhost/services = service objects
/etc/nagiosql/domain-backups/localhost
/etc/nagiosql/domain-backups/localhost/hosts
/etc/nagiosql/domain-backups/localhost/services
- add the following line to nagios.cfg:
cfg_dir=/etc/nagiosql/domains/localhost
check the configs via the web interface and reload nagios4:
/etc/init.d/nagios4 reload
-- Wolfgang Barth <wob@swobspace.net> Sat, 13 Jun 2009 12:30:28 +0200

View File

@@ -1,4 +0,0 @@
This package uses quilt to manage all modifications to the upstream source.
See /usr/share/doc/quilt/README.source for instructions how to generate the
patched source, add a new modification, and remove an existing one.

17
debian/apache.conf vendored
View File

@@ -1,17 +0,0 @@
Alias /nagiosql "/usr/share/nagiosql/htdocs"
<Directory "/usr/share/nagiosql/htdocs">
Options FollowSymLinks
DirectoryIndex index.php
<IfVersion < 2.3>
Order Allow,Deny
Allow From All
</IfVersion>
<IfVersion >= 2.3>
Require all granted
</IfVersion>
</Directory>

26
debian/changelog vendored
View File

@@ -1,26 +0,0 @@
nagiosql (3.2.0-4) UNRELEASED; urgency=medium
* Bump to 3.2.0 branch with servicepack 3
* drop dpatch and switch to quilt
* switch to nagios4 for default nagios implementation
* many small bugfixes for mysqli
-- Mario Fetka <mario.fetka@gmail.com> Sun, 21 May 2017 19:21:36 +0200
nagiosql (3.0.3-1ubuntu2) lucid; urgency=low
* Add missing dependency - dpatch
-- fenris <fenris@ubuntu.com> Tue, 16 Mar 2010 16:41:12 +0800
nagiosql (3.0.3-1ubuntu1) karmic; urgency=low
* Initial release for Ubuntu
-- fenris <fenris@ubuntu.com> Thu, 04 Feb 2010 20:53:48 +0800
nagiosql (3.0.3-1) unstable; urgency=low
* Initial release (Closes: #0000)
-- Wolfgang Barth <wob@swobspace.net> Sat, 13 Jun 2009 12:30:28 +0200

1
debian/compat vendored
View File

@@ -1 +0,0 @@
8

32
debian/control vendored
View File

@@ -1,32 +0,0 @@
Source: nagiosql
Section: net
Priority: optional
Maintainer: fenris@ubuntu.com
XSBC-Original-Maintainer: Wolfgang Barth <wob@swobspace.net>
Build-Depends: debhelper (>= 7), default-mysql-server | mysql-server, php7.0-ldap | php5-ldap , php7.0-mysql | php5-mysql, rsync
Standards-Version: 3.8.0
Homepage: http://www.nagiosql.org
Package: nagiosql
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, php-ssh2
Recommends: nagios4
Description: Web based administration tool for Nagios 2 and above
It helps you to easily build a complex configuration with all options,
manage and use them. NagiosQL is based on a webserver with PHP, MySQL and
local file or remote access to the Nagios configuration files.
.
The main features are:
.
* create, delete, modify and copy settings
* create and export configuration files
* create and download configuration files
* easy configuration import
* auto backup configuration files
* consistency checks
* syntax verification
* user management
* instant activation of new configs
* many translations
* easy Installation Wizard
* MySQL database platform

43
debian/copyright vendored
View File

@@ -1,43 +0,0 @@
This package was debianized by Wolfgang Barth <wob@swobspace.net> on
Sat, 13 Jun 2009 11:16:45 +0200.
It was downloaded from http://www.nagiosql.org
Upstream Authors:
Martin Willisegger
Rouven Homann
Copyright:
Copyright (C) 2008, 2009 by Martin Willisegger
License:
Redistribution and use in source and binary forms, with or without
modification, are permitted under the terms of the BSD License.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
On Debian systems, the complete text of the BSD License can be
found in `/usr/share/common-licenses/BSD'.
NagiosQL comes with tinymce. The license can be found in
usr/share/nagiosql/htdocs/functions/tinyMCE/jscripts/tiny_mce/license.txt.
The Debian packaging is copyright 2009, Wolfgang Barth <wob@swobspace.net> and
is licensed under the GPL version 2, see `/usr/share/common-licenses/GPL-2'.
To build the package, the original tar file nagiosql3xy.tar.gz has to be
repacked. The content of the upstream source is now in the directory
nagiosql-<version>.orig/.

6
debian/dirs vendored
View File

@@ -1,6 +0,0 @@
usr/share/nagiosql/htdocs
etc/nagiosql
etc/nagiosql/hosts
etc/nagiosql/services
etc/nagiosql/backup/hosts
etc/nagiosql/backup/services

7
debian/docs vendored
View File

@@ -1,7 +0,0 @@
doc/INSTALLATION_deDE.txt
doc/INSTALLATION_enGB.txt
doc/CHANGELOG
doc/README_SSH_KEY
doc/LICENSE
doc/LIZENZ
README.md

1
debian/links vendored
View File

@@ -1 +0,0 @@
etc/nagiosql/apache.conf etc/apache2/conf-available/nagiosql.conf

33
debian/nagiosql.1 vendored
View File

@@ -1,33 +0,0 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH NAGIOSQL SECTION "June 13, 2009"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
nagiosql \- Web based administration tool for Nagios 2 and above
.SH SYNOPSIS
.B http://localhost/nagiosql
.SH DESCRIPTION
nagiosql is web based, so start your browser and enter
http://localhost/nagiosql.
.SH SEE ALSO
.BR /usr/share/doc/nagiosql/*
.br
.BR http://www.nagiosql.org
.SH AUTHOR
nagiosql was written by Martin Willsegger
.PP
This manual page was written by Wolfgang Barth <wob@swobspace.net>,
for the Debian project (and may be used by others).

View File

@@ -1,5 +0,0 @@
nagiosql: extra-license-file usr/share/nagiosql/htdocs/functions/tinyMCE/jscripts/tiny_mce/license.txt
nagiosql: embedded-javascript-library usr/share/nagiosql/htdocs/functions/tinyMCE/jscripts/tiny_mce/tiny_mce.js
nagiosql: embedded-javascript-library usr/share/nagiosql/htdocs/functions/tinyMCE/jscripts/tiny_mce/tiny_mce_popup.js
nagiosql: embedded-javascript-library usr/share/nagiosql/htdocs/functions/yui/build/yahoo-dom-event/yahoo-dom-event.js
nagiosql: embedded-javascript-library usr/share/nagiosql/htdocs/install/js/prototype.js

View File

@@ -1,280 +0,0 @@
diff -uNr nagiosql32.orig/admin/contacts.php nagiosql32/admin/contacts.php
--- nagiosql32.orig/admin/contacts.php 2012-04-20 12:39:53.983095000 +0200
+++ nagiosql32/admin/contacts.php 2012-04-20 12:39:56.000000000 +0200
@@ -10,7 +10,7 @@
// Project : NagiosQL
// Component : Contact definitions
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-04-20 12:39:53 +0200 (Fri, 20 Apr 2012) $
+// Date : $LastChangedDate: 2012-04-20 12:39:53 +0200 (Fr, 20. Apr 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1323 $
diff -uNr nagiosql32.orig/admin/hosts.php nagiosql32/admin/hosts.php
--- nagiosql32.orig/admin/hosts.php 2012-04-17 12:09:50.082574000 +0200
+++ nagiosql32/admin/hosts.php 2012-04-17 11:54:12.000000000 +0200
@@ -10,10 +10,10 @@
// Project : NagiosQL
// Component : Host definition
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-04-17 12:09:50 +0200 (Tue, 17 Apr 2012) $
+// Date : $LastChangedDate: 2012-04-05 08:11:59 +0200 (Do, 05. Apr 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1321 $
+// Revision : $LastChangedRevision: 1315 $
//
///////////////////////////////////////////////////////////////////////////////
//
diff -uNr nagiosql32.orig/admin/services.php nagiosql32/admin/services.php
--- nagiosql32.orig/admin/services.php 2012-04-17 12:09:50.082574000 +0200
+++ nagiosql32/admin/services.php 2012-04-17 11:53:36.000000000 +0200
@@ -10,10 +10,10 @@
// Project : NagiosQL
// Component : Service definition
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-04-17 12:09:50 +0200 (Tue, 17 Apr 2012) $
+// Date : $LastChangedDate: 2012-04-05 08:11:59 +0200 (Do, 05. Apr 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1321 $
+// Revision : $LastChangedRevision: 1315 $
//
///////////////////////////////////////////////////////////////////////////////
//
diff -uNr nagiosql32.orig/admin/templatedefinitions.php nagiosql32/admin/templatedefinitions.php
--- nagiosql32.orig/admin/templatedefinitions.php 2012-04-05 08:11:59.091878000 +0200
+++ nagiosql32/admin/templatedefinitions.php 2012-04-05 08:12:08.000000000 +0200
@@ -10,7 +10,7 @@
// Project : NagiosQL
// Component : Template definition list
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-04-05 08:11:59 +0200 (Thu, 05 Apr 2012) $
+// Date : $LastChangedDate: 2012-04-05 08:11:59 +0200 (Do, 05. Apr 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1315 $
diff -uNr nagiosql32.orig/functions/config_class.php nagiosql32/functions/config_class.php
--- nagiosql32.orig/functions/config_class.php 2013-01-10 09:46:11.799949000 +0100
+++ nagiosql32/functions/config_class.php 2012-04-17 11:59:16.000000000 +0200
@@ -10,10 +10,10 @@
// Project : NagiosQL
// Component : Configuration Class
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Thu, 10 Jan 2013) $
+// Date : $LastChangedDate: 2012-04-17 11:47:05 +0200 (Di, 17. Apr 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1351 $
+// Revision : $LastChangedRevision: 1319 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -710,8 +710,6 @@
} else {
$this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset or not activated dataset found'));
$this->processClassMessage(translate('Writing of the configuration failed - no dataset or not activated dataset found')."::",$this->strErrorMessage);
- $configtp->parse();
- $booReturn = $this->writeConfigFile($configtp->get(),$strFile,0,$intConfigID,$resConfigFile,$strConfigFile);
return(1);
}
$configtp->parse();
@@ -1254,7 +1252,7 @@
if ($strDataValue == 2) {$strDataValue = "*,";} else {$strDataValue = "";}
foreach ($arrDataRel AS $data) {
if ($data['exclude'] == 0) {
- $strDataValue .= $data['strSlave'].",";
+ $strDataValue .= $data['strSlave'].",";
} else if ($this->intNagVersion >=3) {
$strDataValue .= "!".$data['strSlave'].",";
}
diff -uNr nagiosql32.orig/functions/import_class.php nagiosql32/functions/import_class.php
--- nagiosql32.orig/functions/import_class.php 2012-09-18 10:44:22.198475000 +0200
+++ nagiosql32/functions/import_class.php 2012-04-17 11:47:08.000000000 +0200
@@ -10,10 +10,10 @@
// Project : NagiosQL
// Component : Import Class
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-09-18 10:44:22 +0200 (Tue, 18 Sep 2012) $
+// Date : $LastChangedDate: 2012-04-17 11:47:05 +0200 (Di, 17. Apr 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1346 $
+// Revision : $LastChangedRevision: 1319 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -899,7 +899,6 @@
$booResult = $this->myDBClass->insertData($strSQL);
if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
$intSlaveId = $this->myDBClass->intLastId;
-
// Special processing for serviceextinfo
if (($strDataTable == "tbl_serviceextinfo") && ($strKey == "service_description")) {
$strSQL = "SELECT `id` FROM `tbl_host` WHERE `host_name`='".$arrImportData['host_name']['value']."'";
@@ -997,7 +996,7 @@
}
// Does the entry already exist?
$strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` $strLink WHERE `".$arrRelData['target1']."` = '".$elem."'
- $strWhere AND `config_id`=".$this->intDomainId;
+ $strWhere AND `active`='1' AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
$intSlaveId = $strId+0;
@@ -1014,7 +1013,7 @@
}
// Insert relations
$strSQL = "INSERT INTO `".$arrRelData['linkTable']."` SET `idMaster` = ".$intDataId.", `idSlave` = ".$intSlaveId.",
- `exclude`=".$intExclude;
+ `exclude`=".$intExclude;
$booResult = $this->myDBClass->insertData($strSQL);
if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
// Keep values
@@ -1105,7 +1104,7 @@
// Process data values
foreach ($arrValues AS $elem) {
// Does the template already exist? (table 1)
- $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."'
+ $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."' AND `active`='1'
AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
@@ -1114,7 +1113,7 @@
}
if ($intSlaveId == 0) {
// Does the template already exist? (table 2)
- $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` WHERE `".$arrRelData['target2']."` = '".$elem."'
+ $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` WHERE `".$arrRelData['target2']."` = '".$elem."' AND `active`='1'
AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
@@ -1219,8 +1218,7 @@
// Process data values
foreach ($arrValues AS $elem) {
// Does the entry already exist?
- $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."'
- AND `config_id`=".$this->intDomainId;
+ $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."' AND `active`='1' AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
$intSlaveId = $strId+0;
@@ -1422,7 +1420,7 @@
}
// Does the entry already exist?
$strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."'
- $strWhere AND `config_id`=".$this->intDomainId;
+ $strWhere AND `active`='1' AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
$intSlaveId = $strId+0;
diff -uNr nagiosql32.orig/functions/prepend_adm.php nagiosql32/functions/prepend_adm.php
--- nagiosql32.orig/functions/prepend_adm.php 2013-01-10 09:46:11.799949000 +0100
+++ nagiosql32/functions/prepend_adm.php 2012-03-27 12:47:58.000000000 +0200
@@ -9,14 +9,14 @@
// Project : NagiosQL
// Component : Preprocessing script
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Thu, 10 Jan 2013) $
+// Date : $LastChangedDate: 2012-03-27 12:47:56 +0200 (Di, 27. Mär 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1351 $
+// Revision : $LastChangedRevision: 1308 $
//
///////////////////////////////////////////////////////////////////////////////
//error_reporting(E_ALL);
-error_reporting(E_ALL & ~E_STRICT);
+error_reporting(E_ALL);
//
// Security Protection
// ===================
@@ -253,7 +253,7 @@
$_SESSION['userid'] = $arrDataUser[0]['id'];
$_SESSION['groupadm'] = $arrDataUser[0]['admin_enable'];
$_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']."admin.php";
- $_SESSION['timestamp'] = time();
+ $_SESSION['timestamp'] = mktime();
$_SESSION['logged_in'] = 1;
$_SESSION['domain'] = $arrDataUser[0]['domain'];
// Update language settings
@@ -273,10 +273,8 @@
}
}
if (($_SESSION['logged_in'] == 0) && isset($chkInsName) && ($chkInsName != "") && ($intError == 0)) {
- $chkInsName = mysql_real_escape_string($chkInsName);
- $chkInsPasswd = mysql_real_escape_string($chkInsPasswd);
- $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$chkInsName."'
- AND `password`=MD5('".$chkInsPasswd."') AND `active`='1'";
+ $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".mysql_real_escape_string($chkInsName)."'
+ AND `password`=MD5('$chkInsPasswd') AND `active`='1'";
$booReturn = $myDBClass->getDataArray($strSQL,$arrDataUser,$intDataCount);
if ($booReturn == false) {
$myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage);
@@ -288,7 +286,7 @@
$_SESSION['userid'] = $arrDataUser[0]['id'];
$_SESSION['groupadm'] = $arrDataUser[0]['admin_enable'];
$_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url'] ."admin.php";
- $_SESSION['timestamp'] = time();
+ $_SESSION['timestamp'] = mktime();
$_SESSION['logged_in'] = 1;
$_SESSION['domain'] = $arrDataUser[0]['domain'];
// Update language settings
@@ -329,9 +327,9 @@
$myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage);
} else if ($intDataCount == 1) {
// Time expired?
- if (time() - $_SESSION['timestamp'] > $_SESSION['SETS']['security']['logofftime']) {
+ if (mktime() - $_SESSION['timestamp'] > $_SESSION['SETS']['security']['logofftime']) {
// Force new login
- $myDataClass->writeLog(translate('Session timeout reached - Seconds:')." ".(time() - $_SESSION['timestamp']." - User: ".$_SESSION['username']));
+ $myDataClass->writeLog(translate('Session timeout reached - Seconds:')." ".(mktime() - $_SESSION['timestamp']." - User: ".$_SESSION['username']));
$_SESSION['logged_in'] = 0;
header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php");
@@ -347,7 +345,7 @@
}
}
// Update login time
- $_SESSION['timestamp'] = time();
+ $_SESSION['timestamp'] = mktime();
if (isset($preContent) && ($preContent == "index.tpl.htm")) {
header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['startsite']);
}
diff -uNr nagiosql32.orig/functions/prepend_content.php nagiosql32/functions/prepend_content.php
--- nagiosql32.orig/functions/prepend_content.php 2012-05-03 15:15:32.673020000 +0200
+++ nagiosql32/functions/prepend_content.php 2012-04-04 07:30:16.000000000 +0200
@@ -144,14 +144,14 @@
$chkButValue3 = isset($_POST['butValue3']) ? $_POST['butValue3'] : ""; // Common button value
$chkButValue4 = isset($_POST['butValue4']) ? $_POST['butValue4'] : ""; // Common button value
$chkButValue5 = isset($_POST['butValue5']) ? $_POST['butValue5'] : ""; // Common button value
-$chkTfNullVal1 = (isset($_POST['tfNullVal1']) && ($_POST['tfNullVal1'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal1'])+0 : "NULL"; // Common text NULL field value
-$chkTfNullVal2 = (isset($_POST['tfNullVal2']) && ($_POST['tfNullVal2'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal2'])+0 : "NULL"; // Common text NULL field value
-$chkTfNullVal3 = (isset($_POST['tfNullVal3']) && ($_POST['tfNullVal3'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal3'])+0 : "NULL"; // Common text NULL field value
-$chkTfNullVal4 = (isset($_POST['tfNullVal4']) && ($_POST['tfNullVal4'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal4'])+0 : "NULL"; // Common text NULL field value
-$chkTfNullVal5 = (isset($_POST['tfNullVal5']) && ($_POST['tfNullVal5'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal5'])+0 : "NULL"; // Common text NULL field value
-$chkTfNullVal6 = (isset($_POST['tfNullVal6']) && ($_POST['tfNullVal6'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal6'])+0 : "NULL"; // Common text NULL field value
-$chkTfNullVal7 = (isset($_POST['tfNullVal7']) && ($_POST['tfNullVal7'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal7'])+0 : "NULL"; // Common text NULL field value
-$chkTfNullVal8 = (isset($_POST['tfNullVal8']) && ($_POST['tfNullVal8'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal8'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal1 = (isset($_POST['tfNullVal1']) && ($_POST['tfNullVal1'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal1']) : "NULL"; // Common text NULL field value
+$chkTfNullVal2 = (isset($_POST['tfNullVal2']) && ($_POST['tfNullVal2'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal2']) : "NULL"; // Common text NULL field value
+$chkTfNullVal3 = (isset($_POST['tfNullVal3']) && ($_POST['tfNullVal3'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal3']) : "NULL"; // Common text NULL field value
+$chkTfNullVal4 = (isset($_POST['tfNullVal4']) && ($_POST['tfNullVal4'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal4']) : "NULL"; // Common text NULL field value
+$chkTfNullVal5 = (isset($_POST['tfNullVal5']) && ($_POST['tfNullVal5'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal5']) : "NULL"; // Common text NULL field value
+$chkTfNullVal6 = (isset($_POST['tfNullVal6']) && ($_POST['tfNullVal6'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal6']) : "NULL"; // Common text NULL field value
+$chkTfNullVal7 = (isset($_POST['tfNullVal7']) && ($_POST['tfNullVal7'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal7']) : "NULL"; // Common text NULL field value
+$chkTfNullVal8 = (isset($_POST['tfNullVal8']) && ($_POST['tfNullVal8'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal8']) : "NULL"; // Common text NULL field value
//
// Quote special characters
// ==========================
diff -uNr nagiosql32.orig/templates/admin/user.tpl.htm nagiosql32/templates/admin/user.tpl.htm
--- nagiosql32.orig/templates/admin/user.tpl.htm 2012-03-27 12:47:56.208241000 +0200
+++ nagiosql32/templates/admin/user.tpl.htm 2012-03-27 12:47:58.000000000 +0200
@@ -3,7 +3,7 @@
<!-- Project : NagiosQL -->
<!-- Component : User template -->
<!-- Website : http://www.nagiosql.org -->
-<!-- Date : $LastChangedDate: 2012-03-27 12:47:56 +0200 (Tue, 27 Mar 2012) $ -->
+<!-- Date : $LastChangedDate: 2012-03-27 12:47:56 +0200 (Di, 27. Mär 2012) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1308 $ -->

View File

@@ -1,248 +0,0 @@
diff -uNr nagiosql32.orig/admin/verify.php nagiosql32/admin/verify.php
--- nagiosql32.orig/admin/verify.php 2012-09-24 14:42:29.052342000 +0200
+++ nagiosql32/admin/verify.php 2012-09-24 13:42:30.000000000 +0200
@@ -10,7 +10,7 @@
// Project : NagiosQL
// Component : Configuration verification
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-09-24 14:42:29 +0200 (Mon, 24 Sep 2012) $
+// Date : $LastChangedDate: 2012-09-24 14:42:29 +0200 (Mo, 24. Sep 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1347 $
diff -uNr nagiosql32.orig/functions/config_class.php nagiosql32/functions/config_class.php
--- nagiosql32.orig/functions/config_class.php 2017-05-20 19:36:57.228000000 +0200
+++ nagiosql32/functions/config_class.php 2013-01-10 09:46:14.000000000 +0100
@@ -10,10 +10,10 @@
// Project : NagiosQL
// Component : Configuration Class
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-04-17 11:47:05 +0200 (Di, 17. Apr 2012) $
+// Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Do, 10. Jan 2013) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1319 $
+// Revision : $LastChangedRevision: 1351 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -710,6 +710,8 @@
} else {
$this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset or not activated dataset found'));
$this->processClassMessage(translate('Writing of the configuration failed - no dataset or not activated dataset found')."::",$this->strErrorMessage);
+ $configtp->parse();
+ $booReturn = $this->writeConfigFile($configtp->get(),$strFile,0,$intConfigID,$resConfigFile,$strConfigFile);
return(1);
}
$configtp->parse();
@@ -1252,7 +1254,7 @@
if ($strDataValue == 2) {$strDataValue = "*,";} else {$strDataValue = "";}
foreach ($arrDataRel AS $data) {
if ($data['exclude'] == 0) {
- $strDataValue .= $data['strSlave'].",";
+ $strDataValue .= $data['strSlave'].",";
} else if ($this->intNagVersion >=3) {
$strDataValue .= "!".$data['strSlave'].",";
}
diff -uNr nagiosql32.orig/functions/import_class.php nagiosql32/functions/import_class.php
--- nagiosql32.orig/functions/import_class.php 2017-05-20 19:36:57.228000000 +0200
+++ nagiosql32/functions/import_class.php 2012-09-18 09:44:24.000000000 +0200
@@ -10,10 +10,10 @@
// Project : NagiosQL
// Component : Import Class
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-04-17 11:47:05 +0200 (Di, 17. Apr 2012) $
+// Date : $LastChangedDate: 2012-09-18 10:44:22 +0200 (Di, 18. Sep 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1319 $
+// Revision : $LastChangedRevision: 1346 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -899,6 +899,7 @@
$booResult = $this->myDBClass->insertData($strSQL);
if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
$intSlaveId = $this->myDBClass->intLastId;
+
// Special processing for serviceextinfo
if (($strDataTable == "tbl_serviceextinfo") && ($strKey == "service_description")) {
$strSQL = "SELECT `id` FROM `tbl_host` WHERE `host_name`='".$arrImportData['host_name']['value']."'";
@@ -996,7 +997,7 @@
}
// Does the entry already exist?
$strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` $strLink WHERE `".$arrRelData['target1']."` = '".$elem."'
- $strWhere AND `active`='1' AND `config_id`=".$this->intDomainId;
+ $strWhere AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
$intSlaveId = $strId+0;
@@ -1013,7 +1014,7 @@
}
// Insert relations
$strSQL = "INSERT INTO `".$arrRelData['linkTable']."` SET `idMaster` = ".$intDataId.", `idSlave` = ".$intSlaveId.",
- `exclude`=".$intExclude;
+ `exclude`=".$intExclude;
$booResult = $this->myDBClass->insertData($strSQL);
if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
// Keep values
@@ -1104,7 +1105,7 @@
// Process data values
foreach ($arrValues AS $elem) {
// Does the template already exist? (table 1)
- $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."' AND `active`='1'
+ $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."'
AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
@@ -1113,7 +1114,7 @@
}
if ($intSlaveId == 0) {
// Does the template already exist? (table 2)
- $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` WHERE `".$arrRelData['target2']."` = '".$elem."' AND `active`='1'
+ $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` WHERE `".$arrRelData['target2']."` = '".$elem."'
AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
@@ -1218,7 +1219,8 @@
// Process data values
foreach ($arrValues AS $elem) {
// Does the entry already exist?
- $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."' AND `active`='1' AND `config_id`=".$this->intDomainId;
+ $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."'
+ AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
$intSlaveId = $strId+0;
@@ -1420,7 +1422,7 @@
}
// Does the entry already exist?
$strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."'
- $strWhere AND `active`='1' AND `config_id`=".$this->intDomainId;
+ $strWhere AND `config_id`=".$this->intDomainId;
$strId = $this->myDBClass->getFieldData($strSQL);
if ($strId != "") {
$intSlaveId = $strId+0;
diff -uNr nagiosql32.orig/functions/nag_class.php nagiosql32/functions/nag_class.php
--- nagiosql32.orig/functions/nag_class.php 2012-10-03 10:00:02.307645000 +0200
+++ nagiosql32/functions/nag_class.php 2012-10-03 09:00:04.000000000 +0200
@@ -10,7 +10,7 @@
// Project : NagiosQL
// Component : Visualization Class
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-10-03 10:00:02 +0200 (Wed, 03 Oct 2012) $
+// Date : $LastChangedDate: 2012-10-03 10:00:02 +0200 (Mi, 03. Okt 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1349 $
diff -uNr nagiosql32.orig/functions/prepend_adm.php nagiosql32/functions/prepend_adm.php
--- nagiosql32.orig/functions/prepend_adm.php 2017-05-20 19:36:57.232000000 +0200
+++ nagiosql32/functions/prepend_adm.php 2013-01-10 09:46:14.000000000 +0100
@@ -9,14 +9,14 @@
// Project : NagiosQL
// Component : Preprocessing script
// Website : http://www.nagiosql.org
-// Date : $LastChangedDate: 2012-03-27 12:47:56 +0200 (Di, 27. Mär 2012) $
+// Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Do, 10. Jan 2013) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
-// Revision : $LastChangedRevision: 1308 $
+// Revision : $LastChangedRevision: 1351 $
//
///////////////////////////////////////////////////////////////////////////////
//error_reporting(E_ALL);
-error_reporting(E_ALL);
+error_reporting(E_ALL & ~E_STRICT);
//
// Security Protection
// ===================
@@ -253,7 +253,7 @@
$_SESSION['userid'] = $arrDataUser[0]['id'];
$_SESSION['groupadm'] = $arrDataUser[0]['admin_enable'];
$_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']."admin.php";
- $_SESSION['timestamp'] = mktime();
+ $_SESSION['timestamp'] = time();
$_SESSION['logged_in'] = 1;
$_SESSION['domain'] = $arrDataUser[0]['domain'];
// Update language settings
@@ -273,8 +273,10 @@
}
}
if (($_SESSION['logged_in'] == 0) && isset($chkInsName) && ($chkInsName != "") && ($intError == 0)) {
- $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".mysql_real_escape_string($chkInsName)."'
- AND `password`=MD5('$chkInsPasswd') AND `active`='1'";
+ $chkInsName = mysql_real_escape_string($chkInsName);
+ $chkInsPasswd = mysql_real_escape_string($chkInsPasswd);
+ $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$chkInsName."'
+ AND `password`=MD5('".$chkInsPasswd."') AND `active`='1'";
$booReturn = $myDBClass->getDataArray($strSQL,$arrDataUser,$intDataCount);
if ($booReturn == false) {
$myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage);
@@ -286,7 +288,7 @@
$_SESSION['userid'] = $arrDataUser[0]['id'];
$_SESSION['groupadm'] = $arrDataUser[0]['admin_enable'];
$_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url'] ."admin.php";
- $_SESSION['timestamp'] = mktime();
+ $_SESSION['timestamp'] = time();
$_SESSION['logged_in'] = 1;
$_SESSION['domain'] = $arrDataUser[0]['domain'];
// Update language settings
@@ -327,9 +329,9 @@
$myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage);
} else if ($intDataCount == 1) {
// Time expired?
- if (mktime() - $_SESSION['timestamp'] > $_SESSION['SETS']['security']['logofftime']) {
+ if (time() - $_SESSION['timestamp'] > $_SESSION['SETS']['security']['logofftime']) {
// Force new login
- $myDataClass->writeLog(translate('Session timeout reached - Seconds:')." ".(mktime() - $_SESSION['timestamp']." - User: ".$_SESSION['username']));
+ $myDataClass->writeLog(translate('Session timeout reached - Seconds:')." ".(time() - $_SESSION['timestamp']." - User: ".$_SESSION['username']));
$_SESSION['logged_in'] = 0;
header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php");
@@ -345,7 +347,7 @@
}
}
// Update login time
- $_SESSION['timestamp'] = mktime();
+ $_SESSION['timestamp'] = time();
if (isset($preContent) && ($preContent == "index.tpl.htm")) {
header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['startsite']);
}
diff -uNr nagiosql32.orig/functions/prepend_content.php nagiosql32/functions/prepend_content.php
--- nagiosql32.orig/functions/prepend_content.php 2017-05-20 19:36:57.232000000 +0200
+++ nagiosql32/functions/prepend_content.php 2012-05-03 08:10:06.000000000 +0200
@@ -144,14 +144,14 @@
$chkButValue3 = isset($_POST['butValue3']) ? $_POST['butValue3'] : ""; // Common button value
$chkButValue4 = isset($_POST['butValue4']) ? $_POST['butValue4'] : ""; // Common button value
$chkButValue5 = isset($_POST['butValue5']) ? $_POST['butValue5'] : ""; // Common button value
-$chkTfNullVal1 = (isset($_POST['tfNullVal1']) && ($_POST['tfNullVal1'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal1']) : "NULL"; // Common text NULL field value
-$chkTfNullVal2 = (isset($_POST['tfNullVal2']) && ($_POST['tfNullVal2'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal2']) : "NULL"; // Common text NULL field value
-$chkTfNullVal3 = (isset($_POST['tfNullVal3']) && ($_POST['tfNullVal3'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal3']) : "NULL"; // Common text NULL field value
-$chkTfNullVal4 = (isset($_POST['tfNullVal4']) && ($_POST['tfNullVal4'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal4']) : "NULL"; // Common text NULL field value
-$chkTfNullVal5 = (isset($_POST['tfNullVal5']) && ($_POST['tfNullVal5'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal5']) : "NULL"; // Common text NULL field value
-$chkTfNullVal6 = (isset($_POST['tfNullVal6']) && ($_POST['tfNullVal6'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal6']) : "NULL"; // Common text NULL field value
-$chkTfNullVal7 = (isset($_POST['tfNullVal7']) && ($_POST['tfNullVal7'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal7']) : "NULL"; // Common text NULL field value
-$chkTfNullVal8 = (isset($_POST['tfNullVal8']) && ($_POST['tfNullVal8'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal8']) : "NULL"; // Common text NULL field value
+$chkTfNullVal1 = (isset($_POST['tfNullVal1']) && ($_POST['tfNullVal1'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal1'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal2 = (isset($_POST['tfNullVal2']) && ($_POST['tfNullVal2'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal2'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal3 = (isset($_POST['tfNullVal3']) && ($_POST['tfNullVal3'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal3'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal4 = (isset($_POST['tfNullVal4']) && ($_POST['tfNullVal4'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal4'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal5 = (isset($_POST['tfNullVal5']) && ($_POST['tfNullVal5'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal5'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal6 = (isset($_POST['tfNullVal6']) && ($_POST['tfNullVal6'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal6'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal7 = (isset($_POST['tfNullVal7']) && ($_POST['tfNullVal7'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal7'])+0 : "NULL"; // Common text NULL field value
+$chkTfNullVal8 = (isset($_POST['tfNullVal8']) && ($_POST['tfNullVal8'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal8'])+0 : "NULL"; // Common text NULL field value
//
// Quote special characters
// ==========================
diff -uNr nagiosql32.orig/templates/admin/servicedependencies.tpl.htm nagiosql32/templates/admin/servicedependencies.tpl.htm
--- nagiosql32.orig/templates/admin/servicedependencies.tpl.htm 2013-01-10 09:46:11.799949000 +0100
+++ nagiosql32/templates/admin/servicedependencies.tpl.htm 2013-01-10 09:46:14.000000000 +0100
@@ -3,7 +3,7 @@
<!-- Project : NagiosQL -->
<!-- Component : servicedependencies template -->
<!-- Website : http://www.nagiosql.org -->
-<!-- Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Thu, 10 Jan 2013) $ -->
+<!-- Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Do, 10. Jan 2013) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1351 $ -->

File diff suppressed because it is too large Load Diff

View File

@@ -1,68 +0,0 @@
diff -uNr nagiosql32/functions/data_class.php nsql/functions/data_class.php
--- nagiosql32/functions/data_class.php 2017-05-21 04:16:26.144000000 +0200
+++ nsql/functions/data_class.php 2017-01-06 14:55:10.000000000 +0100
@@ -110,7 +110,7 @@
$strSQL = "DELETE FROM `".$strTableName."` WHERE `id` = $intDataId $strNoDelete";
$booReturn = $this->myDBClass->insertData($strSQL);
if ($booReturn == false) {
- $this->processClassMessage(translate('Delete failed because a database error:')."::".mysql_error()."::",$this->strInfoMessage);
+ $this->processClassMessage(translate('Delete failed because a database error:')."::".mysqli_error()."::",$this->strInfoMessage);
return(1);
} else if ($this->myDBClass->intAffectedRows == 0) {
$this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is protected from delete.')."::",$this->strErrorMessage);
@@ -134,7 +134,7 @@
$strSQL = "DELETE FROM `".$strTableName."` WHERE `id` = ".$elem['id'];
$booReturn = $this->myDBClass->insertData($strSQL);
if ($booReturn == false) {
- $this->processClassMessage(translate('Delete failed because a database error:')."::".mysql_error()."::",$this->strInfoMessage);
+ $this->processClassMessage(translate('Delete failed because a database error:')."::".mysqli_error()."::",$this->strInfoMessage);
return(1);
} else {
$intDeleteCount = $intDeleteCount + $this->myDBClass->intAffectedRows;
diff -uNr nagiosql32/functions/import_class.php nsql/functions/import_class.php
--- nagiosql32/functions/import_class.php 2017-05-21 04:16:11.976000000 +0200
+++ nsql/functions/import_class.php 2017-01-04 13:11:32.000000000 +0100
@@ -632,8 +632,8 @@
if ($strKeyField == "") {$strKey = $strConfigName;} else {$strKey = $strKeyField;}
if ($booResult != true) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
- if ($strKeyField != "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strKey." -> ".$arrImportData[$strKeyField]['value']."</b> ".translate('inside')." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".mysql_error()."::";
- if ($strKeyField == "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strTemp1." -> ".$strTemp2.translate('inside')."</b> ".$strTable." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".mysql_error()."::";
+ if ($strKeyField != "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strKey." -> ".$arrImportData[$strKeyField]['value']."</b> ".translate('inside')." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".mysqli_error()."::";
+ if ($strKeyField == "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strTemp1." -> ".$strTemp2.translate('inside')."</b> ".$strTable." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".mysqli_error()."::";
return(1);
} else {
if ($strKeyField != "") $this->strInfoMessage .= translate('Entry')." <b class=\"blackmessage\">".$strKey." -> ".$arrImportData[$strKeyField]['value']."</b> ".translate('inside')." <b class=\"blackmessage\">".$strTable."</b> ".translate('successfully inserted')."::";
@@ -1236,7 +1236,7 @@
// Update data in master table
$arrCommand[0] = $intSlaveId;
$strValue = implode("!",$arrCommand);
- $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = '".mysql_real_escape_string($strValue)."' WHERE `id` = ".$intDataId;
+ $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = '".mysqli_real_escape_string($strValue)."' WHERE `id` = ".$intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
diff -uNr nagiosql32/functions/mysql_class.php nsql/functions/mysql_class.php
--- nagiosql32/functions/mysql_class.php 2017-05-21 04:16:26.144000000 +0200
+++ nsql/functions/mysql_class.php 2017-01-06 14:55:18.000000000 +0100
@@ -330,7 +330,7 @@
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbdisconnect() {
- @mysql_close($this->strDBId);
+ @mysqli_close($this->strDBId);
return true;
}
diff -uNr nagiosql32/functions/prepend_content.php nsql/functions/prepend_content.php
--- nagiosql32/functions/prepend_content.php 2017-05-21 04:16:11.980000000 +0200
+++ nsql/functions/prepend_content.php 2017-01-06 15:15:59.000000000 +0100
@@ -321,7 +321,7 @@
if ($intSuccess != 0) $myVisClass->processMessage(translate('Configuration files successfully written!'),$strInfoMessage);
if ($intError != 0) $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, not found or you do not have write permission!'),$strErrorMessage);
} else if ($preTableName == 'tbl_service') {
- $strSQL = "SELECT `id`, `$preKeyField` FROM `$preTableName` WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1' GROUP BY `$preKeyField`";
+ $strSQL = "SELECT `id`, `$preKeyField` FROM `$preTableName` WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1' GROUP BY `$preKeyField`, `id`";
$myDBClass->getDataArray($strSQL,$arrData,$intDataCount);
if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage);
if ($booReturn && ($intDataCount != 0)) {

View File

@@ -1,94 +0,0 @@
diff -uNr nagiosql32.orig/admin/settings.php nagiosql32/admin/settings.php
--- nagiosql32.orig/admin/settings.php 2012-02-21 14:10:41.579203000 +0100
+++ nagiosql32/admin/settings.php 2017-05-20 20:02:31.568000000 +0200
@@ -92,8 +92,8 @@
}
}
// Write db settings to file
- if (is_writable($strBasePath."config/settings.php")) {
- $filSettings = fopen($strBasePath."config/settings.php","w");
+ if (is_writable("/etc/nagiosql/settings.php")) {
+ $filSettings = fopen("/etc/nagiosql/settings.php","w");
if ($filSettings) {
fwrite($filSettings,"<?php\n");
fwrite($filSettings,"exit;\n");
diff -uNr nagiosql32.orig/admin/support.php nagiosql32/admin/support.php
--- nagiosql32.orig/admin/support.php 2012-03-08 08:40:12.245037000 +0100
+++ nagiosql32/admin/support.php 2017-05-20 20:01:59.792000000 +0200
@@ -211,7 +211,7 @@
}
// File access checks
$conttp->setVariable("RW_CONFIG",translate("Read/Write access:")." settings.php");
-$strConfigFile = "../config/settings.php";
+$strConfigFile = "/etc/nagiosql/settings.php";
if (file_exists($strConfigFile) && is_readable($strConfigFile) && is_writable($strConfigFile)) {
$conttp->setVariable("RW_CONFIG_CLASS","checkgreen");
$conttp->setVariable("RW_CONFIG_RESULT",translate("ok"));
diff -uNr nagiosql32.orig/functions/prepend_adm.php nagiosql32/functions/prepend_adm.php
--- nagiosql32.orig/functions/prepend_adm.php 2017-05-20 20:08:12.900000000 +0200
+++ nagiosql32/functions/prepend_adm.php 2017-05-20 20:04:18.164000000 +0200
@@ -77,14 +77,14 @@
//
// Start installer
// ===============
-$preIniFile = $preBasePath.'config/settings.php';
+$preIniFile = '/etc/nagiosql/settings.php';
if (!file_exists($preIniFile) OR ! is_readable($preIniFile)) {
header("Location: ".$preBaseURL."install/index.php");
}
//
// Read file settings
// ==================
-$SETS = parse_ini_file($preBasePath.'config/settings.php',true);
+$SETS = parse_ini_file('/etc/nagiosql/settings.php',true);
if (!isset($_SESSION['SETS']['db'])) $_SESSION['SETS']['db'] = $SETS['db'];
//
// Include external function/class files - part 1
diff -uNr nagiosql32.orig/functions/prepend_scripting.php nagiosql32/functions/prepend_scripting.php
--- nagiosql32.orig/functions/prepend_scripting.php 2012-02-29 09:54:45.611973000 +0100
+++ nagiosql32/functions/prepend_scripting.php 2017-05-20 20:03:34.636000000 +0200
@@ -42,7 +42,7 @@
// Read settings file
// ==================
$preBasePath = str_replace("scripts","",getcwd());
-$preIniFile = $preBasePath.'config/settings.php';
+$preIniFile = '/etc/nagiosql/settings.php';
//
// Read file settings
// ==================
diff -uNr nagiosql32.orig/install/functions/install_class.php nagiosql32/install/functions/install_class.php
--- nagiosql32.orig/install/functions/install_class.php 2017-05-20 20:08:12.900000000 +0200
+++ nagiosql32/install/functions/install_class.php 2017-05-20 20:05:46.564000000 +0200
@@ -659,7 +659,7 @@
$strBasePath = substr(realpath('.'),0,-7);
$strE_ID = error_reporting();
error_reporting(0);
- $filSettings = fopen($strBasePath."config/settings.php","w");
+ $filSettings = fopen("/etc/nagiosql/settings.php","w");
error_reporting($strE_ID);
if ($filSettings) {
// Write Database Configuration into settings.php
diff -uNr nagiosql32.orig/install/index.php nagiosql32/install/index.php
--- nagiosql32.orig/install/index.php 2017-05-20 20:08:12.904000000 +0200
+++ nagiosql32/install/index.php 2017-05-20 20:04:52.492000000 +0200
@@ -27,7 +27,7 @@
$preContent = "templates/index.tpl.htm";
$preEncode = 'utf-8';
$preLocale = "../config/locale";
-$filConfig = "../config/settings.php";
+$filConfig = "/etc/nagiosql/settings.php";
$preDBType = "mysqli";
$strLangOpt = "";
$intError = 0;
diff -uNr nagiosql32.orig/install/step1.php nagiosql32/install/step1.php
--- nagiosql32.orig/install/step1.php 2017-05-20 20:08:12.904000000 +0200
+++ nagiosql32/install/step1.php 2017-05-20 20:05:19.420000000 +0200
@@ -186,7 +186,7 @@
}
$arrTemplate['CHECK_5_CONTENT_1'] = $strHTML;
// File access checks
-$strConfigFile = "../config/settings.php";
+$strConfigFile = "/etc/nagiosql/settings.php";
if (file_exists($strConfigFile) && is_readable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart1.translate("Read test on settings file (config/settings.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
} else if (file_exists($strConfigFile)&& !is_readable($strConfigFile)) {

View File

@@ -1,12 +0,0 @@
diff -uNr nagiosql32.orig/install/sql/nagiosQL_v32_db_mysql.sql nagiosql32/install/sql/nagiosQL_v32_db_mysql.sql
--- nagiosql32.orig/install/sql/nagiosQL_v32_db_mysql.sql 2012-03-01 12:24:44.682770000 +0100
+++ nagiosql32/install/sql/nagiosQL_v32_db_mysql.sql 2017-05-20 20:31:30.760000000 +0200
@@ -83,7 +83,7 @@
-- Datasets for table `tbl_configtarget`
--
-INSERT INTO `tbl_configtarget` (`id`, `target`, `alias`, `server`, `method`, `user`, `password`, `ssh_key_path`, `basedir`, `hostconfig`, `serviceconfig`, `backupdir`, `hostbackup`, `servicebackup`, `nagiosbasedir`, `importdir`, `picturedir`, `commandfile`, `binaryfile`, `pidfile`, `conffile`, `version`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(1, 'localhost', 'Local installation', 'localhost', '1', '', '', '', '/etc/nagiosql/', '/etc/nagiosql/hosts/', '/etc/nagiosql/services/', '/etc/nagiosql/backup/', '/etc/nagiosql/backup/hosts/', '/etc/nagiosql/backup/services/', '/etc/nagiosql/', '/opt/nagios/etc/objects/', '', '/var/nagios/rw/nagios.cmd', '/opt/nagios/bin/nagios', '/var/nagios/nagios.lock', '/etc/nagiosql/nagios.cfg', 3, 0, '1', '1', NOW());
+INSERT INTO `tbl_configtarget` (`id`, `target`, `alias`, `server`, `method`, `user`, `password`, `ssh_key_path`, `basedir`, `hostconfig`, `serviceconfig`, `backupdir`, `hostbackup`, `servicebackup`, `nagiosbasedir`, `importdir`, `picturedir`, `commandfile`, `binaryfile`, `pidfile`, `conffile`, `version`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(1, 'localhost', 'Local installation', 'localhost', '1', '', '', '', '/etc/nagiosql/', '/etc/nagiosql/hosts/', '/etc/nagiosql/services/', '/etc/nagiosql/backup/', '/etc/nagiosql/backup/hosts/', '/etc/nagiosql/backup/services/', '/etc/nagiosql/', '/etc/nagios4/objects/', '', '/var/lib/nagios4/rw/nagios.cmd', '/usr/sbin/nagios4', '/var/run/nagios4/nagios4.pid', '/etc/nagios4/nagios.cfg', 3, 0, '1', '1', NOW());
-- --------------------------------------------------------

View File

@@ -1,34 +0,0 @@
--- nagiosql-3.0.3.orig/debian/patches/30_nagios3_configs_readonly.dpatch
+++ nagiosql-3.0.3/debian/patches/30_nagios3_configs_readonly.dpatch
@@ -0,0 +1,31 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 30_nagios3_configs_readonly.dpatch by <wob@swobspace.eli.st-elisabeth.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad nagiosql-3.0.3~/nagiosql3/admin/domain.php nagiosql-3.0.3/nagiosql3/admin/domain.php
+--- nagiosql-3.0.3~/nagiosql3/admin/domain.php 2009-04-28 15:02:27.000000000 +0200
++++ nagiosql-3.0.3/nagiosql3/admin/domain.php 2009-06-14 14:18:09.000000000 +0200
+@@ -154,11 +154,11 @@
+ }
+ // Nagios base configuration files
+ if (isset($chkInsNagiosBaseDir)) {
+- if (! is_writable($chkInsNagiosBaseDir."nagios.cfg")) {
++ if (! is_readable($chkInsNagiosBaseDir."nagios.cfg")) {
+ $permissionerror .= $chkInsNagiosBaseDir."nagios.cfg ".gettext("is not writeable")."<br>";
+ $isanerror=1;
+ }
+- if (! is_writable($chkInsNagiosBaseDir."cgi.cfg")) {
++ if (! is_readable($chkInsNagiosBaseDir."cgi.cfg")) {
+ $permissionerror .= $chkInsNagiosBaseDir."cgi.cfg ".gettext("is not writeable")."<br>";
+ $isanerror=1;
+ }
+@@ -411,4 +411,4 @@
+ $maintp->setVariable("VERSION_INFO","<a href='http://www.nagiosql.org' target='_blank'>NagiosQL</a> - Version: $setFileVersion");
+ $maintp->parse("footer");
+ $maintp->show("footer");
+-?>
+\ No newline at end of file
++?>

View File

@@ -1,7 +0,0 @@
10_service_pack_1_additional_fixes_only.patch
20_service_pack_2_additional_fixes_only.patch
30_service_pack_3_additional_fixes_only.patch
31_service_pack_3_additional_fixes_only_mysqli.patch
40_settings_php.patch
50_nagios4_debian_pathes.patch
60_nagios4_configs_readonly.patch

78
debian/postinst vendored
View File

@@ -1,78 +0,0 @@
#!/bin/sh
# postinst script for nagiosql
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
setperm() {
user="$1"
group="$2"
mode="$3"
file="$4"
shift 4
# only do something when no setting exists
if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
chown "$user":"$group" "$file"
chmod "$mode" "$file"
fi
}
setgrperm() {
group="$1"
mode="$2"
file="$3"
shift 3
# only do something when no setting exists
if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
chgrp "$group" "$file"
chmod "$mode" "$file"
fi
}
case "$1" in
configure)
# -- /etc/nagiosql directories
for dir in `find /etc/nagiosql -type d 2> /dev/null`; do
[ -d $dir ] && setperm www-data nagios 6755 $dir
done
# -- /etc/nagiosql files
for file in `find /etc/nagiosql -type f -name \*.cfg 2> /dev/null`; do
[ -f $file ] && setperm www-data nagios 0644 $file
done
# -- /etc/nagios4 config files
for cfg in /etc/nagios4/nagios.cfg /etc/nagios/nagios4/cgi.cfg ; do
[ -e $cfg ] && setgrperm www-data 0644 $cfg
done
# -- at last
nsqlcfg="/etc/nagiosql/settings.php"
[ -e $nsqlcfg ] && setperm www-data www-data 0600 $nsqlcfg
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

40
debian/prerm vendored
View File

@@ -1,40 +0,0 @@
#!/bin/sh
# prerm script for nagiosql
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
remove|upgrade|deconfigure)
ENABLER="/usr/share/nagiosql/htdocs/install/ENABLE_INSTALLER"
[ -e $ENABLER ] && rm -f $ENABLER
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0

82
debian/rules vendored
View File

@@ -1,82 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DESTDIR = debian/nagiosql
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
dh_testdir
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# cp -a nagiosql3/* $(DESTDIR)/usr/share/nagiosql/htdocs/.
mkdir -p $(CURDIR)/$(DESTDIR)/usr/share/nagiosql/htdocs/
rsync -avr --exclude 'debian' --exclude '*-stamp' --exclude '.pc' $(CURDIR)/ $(CURDIR)/$(DESTDIR)/usr/share/nagiosql/htdocs/
rm -rf $(DESTDIR)/usr/share/nagiosql/htdocs/doc
rm -rf $(DESTDIR)/usr/share/nagiosql/htdocs/README.md
install -m 644 debian/apache.conf $(DESTDIR)/etc/nagiosql/
# Build architecture-dependent files here.
binary-arch: install
# Build architecture-independent files here.
binary-indep: install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_lintian
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
# dh_strip
dh_compress
dh_fixperms
# dh_perl
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure

View File

@@ -1 +0,0 @@
3.0 (quilt)

5
doc/CHANGELOG Executable file → Normal file
View File

@@ -1,3 +1,8 @@
CHANGELOG 3.3.0
---------------
- [OK] Support for PHP version 7.x
- [OK] Database interface changed from mysql to mysqli
CHANGELOG 3.2.0
---------------

View File

@@ -4,16 +4,16 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2008-2012 by Martin Willisegger
// (c) 2008-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component: Installations HowTo
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-12 08:30:07 +0100 (Mon, 12 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1288 $
// SVN-ID : $Id: INSTALLATION_deDE.txt 1288 2012-03-12 07:30:07Z martin $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
// SVN-ID : $Id: INSTALLATION_deDE.txt 2 2017-06-22 07:29:35Z martin $
//
///////////////////////////////////////////////////////////////////////////////
@@ -26,7 +26,7 @@
* Nagios 2.x/3.x oder Nagios kompatible Monitoringsoftware
* PHP 5.2.0 oder groesser, inklusive:
* PHP Module: Session
* PHP Module: MySQL
* PHP Module: MySQLi
* PHP Module: gettext
* PHP Module: filter
* PHP Module: FTP (optional)
@@ -38,7 +38,7 @@
= Neuinstallation =
===================
1. Download und entpacken von NagiosQL 3.2 in einem Apache zugaenglichen Verzeichnis.
1. Download und entpacken von NagiosQL 3.3 in einem Apache zugaenglichen Verzeichnis.
2. Der Installationsassistent wird automatisch durch Eingabe von install/index.php gestartet.
3. Die gewuenschte Sprache auswaehlen (siehe Appendix 2.)
4. Zum Installieren von NagiosQL den Anweisungen folgen.
@@ -50,11 +50,11 @@
1. Aktualisierungen von NagiosQL 1.x und 2.x sind leider nicht moeglich, bitte einfach eine neue Installation starten und
dann die Nagios Konfiguration durch den Import einbinden.
2. Aktualisierungen von NagiosQL 3.x
a. Download und entpacken von NagiosQL 3.2 in ein NEUES Apache zugaenglichen Verzeichnis (DocumentRoot auf neues Verzeichnis
a. Download und entpacken von NagiosQL 3.3 in ein NEUES Apache zugaenglichen Verzeichnis (DocumentRoot auf neues Verzeichnis
aendern)
b. Wird dieselbe Apachekonfiguration verwendet (altes NagiosQL Verzeichnis wegkopiert, neues NagiosQL Verzeichnis bekommt
denselben Namen), sollte der Apache Demon vor dem Upgrade neu gestartet werden.
c. Verschiebe die alte config/settings.php Datei in das neue NagiosQL 3.2 Verzeichnis config/
c. Verschiebe die alte config/settings.php Datei in das neue NagiosQL 3.3 Verzeichnis config/
d. Die alte Datenbank manuell sichern (z.Bsp. mit mysqldump)
e. Der Installationsassistent wird durch den Aufruf von install/index.php gestartet
f. Die gewuenschte Sprache waehlen (siehe auch Appendix 1.) und den Anweisungen folgen

View File

@@ -4,16 +4,16 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2008-2012 by Martin Willisegger
// (c) 2008-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component: Installation HowTo
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-12 08:30:07 +0100 (Mon, 12 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1288 $
// SVN-ID : $Id: INSTALLATION_enGB.txt 1288 2012-03-12 07:30:07Z martin $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
// SVN-ID : $Id: INSTALLATION_enGB.txt 2 2017-06-22 07:29:35Z martin $
//
///////////////////////////////////////////////////////////////////////////////
@@ -26,7 +26,7 @@
* Nagios 2.x/3.x or Nagios compatible monitoring software
* PHP 5.2.0 or greater including:
* PHP Module: Session
* PHP Module: MySQL
* PHP Module: MySQLi
* PHP Module: gettext
* PHP Module: filter
* PHP Module: FTP (optional)
@@ -38,7 +38,7 @@
NEW INSTALLATION
================
1. Download and extract NagiosQL 3.2 to a directory within your Apache Document Root
1. Download and extract NagiosQL 3.3 to a directory within your Apache Document Root
2. Start the Installation Wizard by opening install/index.php
3. Switch to your preferred language (see Appendix 1.)
4. Follow the instructions to install NagiosQL
@@ -50,10 +50,10 @@ NEW INSTALLATION
1. Upgrade from NagiosQL 1.x and 2.x are not possible, you should better start at "New Installation" and after the installation is done,
import Nagios configuration files with NagiosQL
2. Upgrade from NagiosQL 3.x
a. Download and extract NagiosQL 3.2 to a NEW directory and change your Apache DocumentRoot to the new directory
a. Download and extract NagiosQL 3.3 to a NEW directory and change your Apache DocumentRoot to the new directory
b. If the same Apache configuration is used (old NagiosQL directory moved away and new NagiosQL directory moved to the old
DocumentRoot), you should restart the apache demon before upgrade
b. Move your old config/settings.php file to the new NagiosQL 3.2 config/ folder
b. Move your old config/settings.php file to the new NagiosQL 3.3 config/ folder
c. Backup your old NagiosQL database (as example with mysqldump)
d. Start the Installation Wizard by opening install/index.php
e. Switch to your preferred language (see Appendix) and follow the instructions

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Configuration Class
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Thu, 10 Jan 2013) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1351 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -50,7 +50,7 @@ class nagconfig {
// Activities during initialisation
//
///////////////////////////////////////////////////////////////////////////////////////////
function nagconfig() {
function __construct() {
if (isset($_SESSION) && isset($_SESSION['SETS'])) {
// Read global settings
$this->arrSettings = $_SESSION['SETS'];
@@ -123,7 +123,7 @@ class nagconfig {
if ($arrConfigId != 1) {
// Define variables
$strTimeFile = "unknown";
$intFileStamp = mktime();
$intFileStamp = time();
foreach($arrConfigId AS $intConfigId) {
// Get configuration file data
$this->getConfigData($intConfigId,"target",$strTarget);
@@ -226,7 +226,7 @@ class nagconfig {
if ($arrConfigId != 1) {
// Define variables
$strTimeFile = "unknown";
$intFileStamp = mktime();
$intFileStamp = time();
foreach($arrConfigId AS $intConfigId) {
// Get configuration file data
$this->getConfigData($intConfigId,"target",$strTarget);
@@ -333,7 +333,7 @@ class nagconfig {
if ($strMethod == 1) {
// Save configuration file
if (file_exists($strConfigDir."/".$strName) && is_writable($strBackupDir) && is_writable($strConfigDir)) {
$strOldDate = date("YmdHis",mktime());
$strOldDate = date("YmdHis",time());
copy($strConfigDir."/".$strName,$strBackupDir."/".$strName."_old_".$strOldDate);
unlink($strConfigDir."/".$strName);
} else if (!is_writable($strBackupDir)) {
@@ -350,7 +350,7 @@ class nagconfig {
// Save configuration file
$intFileStamp = ftp_mdtm($this->resConnectId, $strConfigDir."/".$strName);
if ($intFileStamp > -1) {
$strOldDate = date("YmdHis",mktime());
$strOldDate = date("YmdHis",time());
$intErrorReporting = error_reporting();
error_reporting(0);
$intReturn = ftp_rename($this->resConnectId,$strConfigDir."/".$strName,$strBackupDir."/".$strName."_old_".$strOldDate);
@@ -374,7 +374,7 @@ class nagconfig {
$intFileStamp = $arrInfo['mtime'];
if ($intFileStamp > -1) {
$strOldDate = date("YmdHis",mktime());
$strOldDate = date("YmdHis",time());
$intReturn = ssh2_sftp_rename($this->resSFTP,$strConfigDir."/".$strName,$strBackupDir."/".$strName."_old_".$strOldDate);
if (!$intReturn) {
$this->processClassMessage(translate('Cannot backup the old configuration file because the permissions are wrong (remote SFTP)!')."::",$this->strErrorMessage);
@@ -583,7 +583,7 @@ class nagconfig {
$configtp = new HTML_Template_IT($this->arrSettings['path']['base_path']."/templates/files/");
$configtp->loadTemplatefile($setTemplate, true, true);
$configtp->setOptions($arrTplOptions);
$configtp->setVariable("CREATE_DATE",date("Y-m-d H:i:s",mktime()));
$configtp->setVariable("CREATE_DATE",date("Y-m-d H:i:s",time()));
$this->getConfigData($intConfigID,"version",$this->intNagVersion);
$configtp->setVariable("NAGIOS_QL_VERSION",$this->arrSettings['db']['version']);
if ($this->intNagVersion == 3) $strVersion = "Nagios 3.x config file";
@@ -812,7 +812,7 @@ class nagconfig {
$configtp = new HTML_Template_IT($this->arrSettings['path']['base_path']."/templates/files/");
$configtp->loadTemplatefile($setTemplate, true, true);
$configtp->setOptions($arrTplOptions);
$configtp->setVariable("CREATE_DATE",date("Y-m-d H:i:s",mktime()));
$configtp->setVariable("CREATE_DATE",date("Y-m-d H:i:s",time()));
if ($this->intNagVersion == 0) {
$this->getConfigData($intConfigID,"version",$this->intNagVersion);
}

10
functions/content_class.php Executable file → Normal file
View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Content Class
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2011-12-08 07:35:31 +0100 (Do, 08. Dez 2011) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1141 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -55,7 +55,7 @@ class nagcontent {
// Activities during class initialization
//
///////////////////////////////////////////////////////////////////////////////////////////
function nagcontent() {
function __construct() {
// Read global settings
$this->arrSettings = $_SESSION['SETS'];
if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain'];

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : NagiosQL data processing class
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-05 07:55:49 +0100 (Mon, 05 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1271 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -44,7 +44,7 @@ class nagdata {
// Activities during initialisation
//
///////////////////////////////////////////////////////////////////////////////////////////
function nagdata() {
function __construct() {
if (isset($_SESSION) && isset($_SESSION['SETS'])) {
// Read global settings
$this->arrSettings = $_SESSION['SETS'];
@@ -113,7 +113,7 @@ class nagdata {
$strSQL = "DELETE FROM `".$strTableName."` WHERE `id` = $intDataId $strNoDelete";
$booReturn = $this->myDBClass->insertData($strSQL);
if ($booReturn == false) {
$this->processClassMessage(translate('Delete failed because a database error:')."::".mysql_error()."::",$this->strInfoMessage);
$this->processClassMessage(translate('Delete failed because a database error:')."::".$this->myDBClass->strErrorMessage."::",$this->strInfoMessage);
return(1);
} else if ($this->myDBClass->intAffectedRows == 0) {
$this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is protected from delete.')."::",$this->strErrorMessage);
@@ -137,7 +137,7 @@ class nagdata {
$strSQL = "DELETE FROM `".$strTableName."` WHERE `id` = ".$elem['id'];
$booReturn = $this->myDBClass->insertData($strSQL);
if ($booReturn == false) {
$this->processClassMessage(translate('Delete failed because a database error:')."::".mysql_error()."::",$this->strInfoMessage);
$this->processClassMessage(translate('Delete failed because a database error:')."::".$this->myDBClass->strErrorMessage."::",$this->strInfoMessage);
return(1);
} else {
$intDeleteCount = $intDeleteCount + $this->myDBClass->intAffectedRows;

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Import Class
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-09-18 10:44:22 +0200 (Tue, 18 Sep 2012) $
// Date : $LastChangedDate: 2017-06-22 13:39:15 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1346 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 7 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -45,7 +45,7 @@ class nagimport {
// Activities during initialisation
//
///////////////////////////////////////////////////////////////////////////////////////////
function nagimport() {
function __construct() {
if (isset($_SESSION) && isset($_SESSION['SETS'])) {
// Read global settings
$this->arrSettings = $_SESSION['SETS'];
@@ -632,8 +632,8 @@ class nagimport {
if ($strKeyField == "") {$strKey = $strConfigName;} else {$strKey = $strKeyField;}
if ($booResult != true) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
if ($strKeyField != "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strKey." -> ".$arrImportData[$strKeyField]['value']."</b> ".translate('inside')." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".mysql_error()."::";
if ($strKeyField == "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strTemp1." -> ".$strTemp2.translate('inside')."</b> ".$strTable." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".mysql_error()."::";
if ($strKeyField != "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strKey." -> ".$arrImportData[$strKeyField]['value']."</b> ".translate('inside')." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".$this->myDBClass->strErrorMessage."::";
if ($strKeyField == "") $this->strErrorMessage .= translate('Entry')." <b class=\"blackmessage\">".$strTemp1." -> ".$strTemp2.translate('inside')."</b> ".$strTable." <b class=\"blackmessage\">".$strTable."</b> ".translate('could not be inserted:')." ".$this->myDBClass->strErrorMessage."::";
return(1);
} else {
if ($strKeyField != "") $this->strInfoMessage .= translate('Entry')." <b class=\"blackmessage\">".$strKey." -> ".$arrImportData[$strKeyField]['value']."</b> ".translate('inside')." <b class=\"blackmessage\">".$strTable."</b> ".translate('successfully inserted')."::";
@@ -1236,7 +1236,7 @@ class nagimport {
// Update data in master table
$arrCommand[0] = $intSlaveId;
$strValue = implode("!",$arrCommand);
$strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = '".mysql_real_escape_string($strValue)."' WHERE `id` = ".$intDataId;
$strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = '".$this->myDBClass->real_escape($strValue)."' WHERE `id` = ".$intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}

View File

@@ -1,331 +0,0 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
//
// Project : NagiosQL
// Component : Mysql data processing class
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Class: Common database functions for MySQL
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Includes any functions to communicate with an MySQL database server
//
// Name: mysqldb
//
// Class variables: $arrSettings Includes all global settings ($SETS)
// $strErrorMessage Includes database error messages
// $error Boolean - error occurred (true/false)
// $strDBId Database connection ID
// $intLastId Last insert ID
// $intAffectedRows Counter for affected data rows (INSERT/DELETE/UPDATE)
//
///////////////////////////////////////////////////////////////////////////////////////////////
class mysqldb {
// Define class variables
var $arrSettings; // Will be filled in class constructor
var $error = false; // Will be filled in functions
var $strDBId = ""; // Will be filled in functions
var $intLastId = 0; // Will be filled in functions
var $intAffectedRows = 0; // Will be filled in functions
var $strErrorMessage = ""; // Will be filled in functions
///////////////////////////////////////////////////////////////////////////////////////////
// Class constructor
///////////////////////////////////////////////////////////////////////////////////////////
//
// Activities during initialisation
//
///////////////////////////////////////////////////////////////////////////////////////////
function mysqldb() {
if (isset($_SESSION) && isset($_SESSION['SETS'])) {
// Read global settings
$this->arrSettings = $_SESSION['SETS'];
// Connect to Database
if (isset($this->arrSettings['db'])) $this->getDatabase($this->arrSettings['db']);
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Connect to a database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Opens a connection to the database server and select a database
//
// Parameters: $arrSettings Connection parameter
// -> Key server = Servername
// -> Key username = Benutzername
// -> Key password = Passwort
// -> Key database = Datenbank
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getdatabase($arrSettings) {
$this->dbconnect($arrSettings['server'],$arrSettings['port'],$arrSettings['username'],$arrSettings['password']);
if ($this->error == true) {
return false;
}
$this->dbselect($arrSettings['database']);
if ($this->error == true) {
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Get a singe data field
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sends an SQL statement to the server and returns the result of the first data field
//
// Parameters: $strSQL SQL Statement
//
// Return value: <data> = successful
// <empty> = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getFieldData($strSQL) {
// Send an SQL Statement to the server
$resQuery = mysql_query($strSQL);
// Error processing
if ($resQuery && (mysql_num_rows($resQuery) != 0) && (mysql_error() == "")) {
// return the field value at postition 0/0
return mysql_result($resQuery,0,0);
} else if (mysql_error() != "") {
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return("");
}
return("");
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Get a single dataset
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sends an SQL statement to the server and returns the result of the first data set
//
// Parameters: $strSQL SQL Statement
// $arrDataset Return value including the data set
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getSingleDataset($strSQL,&$arrDataset) {
$arrDataset = "";
// Send an SQL Statement to the server
$resQuery = mysql_query($strSQL);
// Error processing
if ($resQuery && (mysql_num_rows($resQuery) != 0) && (mysql_error() == "")) {
// Fill the data to the array
$arrDataset = mysql_fetch_array($resQuery,MYSQL_ASSOC);
return true;
} else if (mysql_error() != "") {
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Get a full data part
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sends an SQL statement to the server and returns the result inside a data array
//
// Parameters: $strSQL SQL Statement
// $arrDataset Return value including the data records
// $intDataCount Return value including the number of the records
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getDataArray($strSQL,&$arrDataset,&$intDataCount) {
$arrDataset = "";
$intDataCount = 0;
// Send an SQL Statement to the server
$resQuery = mysql_query($strSQL);
// Error processing
if ($resQuery && (mysql_num_rows($resQuery) != 0) && (mysql_error() == "")) {
$intDataCount = mysql_num_rows($resQuery);
$i = 0;
// Fill array
while ($arrDataTemp = mysql_fetch_array($resQuery, MYSQL_ASSOC)) {
foreach ($arrDataTemp AS $key => $value) {
$arrDataset[$i][$key] = $value;
}
$i++;
}
return true;
} else if (mysql_error() != "") {
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Insert data
///////////////////////////////////////////////////////////////////////////////////////////
//
// Inserts data to the database server
//
// Parameters: $strSQL SQL Statement
//
// $this->intLastId Dataset insert ID
// $this->intAffectedRows The number of the affected records
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function insertData($strSQL) {
// Send an SQL Statement to the server
$resQuery = mysql_query($strSQL);
// Error processing
if (mysql_error() == "") {
$this->intLastId = mysql_insert_id();
$this->intAffectedRows = mysql_affected_rows();
return true;
} else {
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return false;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Count records
///////////////////////////////////////////////////////////////////////////////////////////
//
// Counts the number of records
//
// Parameters: $strSQL SQL Statement
//
// Return value: <number> = successful
// 0 = no datasets or error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function countRows($strSQL) {
// Send an SQL Statement to the server
$resQuery = mysql_query($strSQL);
// Error processing
if ($resQuery && (mysql_error() == "")) {
return mysql_num_rows($resQuery);
} else {
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return 0;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
//
// help functions
//
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Connet to the database server
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameters: $dbserver Server name
// $dbport Server port
// $dbuser Database user
// $dbpasswd Database password
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbconnect($dbserver,$dbport,$dbuser,$dbpasswd) {
// Not all parameters available
if (($dbserver == "") || ($dbuser == "")) {
$this->strErrorMessage .= translate("Missing server connection parameter!")."::";
$this->error = true;
return false;
}
$this->strDBId = @mysql_connect($dbserver.":".$dbport,$dbuser,$dbpasswd);
// Session cannot be etablished
if(!$this->strDBId) {
$this->strErrorMessage .= "[".$this->arrSettings['db']['server']."] ".translate("Connection to the database server has failed by reason:")."::";
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: select database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameters: $database Database name
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbselect($database) {
// Not all parameters available
if ($database == "") {
$this->strErrorMessage .= translate("Missing database connection parameter!")."::";
$this->error = true;
return false;
}
$bolConnect = @mysql_select_db($database);
// Session cannot be etablished
if(!$bolConnect) {
$this->strErrorMessage .= "[".$this->arrSettings['db']['server']."] ".translate("Connection to the database server has failed by reason:")."::";
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return false;
}
$resQuery = mysql_query("set names 'utf8'");
if (mysql_error() != "") {
$this->strErrorMessage .= mysql_error()."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Close database connection
///////////////////////////////////////////////////////////////////////////////////////////
//
// Return value: true = successful
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbdisconnect() {
@mysql_close($this->strDBId);
return true;
}
}
?>

440
functions/mysqli_class.php Normal file
View File

@@ -0,0 +1,440 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// Common utilities
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2017 by Martin Willisegger
//
// Project : Common scripts
// Component : MySQLi data processing class
// Date : $LastChangedDate: 2017-06-22 13:39:15 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.3.0
// Revision : $LastChangedRevision: 7 $
// SVN-ID : $Id: mysqli_class.php 7 2017-06-22 11:39:15Z martin $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Class: Common database functions for MySQL (mysqli database module)
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
// Includes any functions to communicate with an MySQL database server
//
// Name: mysqlidb
//
// Class variables: $arrParams Array including the server settings
// ---------------- $strErrorMessage Database error string
// $error Boolean - Error true/false
// $strDBId Database connection id
// $intLastId ID of last dataset
// $intAffectedRows Counter variable of all affected data dows
// $booSSLuse Use SSL connection
// (INSERT/DELETE/UPDATE)
//
// Parameters: $arrParams['server'] -> DB server name
// ----------- $arrParams['port'] -> DB server port
// $arrParams['user'] -> DB server username
// $arrParams['password'] -> DB server password
// $arrParams['database'] -> DB server database name
//
///////////////////////////////////////////////////////////////////////////////////////////////
class mysqlidb {
// Define class variables
var $error = false; // Will be filled in functions
var $strDBId = ""; // Will be filled in functions
var $intLastId = 0; // Will be filled in functions
var $intAffectedRows = 0; // Will be filled in functions
var $strErrorMessage = ""; // Will be filled in functions
var $booSSLuse = false; // Defines if SSL is used or not
var $arrParams = ""; // Must be filled in while initialization
var $arrSQLdef = ""; // Must be filled in while initialization
var $strSQLQuote1 = "`"; // Quote char for table or row names
var $strSQLQuote2 = "'"; // Quote char for table or row names
///////////////////////////////////////////////////////////////////////////////////////////
// Class constructor
///////////////////////////////////////////////////////////////////////////////////////////
//
// Activities during initialisation
//
///////////////////////////////////////////////////////////////////////////////////////////
function __construct() {
$this->arrParams['server'] = "";
$this->arrParams['port'] = 0;
$this->arrParams['username'] = "";
$this->arrParams['password'] = "";
$this->arrParams['database'] = "";
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Connect to database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Opens a connection to the database server and select a database
//
//
// Return value: true successful
// false error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getdatabase() {
$this->dbconnect();
if ($this->error == true) {
return false;
}
$this->dbselect();
if ($this->error == true) {
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Get a single dataset field value
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sends an SQL statement to the server and returns the result of the first data field
//
// Parameters: $strSQL SQL Statement
//
// Return value: <data> = successful
// <empty> = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getFieldData($strSQL) {
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Send the SQL statement to the server
$resQuery = mysqli_query($this->strDBId,$strSQL);
// Error processing
if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == "")) {
// Return the field value from position 0/0
$arrDataset = mysqli_fetch_array($resQuery,MYSQLI_NUM);
return $arrDataset[0];
} else if (mysqli_error($this->strDBId) != "") {
$this->strErrorMessage .= mysqli_error($this->strDBId)."::";
$this->error = true;
return("");
}
return("");
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Get a single dataset
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sends an SQL statement to the server and returns the result of the first data set
//
// Parameters: $strSQL SQL Statement
// $arrDataset Return value including the data set
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getSingleDataset($strSQL,&$arrDataset) {
$arrDataset = "";
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Send the SQL statement to the server
$resQuery = mysqli_query($this->strDBId,$strSQL);
// Error processing
if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == "")) {
// Put the values into the array
$arrDataset = mysqli_fetch_array($resQuery,MYSQLI_ASSOC);
return true;
} else if (mysqli_error($this->strDBId) != "") {
$this->strErrorMessage .= mysqli_error($this->strDBId)."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Get a full data part
///////////////////////////////////////////////////////////////////////////////////////////
//
// Sends an SQL statement to the server and returns the result inside a data array
//
// Parameters: $strSQL SQL Statement
// $arrDataset Return value including the data records
// $intDataCount Return value including the number of the records
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function getDataArray($strSQL,&$arrDataset,&$intDataCount) {
$arrDataset = "";
$intDataCount = 0;
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Send the SQL statement to the server
$resQuery = mysqli_query($this->strDBId,$strSQL);
// Error processing
if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == "")) {
$intDataCount = mysqli_num_rows($resQuery);
$i = 0;
// Put the values into the array
while ($arrDataTemp = mysqli_fetch_array($resQuery,MYSQLI_ASSOC)) {
foreach ($arrDataTemp AS $key => $value) {
$arrDataset[$i][$key] = $value;
}
$i++;
}
return true;
} else if (mysqli_error($this->strDBId) != "") {
$this->strErrorMessage .= mysqli_error($this->strDBId)."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Insert/update/delete data
///////////////////////////////////////////////////////////////////////////////////////////
//
// Insert/update or delete data
//
// Parameters: $strSQL SQL Statement
// $this->intLastId Dataset insert ID
// $this->intAffectedRows The number of the affected records
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function insertData($strSQL) {
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Send the SQL statement to the server
$resQuery = mysqli_query($this->strDBId,$strSQL);
// Error processing
if (mysqli_error($this->strDBId) == "") {
$this->intLastId = mysqli_insert_id($this->strDBId);
$this->intAffectedRows = mysqli_affected_rows($this->strDBId);
return true;
} else {
$this->strErrorMessage .= mysqli_error($this->strDBId)."::";
$this->error = true;
return false;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Counts data rows
///////////////////////////////////////////////////////////////////////////////////////////
//
// Counts the number of records
//
// Parameters: $strSQL SQL Statement
//
// Return value: <number> = successful
// 0 = no datasets or error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function countRows($strSQL) {
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Send the SQL statement to the server
$resQuery = mysqli_query($this->strDBId,$strSQL);
// Error processing
if ($resQuery && (mysqli_error($this->strDBId) == "")) {
return mysqli_num_rows($resQuery);
} else {
$this->strErrorMessage .= mysqli_error($this->strDBId);
$this->error = true;
return 0;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Use mysqli_real_escape_string
///////////////////////////////////////////////////////////////////////////////////////////
//
// Returns a safe insert string for database manipulations
//
// Value: $strInput Input String
//
// Return value: $strOutput Output String
//
///////////////////////////////////////////////////////////////////////////////////////////
function real_escape($strInput) {
return mysqli_real_escape_string($this->strDBId,$strInput);
}
///////////////////////////////////////////////////////////////////////////////////////////
//
// Assistant functions
//
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Initialize a mysql database connection
///////////////////////////////////////////////////////////////////////////////////////////
//
// Return value: true
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbinit() {
$this->strDBId = mysqli_init();
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Connect to database server
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameters: $dbserver Server name
// $dbuser Database user
// $dbpasswd Database password
// $dbname Database name
// $dbport TCP port
//
// Return value: true successful
// false error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbconnect($dbserver=NULL,$dbport=NULL,$dbuser=NULL,$dbpasswd=NULL) {
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Get parameters
if ($dbserver == NULL) $dbserver = $this->arrParams['server'];
if ($dbport == NULL) $dbport = $this->arrParams['port'];
if ($dbuser == NULL) $dbuser = $this->arrParams['username'];
if ($dbpasswd == NULL) $dbpasswd = $this->arrParams['password'];
// Not all parameters available
if (($dbserver == "") || ($dbuser == "") || ($dbpasswd == "")) {
$this->strErrorMessage .= gettext("Missing server connection parameter!")."::";
$this->error = true;
return false;
}
$this->dbinit();
if ($this->booSSLuse == true) {
// TO BE DEFINED
}
$intErrorReporting = error_reporting();
error_reporting(0);
if ($dbport == 0) {
$booReturn = mysqli_real_connect($this->strDBId,$dbserver,$dbuser,$dbpasswd);
} else {
$booReturn = mysqli_real_connect($this->strDBId,$dbserver,$dbuser,$dbpasswd,NULL,$dbport);
}
$arrError = error_get_last();
error_reporting($intErrorReporting);
// Connection fails
if($booReturn == false) {
$this->strErrorMessage = "[".$dbserver."] ".gettext("Connection to the database server has failed by reason:")." ::";
if (mysqli_connect_error($this->strDBId) != "") $this->strErrorMessage .= mysqli_connect_error($this->strDBId)."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: select database
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameters: $database Database name
//
// Return value: true = successful
// false = error
// Status message is stored in class variable $this->strErrorMessage
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbselect($database=NULL) {
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Get parameters
if ($database == NULL) $database = $this->arrParams['database'];
// Not all parameters available
if ($database == "") {
$this->strErrorMessage .= gettext("Missing database connection parameter!")."::";
$this->error = true;
return false;
}
$bolConnect = mysqli_select_db($this->strDBId,$database);
// Session cannot be etablished
if(!$bolConnect) {
$this->strErrorMessage .= "[".$database."] ".gettext("Connection to the database has failed by reason:")." ::";
$this->strErrorMessage .= mysqli_error($this->strDBId)."::";
$this->error = true;
return false;
}
$resQuery = mysqli_query($this->strDBId,"set names 'utf8'");
if (mysqli_error($this->strDBId) != "") {
$this->strErrorMessage .= mysqli_error($this->strDBId)."::";
$this->error = true;
return false;
}
$resQuery = mysqli_query($this->strDBId,"set session sql_mode = 'NO_ENGINE_SUBSTITUTION'");
if (mysqli_error($this->strDBId) != "") {
$this->strErrorMessage .= mysqli_error($this->strDBId)."::";
$this->error = true;
return false;
}
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Set SSL parameters
///////////////////////////////////////////////////////////////////////////////////////////
//
// Parameters: $sslkey SSL key
// $sslcert SSL certificate
// $sslca SSL CA file (optional)
// $sslpath SSL certificate path (optional)
// $sslcypher SSL cypher (optional)
//
// Return value: true successful
// The mysqli_ssl_set function always returns TRUE!
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbsetssl($sslkey,$sslcert,$sslca=NULL,$sslpath=NULL,$sslcypher=NULL) {
// Reset error variables
$this->strErrorMessage = "";
$this->error = false;
// Values are missing
if (($sslkey == "") || ($sslcert == "")) {
$this->strErrorMessage = gettext("Missing MySQL SSL parameter!")."::";
$this->error = true;
return false;
}
mysqli_ssl_set($this->strDBId,$sslkey,$sslcert,$sslca,$sslpath,$sslcypher);
return true;
}
///////////////////////////////////////////////////////////////////////////////////////////
// Function: Close database server connectuon
///////////////////////////////////////////////////////////////////////////////////////////
//
// Value: none
//
// Return value: true if successful, false if failed
//
///////////////////////////////////////////////////////////////////////////////////////////
function dbdisconnect() {
mysqli_close($this->strDBId);
return true;
}
}
?>

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Visualization Class
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-10-03 10:00:02 +0200 (Wed, 03 Oct 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1349 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////////////////////
//
@@ -46,7 +46,7 @@ class nagvisual {
// Activities during initialisation
//
///////////////////////////////////////////////////////////////////////////////////////////
function nagvisual() {
function __construct() {
// Read global settings
$this->arrSettings = $_SESSION['SETS'];
if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain'];
@@ -229,7 +229,7 @@ class nagvisual {
///////////////////////////////////////////////////////////////////////////////////////////
function tfSecure($strKey) {
$strKey = stripslashes($strKey);
$strKey = mysql_real_escape_string($strKey);
$strKey = $this->myDBClass->real_escape($strKey);
return($strKey);
}

View File

@@ -4,15 +4,15 @@
// NagiosQL
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Preprocessing script
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2013-01-10 09:46:11 +0100 (Thu, 10 Jan 2013) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1351 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//error_reporting(E_ALL);
@@ -46,7 +46,7 @@ $chkDomainId = 0;
$chkGroupAdm = 0;
$intError = 0;
$setDBVersion = "unknown";
$setFileVersion = "3.2.0";
$setFileVersion = "3.3.0";
//
// Start PHP session
// =================
@@ -91,15 +91,17 @@ if (!isset($_SESSION['SETS']['db'])) $_SESSION['SETS']['db'] = $SETS['db'];
//
// Include external function/class files - part 1
// ==============================================
include("mysql_class.php");
include("mysqli_class.php");
require("translator.php");
//
// Initialize classes - part 1
// ===========================
$myDBClass = new mysqldb;
$myDBClass = new mysqlidb;
$myDBClass->arrParams = $SETS['db'];
$myDBClass->getDatabase();
if ($myDBClass->error == true) {
$strErrorMessage .= translate('Error while connecting to database:')."::".$myDBClass->strErrorMessage;
$intError = 1;
$strDBMessage = $myDBClass->strErrorMessage;
$booError = $myDBClass->error;
}
//
// Get additional configuration from the table tbl_settings
@@ -264,7 +266,7 @@ if (isset($_SERVER['REMOTE_USER']) && ($_SERVER['REMOTE_USER'] != "") && ($_SESS
$SETS['data']['locale'] = $strUserLocale;
}
// Update last login time
$strSQLUpdate = "UPDATE `tbl_user` SET `last_login`=NOW() WHERE `username`='".mysql_real_escape_string($chkInsName)."'";
$strSQLUpdate = "UPDATE `tbl_user` SET `last_login`=NOW() WHERE `username`='".$myDBClass->real_escape($chkInsName)."'";
$booReturn = $myDBClass->insertData($strSQLUpdate);
$myDataClass->writeLog(translate('Webserver login successfull'));
$_SESSION['strLoginMessage'] = "";
@@ -273,8 +275,8 @@ if (isset($_SERVER['REMOTE_USER']) && ($_SERVER['REMOTE_USER'] != "") && ($_SESS
}
}
if (($_SESSION['logged_in'] == 0) && isset($chkInsName) && ($chkInsName != "") && ($intError == 0)) {
$chkInsName = mysql_real_escape_string($chkInsName);
$chkInsPasswd = mysql_real_escape_string($chkInsPasswd);
$chkInsName = $myDBClass->real_escape($chkInsName);
$chkInsPasswd = $myDBClass->real_escape($chkInsPasswd);
$strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$chkInsName."'
AND `password`=MD5('".$chkInsPasswd."') AND `active`='1'";
$booReturn = $myDBClass->getDataArray($strSQL,$arrDataUser,$intDataCount);
@@ -299,7 +301,7 @@ if (($_SESSION['logged_in'] == 0) && isset($chkInsName) && ($chkInsName != "") &
$SETS['data']['locale'] = $strUserLocale;
}
// Update last login time
$strSQLUpdate = "UPDATE `tbl_user` SET `last_login`=NOW() WHERE `username`='".mysql_real_escape_string($chkInsName)."'";
$strSQLUpdate = "UPDATE `tbl_user` SET `last_login`=NOW() WHERE `username`='".$myDBClass->real_escape($chkInsName)."'";
$booReturn = $myDBClass->insertData($strSQLUpdate);
$myDataClass->writeLog(translate('Login successfull'));
$_SESSION['strLoginMessage'] = "";
@@ -322,7 +324,7 @@ if (!isset($_SESSION['userid']) && ($_SESSION['logged_in'] == 1)) {
// Review and update login
// =======================
if (($_SESSION['logged_in'] == 1) && ($intError == 0)) {
$strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".mysql_real_escape_string($_SESSION['username'])."'";
$strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$myDBClass->real_escape($_SESSION['username'])."'";
$booReturn = $myDBClass->getDataArray($strSQL,$arrDataUser,$intDataCount);
if ($booReturn == false) {
$myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage);

10
functions/prepend_content.php Executable file → Normal file
View File

@@ -4,15 +4,15 @@
// NagiosQL
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Preprocessing script for content pages
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2011-12-08 07:35:31 +0100 (Do, 08. Dez 2011) $
// Date : $LastChangedDate: 2017-06-22 09:53:38 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1141 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 5 $
//
///////////////////////////////////////////////////////////////////////////////
//
@@ -321,7 +321,7 @@ if (($chkModus == "make") && ($intGlobalWriteAccess == 0)) {
if ($intSuccess != 0) $myVisClass->processMessage(translate('Configuration files successfully written!'),$strInfoMessage);
if ($intError != 0) $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, not found or you do not have write permission!'),$strErrorMessage);
} else if ($preTableName == 'tbl_service') {
$strSQL = "SELECT `id`, `$preKeyField` FROM `$preTableName` WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1' GROUP BY `$preKeyField`";
$strSQL = "SELECT `id`, `$preKeyField` FROM `$preTableName` WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1' GROUP BY `$preKeyField`, `id`";
$myDBClass->getDataArray($strSQL,$arrData,$intDataCount);
if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage);
if ($booReturn && ($intDataCount != 0)) {

View File

@@ -2,17 +2,18 @@
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Preprocessing script for scripting files
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-29 09:54:45 +0100 (Wed, 29 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:48:25 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1262 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 4 $
//
///////////////////////////////////////////////////////////////////////////////
error_reporting(E_ALL);
@@ -41,7 +42,7 @@ define('BASE_PATH', str_replace("functions","",dirname(__FILE__)));
//
// Read settings file
// ==================
$preBasePath = str_replace("scripts","",getcwd());
$preBasePath = str_replace("functions","",dirname(__FILE__));
$preIniFile = $preBasePath.'config/settings.php';
//
// Read file settings
@@ -50,16 +51,16 @@ $SETS = parse_ini_file($preIniFile,true);
//
// Include external function/class files - part 1
// ==============================================
include("mysql_class.php");
include("mysqli_class.php");
//
// Initialize classes - part 1
// ===========================
$myDBClass = new mysqldb;
$myDBClass->arrSettings = $SETS;
$myDBClass->getDatabase($SETS['db']);
$myDBClass = new mysqlidb;
$myDBClass->arrParams = $SETS['db'];
$myDBClass->getDatabase();
if ($myDBClass->error == true) {
echo str_replace("::","\n","Error while connecting to database: ".$myDBClass->strErrorMessage);
$intError = 1;
$strDBMessage = $myDBClass->strErrorMessage;
$booError = $myDBClass->error;
}
//
// Get additional configuration from the table tbl_settings

View File

@@ -5,13 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Translation Functions
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-23 08:02:21 +0100 (Thu, 23 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1238 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

0
images/sort_asc.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

0
images/sort_desc.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Start script
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-14 13:43:23 +0100 (Wed, 14 Mar 2012) $
// Author : $LastChangedBy: rouven $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1296 $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//

View File

@@ -11,10 +11,10 @@
/* Project : NagiosQL
/* Component: Installer CSS
/* Website : http://www.nagiosql.org
/* Date : $LastChangedDate: 2012-02-23 07:49:34 +0100 (Thu, 23 Feb 2012) $
/* Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
/* Author : $LastChangedBy: martin $
/* Version : 3.1.1
/* Revision : $LastChangedRevision: 1237 $
/* Version : 3.3.0
/* Revision : $LastChangedRevision: 2 $
/*
/**********************************************/
@@ -413,6 +413,16 @@ input[type=submit][disabled] {
margin:0px;
padding-bottom:2px;
}
select.required {
width:202px;
border: 1px solid #053056;
background: #941616 url(../images/inputmust.png);
font-family:Verdana, Helvetica, sans-serif;
color: #FFFFFF;
font-weight: bold;
font-size:12px;
height:22px;
}
.validation-advice {
margin: 5px 0;
padding: 5px;

6
install/functions/initial_settings.php Executable file → Normal file
View File

@@ -11,14 +11,14 @@ exit;
; Component: Initial configuration settings
; Website : http://www.nagiosql.org
; Date : May 27, 2011, 2:35 pm
; Version : 3.2.0
; $LastChangedRevision: 1058 $
; Version : 3.3.0
; $LastChangedRevision: 2 $
;
; DO NOT USE THIS FILE AS NAGIOSQL SETTINGS FILE!
;
;///////////////////////////////////////////////////////////////////////////////
[db]
type = mysql
type = mysqli
server = localhost
port = 3306
database = db_nagiosql_v32

834
install/functions/install_class.php Executable file → Normal file

File diff suppressed because it is too large Load Diff

10
install/functions/prepend_install.php Executable file → Normal file
View File

@@ -4,15 +4,15 @@
// NagiosQL
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer preprocessing script
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-01-04 15:40:03 +0100 (Mi, 04. Jan 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1154 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
error_reporting(E_ALL);
@@ -24,7 +24,7 @@ $strInfoMessage = ""; // All information messages (green)
//
// Start PHP session
// =================
session_start('nagiosql_install');
session_start([ 'name' => 'nagiosql_install']);
//
// Include external function/class files
// =====================================

0
install/images/input.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 363 B

After

Width:  |  Height:  |  Size: 363 B

View File

@@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer main script
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-28 18:14:54 +0100 (Tue, 28 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1261 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@@ -25,18 +25,18 @@ $preLocale = "../config/locale";
$filConfig = "../config/settings.php";
$preDBType = "mysql";
$strLangOpt = "";
$intError = 0;
$strVersion = "3.3.0";
$intUpdate = 0;
$intError = 0;
//
// Include preprocessing file
// ==========================
require("functions/prepend_install.php");
require("../functions/translator.php");
//
// Restart session
// ===============
session_destroy();
session_start('nagiosql_install');
session_start([ 'name' => 'nagiosql_install']);
//
// POST parameters
// ===============
@@ -60,11 +60,11 @@ if (extension_loaded('gettext')) {
bindtextdomain($chkLocale, $preLocale);
bind_textdomain_codeset($chkLocale, $preEncode);
textdomain($chkLocale);
$arrTemplate['NAGIOS_FAQ'] = translate("Online Documentation");
$arrTemplate['NAGIOS_FAQ'] = $myInstClass->translate("Online Documentation");
// Language selection field
$arrTemplate['LANGUAGE'] = translate("Language");
foreach(getLanguageData() AS $key => $elem) {
$strLangOpt .= "<option value='".$key."' {sel}>".getLanguageNameFromCode($key,false)."</option>\n";
$arrTemplate['LANGUAGE'] = $myInstClass->translate("Language");
foreach($myInstClass->getLangData() AS $key => $elem) {
$strLangOpt .= "<option value='".$key."' {sel}>".$myInstClass->getLangNameFromCode($key,false)."</option>\n";
if ($key != $chkLocale) { $strLangOpt = str_replace(" {sel}","",$strLangOpt); } else { $strLangOpt = str_replace(" {sel}"," selected",$strLangOpt); }
}
$arrTemplate['LANG_OPTION'] = $strLangOpt;
@@ -76,7 +76,6 @@ if (extension_loaded('gettext')) {
// Checking current installation
// =============================
// Does the settings file exist?
$_SESSION['install']['dbtype'] = $preDBType;
if (file_exists($filConfig) && is_readable($filConfig)) {
$preSettings = parse_ini_file($filConfig,true);
// Are there any connection data?
@@ -89,49 +88,70 @@ if (file_exists($filConfig) && is_readable($filConfig)) {
$preDBType = "pgsql";
$_SESSION['install']['dbtype'] = $preDBType;
}
if ($preDBType == "mysql") {
if (extension_loaded('mysql')) {
// Select database
$intDBFallback = 0;
if (isset($preSettings['db']['type'])) {
if ($preSettings['db']['type'] == "mysqli") {
if (extension_loaded('mysqli')) {
// Include mysqli class
include("../functions/mysqli_class.php");
// Initialize mysqli class
$myDBClass = new mysqlidb;
} else {
$intDBFallback = 1;
}
$_SESSION['install']['dbtype'] = 'mysqli';
} else {
$intDBFallback = 1;
}
} else {
if (extension_loaded('mysqli')) {
// Include mysql class
include("../functions/mysql_class.php");
include("../functions/mysqli_class.php");
// Initialize mysql class
$myDBClass = new mysqldb;
if ($myDBClass->error == true) {
$strErrorMessage .= translate("Database connection failed. Upgrade not available!")."<br>";
$strErrorMessage .= translate('Error while connecting to database:')."<br>".$myDBClass->strErrorMessage."<br>";
} else {
$strSQL = "SELECT `category`,`name`,`value` FROM `tbl_settings`";
$booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount);
if ($booReturn == false) {
$strErrorMessage .= translate("Settings table not available or wrong. Upgrade not available!")."<br>";
$strErrorMessage .= translate('Error while selecting data from database:')."<br>".$myDBClass->strDBError."<br>";
} else if ($intDataCount != 0) {
foreach ($arrDataLines AS $elem) {
$preSettings[$elem['category']][$elem['name']] = $elem['value'];
}
$intUpdate = 1;
}
}
$_SESSION['install']['dbtype'] = $preDBType;
} else {
$strErrorMessage .= translate("Installation cannot continue, please make sure you have the mysql extension loaded!");
$intError = 1;
$intDBFallback = 1;
}
} else if ($preDBType == "pgsql") {
if (extension_loaded('pgsql')) {
$strErrorMessage .= translate("Installation cannot continue, postgres is not yet available in beta!");
$intError = 1;
} else {
$strErrorMessage .= translate("Installation cannot continue, please make sure you have the pgsql extension loaded!");
$intError = 1;
}
$_SESSION['install']['dbtype'] = 'mysqli';
$preSettings['db']['type'] = 'mysqli';
}
// Set DB parameters
$myDBClass->arrParams['server'] = $preSettings['db']['server'];
$myDBClass->arrParams['port'] = $preSettings['db']['port'];
$myDBClass->arrParams['username'] = $preSettings['db']['username'];
$myDBClass->arrParams['password'] = $preSettings['db']['password'];
$myDBClass->arrParams['database'] = $preSettings['db']['database'];
$myDBClass->getdatabase();
// DB failure
if ($intDBFallback == 1) {
$_SESSION['install']['dbtype'] = 'mysqli';
$preSettings['db']['type'] = 'mysqli';
$intUpdate = 0;
} else {
$strErrorMessage .= translate("Database type in settings file is wrong (config/settings.php). Upgrade not available!");
if ($myDBClass->error == true) {
$strErrorMessage .= $myInstClass->translate("Database connection failed. Upgrade not available!")."<br>";
$strErrorMessage .= str_replace("::","<br>",$myDBClass->strErrorMessage)."<br>";
} else {
$strSQL = "SELECT category,name,value FROM tbl_settings";
$booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount);
if ($booReturn == false) {
$strErrorMessage .= $myInstClass->translate("Settings table not available or wrong. Upgrade not available!")."<br>";
$strErrorMessage .= str_replace("::","<br>",$myDBClass->strErrorMessage)."<br>";
} else if ($intDataCount != 0) {
foreach ($arrDataLines AS $elem) {
$preSettings[$elem['category']][$elem['name']] = $elem['value'];
}
$intUpdate = 1;
}
}
}
} else {
$strErrorMessage .= translate("Database values in settings file are missing (config/settings.php). Upgrade not available!");
$strErrorMessage .= $myInstClass->translate("Database values in settings file are missing (config/settings.php). Upgrade not available!");
}
} else {
$strErrorMessage .= translate("Settings file not found or not readable (config/settings.php). Upgrade not available!");
$strErrorMessage .= $myInstClass->translate("Settings file not found or not readable (config/settings.php). Upgrade not available!");
}
//
// Initial settings (new installation)
@@ -141,40 +161,38 @@ if (file_exists($filInit) && is_readable($filInit)) {
$preInit = parse_ini_file($filInit,true);
$_SESSION['init_settings'] = $preInit;
} else {
$strErrorMessage .= translate("Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!");
$strErrorMessage .= $myInstClass->translate("Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!");
}
//
// Build content
// =============
$arrTemplate['PAGETITLE'] = "[NagiosQL] Installation Wizard";
$arrTemplate['MAIN_TITLE'] = translate("Welcome to the NagiosQL Installation Wizard");
$arrTemplate['TEXT_PART_1'] = translate("This wizard will help you to install and configure NagiosQL.");
$arrTemplate['TEXT_PART_2'] = translate("For questions please visit");
$arrTemplate['TEXT_PART_3'] = translate("First let's check your local environment and find out if everything NagiosQL needs is available.");
$arrTemplate['TEXT_PART_4'] = translate("The basic requirements are:");
$arrTemplate['TEXT_PART_5'] = translate("PHP 5.2.0 or greater including:");
$arrTemplate['TEXT_PHP_REQ_1'] = translate("PHP Module:")." Session";
$arrTemplate['TEXT_PHP_REQ_2'] = translate("PHP Module:")." gettext";
$arrTemplate['TEXT_PHP_REQ_3'] = translate("PHP Module:")." filter";
//$arrTemplate['TEXT_PHP_REQ_4'] = translate("PHP Module:")." XML";
//$arrTemplate['TEXT_PHP_REQ_5'] = translate("PHP Module:")." SimpleXML";
$arrTemplate['TEXT_PHP_REQ_6'] = translate("PHP Module:")." MySQL";
//$arrTemplate['TEXT_PHP_REQ_7'] = translate("PHP Module:")." PgSQL ".translate("(optional)");
$arrTemplate['TEXT_PHP_REQ_8'] = translate("PHP Module:")." FTP ".translate("(optional)");
$arrTemplate['TEXT_PHP_REQ_9'] = translate("PHP Module:")." curl ".translate("(optional)");
$arrTemplate['TEXT_PHP_REQ_10'] = translate("PECL Extension:")." SSH ".translate("(optional)");
$arrTemplate['TEXT_PART_6'] = translate("php.ini options").":";
$arrTemplate['TEXT_INI_REQ_1'] = translate("file_uploads on (for upload features)");
$arrTemplate['TEXT_INI_REQ_2'] = translate("session.auto_start needs to be off");
$arrTemplate['TEXT_PART_7'] = translate("A MySQL database server");
$arrTemplate['TEXT_PART_8'] = translate("Nagios 2.x/3.x");
$arrTemplate['PAGETITLE'] = "[NagiosQL] ".$myInstClass->translate("Installation wizard");
$arrTemplate['MAIN_TITLE'] = $myInstClass->translate("Welcome to the NagiosQL installation wizard");
$arrTemplate['TEXT_PART_1'] = $myInstClass->translate("This wizard will help you to install and configure NagiosQL.");
$arrTemplate['TEXT_PART_2'] = $myInstClass->translate("For questions please visit").": ";
$arrTemplate['TEXT_PART_3'] = $myInstClass->translate("First let's check your local environment and find out if everything NagiosQL needs is available.");
$arrTemplate['TEXT_PART_4'] = $myInstClass->translate("The basic requirements are:");
$arrTemplate['TEXT_PART_5'] = $myInstClass->translate("PHP 5.2.0 or greater including:");
$arrTemplate['TEXT_PHP_REQ_1'] = $myInstClass->translate("PHP database module:")." ".
$myInstClass->translate("supported types are")." <b>mysqli</b>";
$arrTemplate['TEXT_PHP_REQ_2'] = $myInstClass->translate("PHP module:")." <b>session</b>";
$arrTemplate['TEXT_PHP_REQ_3'] = $myInstClass->translate("PHP module:")." <b>gettext</b>";
$arrTemplate['TEXT_PHP_REQ_6'] = $myInstClass->translate("PHP module:")." <b>filter</b>";
$arrTemplate['TEXT_PHP_REQ_8'] = $myInstClass->translate("PHP module:")." <b>FTP</b> ".$myInstClass->translate("(optional)");
$arrTemplate['TEXT_PHP_REQ_10'] = $myInstClass->translate("PECL extension:")." <b>SSH</b> ".$myInstClass->translate("(optional)");
$arrTemplate['TEXT_PART_6'] = $myInstClass->translate("php.ini options").":";
$arrTemplate['TEXT_INI_REQ_1'] = $myInstClass->translate("file_uploads on (for upload features)");
$arrTemplate['TEXT_INI_REQ_2'] = $myInstClass->translate("session.auto_start needs to be off");
$arrTemplate['TEXT_PART_7'] = $myInstClass->translate("A database server");
$arrTemplate['TEXT_PART_8'] = $myInstClass->translate("Nagios 2.x/3.x/4.x");
$arrTemplate['TEXT_PART_9'] = $myInstClass->translate("NagiosQL version")." ".$strVersion;
$arrTemplate['LOCALE'] = $chkLocale;
$arrTemplate['ONLINE_DOC'] = translate("Online Documentation");
$arrTemplate['ONLINE_DOC'] = $myInstClass->translate("Online documentation");
//
// New installation or upgrade
// ===========================
$arrTemplate['NEW_INSTALLATION'] = translate("START INSTALLATION");
$arrTemplate['UPDATE'] = translate("START UPDATE");
$arrTemplate['NEW_INSTALLATION'] = $myInstClass->translate("START INSTALLATION");
$arrTemplate['UPDATE'] = $myInstClass->translate("START UPDATE");
$arrTemplate['DISABLE_NEW'] = "";
$arrTemplate['UPDATE_ERROR'] = "<font style=\"color:red;\">".$strErrorMessage."</font>";
if ($intUpdate == 1) {

View File

@@ -5,39 +5,39 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - check page
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-21 14:10:41 +0100 (Tue, 21 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1229 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
// Actual database files
// =====================
$preSqlNewInstall = "sql/nagiosQL_v32_db_mysql.sql";
$preSqlUpdateLast = "sql/update_31x_320.sql";
$preNagiosQL_ver = "3.2.0";
//
// Define common variables
// =======================
$preContent = "templates/install.tpl.htm";
$preEncode = 'utf-8';
$preLocale = "../config/locale";
$intError = 0;
$chkModus = "none";
//
// Include preprocessing file
// ==========================
require("functions/prepend_install.php");
require("../functions/translator.php");
//
// Actual database files
// =====================
$preSqlNewInstall = "sql/nagiosQL_v32_db_mysql.sql";
$preSqlUpdateLast = "sql/update_31x_320.sql";
$preNagiosQL_ver = "3.3.0";
//
// Process initial value
// =====================
if (!isset($_SESSION['init_settings'])) header("Location: index.php");
$strInitDBtype = isset($_SESSION['SETS']['db']['type']) ? $_SESSION['SETS']['db']['type'] : $_SESSION['init_settings']['db']['type'];
$strInitDBserver = isset($_SESSION['SETS']['db']['server']) ? $_SESSION['SETS']['db']['server'] : $_SESSION['init_settings']['db']['server'];
$strInitDBname = isset($_SESSION['SETS']['db']['database']) ? $_SESSION['SETS']['db']['database'] : $_SESSION['init_settings']['db']['database'];
$strInitDBuser = isset($_SESSION['SETS']['db']['username']) ? $_SESSION['SETS']['db']['username'] : $_SESSION['init_settings']['db']['username'];
@@ -48,6 +48,7 @@ $strInitDBport = isset($_SESSION['SETS']['db']['port']) ? $_SESSION['SETS']['d
// =======================
if (!isset($_SESSION['install']['jscript'])) $_SESSION['install']['jscript'] = "no";
if (!isset($_SESSION['install']['locale'])) $_SESSION['install']['locale'] = "en_GB";
if (!isset($_SESSION['install']['dbtype'])) $_SESSION['install']['dbtype'] = $strInitDBtype;
if (!isset($_SESSION['install']['dbserver'])) $_SESSION['install']['dbserver'] = $strInitDBserver;
if (!isset($_SESSION['install']['localsrv'])) $_SESSION['install']['localsrv'] = "";
if (!isset($_SESSION['install']['dbname'])) $_SESSION['install']['dbname'] = $strInitDBname;
@@ -68,12 +69,13 @@ if (!isset($_SESSION['install']['nagpath'])) $_SESSION['install']['nagpath']
// POST parameters
// ===============
$arrStep = array(1,2,3);
$chkStep = isset($_POST['hidStep']) ? $_POST['hidStep'] : "1";
$chkStep = (isset($_POST['hidStep']) && in_array($_POST['hidStep'],$arrStep)) ? $_POST['hidStep']+0 : "1";
if (isset($_GET['step']) && in_array($_GET['step'],$arrStep)) $chkStep = $_GET['step']+0;
if (!in_array($chkStep,$arrStep)) $arrStep = 1;
// Session values
$_SESSION['install']['locale'] = isset($_POST['hidLocale']) ? $_POST['hidLocale'] : $_SESSION['install']['locale'];
$_SESSION['install']['jscript'] = isset($_POST['hidJScript']) ? $_POST['hidJScript'] : $_SESSION['install']['jscript'];
$_SESSION['install']['dbtype'] = isset($_POST['selDBtype']) ? $_POST['selDBtype'] : $_SESSION['install']['dbtype'];
$_SESSION['install']['dbserver'] = isset($_POST['tfDBserver']) ? $_POST['tfDBserver'] : $_SESSION['install']['dbserver'];
$_SESSION['install']['localsrv'] = isset($_POST['tfLocalSrv']) ? $_POST['tfLocalSrv'] : $_SESSION['install']['localsrv'];
$_SESSION['install']['dbname'] = isset($_POST['tfDBname']) ? $_POST['tfDBname'] : $_SESSION['install']['dbname'];
@@ -84,20 +86,19 @@ $_SESSION['install']['admpass'] = isset($_POST['tfDBprivPass']) ? $_POST['tfDBp
$_SESSION['install']['qluser'] = isset($_POST['tfQLuser']) ? $_POST['tfQLuser'] : $_SESSION['install']['qluser'];
$_SESSION['install']['qlpass'] = isset($_POST['tfQLpass']) ? $_POST['tfQLpass'] : $_SESSION['install']['qlpass'];
$_SESSION['install']['dbport'] = isset($_POST['tfDBport']) ? $_POST['tfDBport']+0 : $_SESSION['install']['dbport'];
$_SESSION['install']['dbdrop'] = isset($_POST['chbDrop']) ? $_POST['chbDrop']+0 : $_SESSION['install']['dbdrop'];
$_SESSION['install']['sample'] = isset($_POST['chbSample']) ? $_POST['chbSample']+0 : $_SESSION['install']['sample'];
$_SESSION['install']['createpath'] = isset($_POST['chbPath']) ? $_POST['chbPath']+0 : $_SESSION['install']['createpath'];
$_SESSION['install']['dbdrop'] = isset($_POST['chbDrop']) ? $_POST['chbDrop']+0 : 0;
$_SESSION['install']['sample'] = isset($_POST['chbSample']) ? $_POST['chbSample']+0 : 0;
$_SESSION['install']['createpath'] = isset($_POST['chbPath']) ? $_POST['chbPath']+0 : 0;
$_SESSION['install']['qlpath'] = isset($_POST['tfQLpath']) ? $_POST['tfQLpath'] : $_SESSION['install']['qlpath'];
$_SESSION['install']['nagpath'] = isset($_POST['tfNagiosPath']) ? $_POST['tfNagiosPath'] : $_SESSION['install']['nagpath'];
$preSqlNewInstall = str_replace("DBTYPE",$_SESSION['install']['dbtype'],$preSqlNewInstall);
$preSqlNewInstall = str_replace("mysqli","mysql",$preSqlNewInstall);
if (isset($_POST['butNewInstall'])) $chkModus = "Installation";
if (isset($_POST['butUpgrade'])) $chkModus = "Update";
if (!isset($_SESSION['install']['mode'])) $_SESSION['install']['mode'] = $chkModus;
//
// Store data to session parameters
// ================================
//
// Language settings
// =================
@@ -121,7 +122,7 @@ ob_end_clean();
// Build content
// =============
$arrTemplate['PAGETITLE'] = "[NagiosQL] Installation Wizard";
$arrTemplate['MAIN_TITLE'] = translate("Welcome to the NagiosQL Installation Wizard");
$arrTemplate['MAIN_TITLE'] = $myInstClass->translate("Welcome to the NagiosQL Installation Wizard");
$arrTemplate['CONTENT'] = $strContent;
//
// Write content

Some files were not shown because too many files have changed in this diff Show More