Imported Upstream version 3.3.0

This commit is contained in:
Mario Fetka 2017-10-20 15:00:08 +02:00
parent c4f4701ef1
commit 8b51dbf723
150 changed files with 4395 additions and 4065 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 {

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

818
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')) {
// Include mysql class
include("../functions/mysql_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>";
// 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 {
$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;
}
$intDBFallback = 1;
}
$_SESSION['install']['dbtype'] = $preDBType;
$_SESSION['install']['dbtype'] = 'mysqli';
} else {
$strErrorMessage .= translate("Installation cannot continue, please make sure you have the mysql extension loaded!");
$intError = 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;
$intDBFallback = 1;
}
} else {
$strErrorMessage .= translate("Database type in settings file is wrong (config/settings.php). Upgrade not available!");
if (extension_loaded('mysqli')) {
// Include mysql class
include("../functions/mysqli_class.php");
// Initialize mysql class
$myDBClass = new mysqldb;
} else {
$intDBFallback = 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 {
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

View File

@ -8,11 +8,11 @@
-- Project : NagiosQL
-- Component : Import samples build from Nagios 3.0.5 configuration samples
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-24 10:22:28 +0100 (Fri, 24 Feb 2012) $
-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
-- Author : $LastChangedBy: martin $
-- Version : 3.2.0
-- Revision : $LastChangedRevision: 1248 $
-- SVN-ID : $Id: import_nagios_sample.sql 1248 2012-02-24 09:22:28Z martin $
-- Version : 3.3.0
-- Revision : $LastChangedRevision: 2 $
-- SVN-ID : $Id: import_nagios_sample.sql 2 2017-06-22 07:29:35Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

View File

@ -8,11 +8,11 @@
-- Project : NagiosQL
-- Component : Complete NagiosQL Database
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-03-01 12:24:44 +0100 (Thu, 01 Mar 2012) $
-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
-- Author : $LastChangedBy: martin $
-- Version : 3.2.0
-- Revision : $LastChangedRevision: 1268 $
-- SVN-ID : $Id: nagiosQL_v32_db_mysql.sql 1268 2012-03-01 11:24:44Z martin $
-- Version : 3.3.0
-- Revision : $LastChangedRevision: 2 $
-- SVN-ID : $Id: nagiosQL_v32_db_mysql.sql 2 2017-06-22 07:29:35Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

View File

@ -10,11 +10,11 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.0 to NagiosQL 3.0.1
-- Website : 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.0.2
-- Revision : $LastChangedRevision: 1237 $
-- SVN-ID : $Id: update_300_301.sql 1237 2012-02-23 06:49:34Z martin $
-- Revision : $LastChangedRevision: 2 $
-- SVN-ID : $Id: update_300_301.sql 2 2017-06-22 07:29:35Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -8,10 +8,10 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.4 to NagiosQL 3.1.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-27 07:58:18 +0100 (Mon, 27 Feb 2012) $
-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
-- Author : $LastChangedBy: martin $
-- Version : 3.1.1
-- Revision : $LastChangedRevision: 1255 $
-- Revision : $LastChangedRevision: 2 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -10,11 +10,11 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.1 to NagiosQL 3.0.2
-- Website : 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.0.2
-- Revision : $LastChangedRevision: 1237 $
-- SVN-ID : $Id: update_301_302.sql 1237 2012-02-23 06:49:34Z martin $
-- Revision : $LastChangedRevision: 2 $
-- SVN-ID : $Id: update_301_302.sql 2 2017-06-22 07:29:35Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -10,11 +10,11 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.2 to NagiosQL 3.0.3
-- Website : 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.0.3
-- Revision : $LastChangedRevision: 1237 $
-- SVN-ID : $Id: update_302_303.sql 1237 2012-02-23 06:49:34Z martin $
-- Revision : $LastChangedRevision: 2 $
-- SVN-ID : $Id: update_302_303.sql 2 2017-06-22 07:29:35Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -8,11 +8,11 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.3 to NagiosQL 3.0.4
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2011-03-13 14:00:26 +0100 (Sun, 13 Mar 2011) $
-- Author : $LastChangedBy: rouven $
-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
-- Author : $LastChangedBy: martin $
-- Version : 3.1.1
-- Revision : $LastChangedRevision: 1058 $
-- SVN-ID : $Id: update_303_304.sql 1058 2011-03-13 13:00:26Z rouven $
-- Revision : $LastChangedRevision: 2 $
-- SVN-ID : $Id: update_303_304.sql 2 2017-06-22 07:29:35Z martin $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -8,10 +8,10 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.0.4 to NagiosQL 3.1.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-02-27 07:58:18 +0100 (Mon, 27 Feb 2012) $
-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
-- Author : $LastChangedBy: martin $
-- Version : 3.1.1
-- Revision : $LastChangedRevision: 1255 $
-- Revision : $LastChangedRevision: 2 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -8,10 +8,10 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.1.0 to NagiosQL 3.1.1
-- Website : 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 $
-- Revision : $LastChangedRevision: 2 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -8,10 +8,10 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.1.x to NagiosQL 3.2.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-03-12 22:41:04 +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: 1291 $
-- Revision : $LastChangedRevision: 2 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -8,10 +8,10 @@
-- Project : NagiosQL
-- Component : Update from NagiosQL 3.1.x to NagiosQL 3.2.0
-- Website : www.nagiosql.org
-- Date : $LastChangedDate: 2012-03-12 22:41:04 +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: 1291 $
-- Revision : $LastChangedRevision: 2 $
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--

View File

@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - step 1
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-25 17:48:16 +0100 (Sat, 25 Feb 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1252 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@ -39,14 +39,16 @@ $arrOptionalExt = array (
'FTP' => 'ftp',
'SSH2' => 'ssh2'
);
//$arrSupportedDBs = array (
// 'MySQL' => 'mysql',
// 'Postgres' => 'pgsql'
//);
/*
$arrSupportedDBs = array (
'MySQL' => 'mysql'
'MySQL' => 'mysql',
'MySQLi' => 'mysqli',
'Postgres' => 'pgsql'
);
*/
$arrSupportedDBs = array (
'MySQLi' => 'mysqli'
);
$arrIniCheck = array (
'file_uploads' => 1,
'session.auto_start' => 0,
@ -69,7 +71,7 @@ $arrSourceURLs = array(
'XML' => 'http://www.php.net/manual/en/book.xml.php',
'SimpleXML' => 'http://www.php.net/manual/en/book.simplexml.php',
'FTP' => 'http://www.php.net/manual/en/book.ftp.php',
'MySQL' => 'http://php.net/manual/de/book.mysql.php',
'MySQL' => 'http://php.net/manual/de/book.mysqli.php',
'PEAR' => 'http://pear.php.net',
'date.timezone' => 'http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone',
'SSH2' => 'http://pecl.php.net/package/ssh2'
@ -77,20 +79,20 @@ $arrSourceURLs = array(
//
// Build content
// =============
$arrTemplate['STEP1_BOX'] = translate('Requirements');
$arrTemplate['STEP2_BOX'] = translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = translate('Finish');
$arrTemplate['STEP1_TITLE'] = "NagiosQL ".translate($_SESSION['install']['mode']).": ".translate("Checking requirements");
$arrTemplate['STEP1_SUBTITLE1'] = translate("Checking Client");
$arrTemplate['STEP1_SUBTITLE2'] = translate("Checking PHP version");
$arrTemplate['STEP1_SUBTITLE3'] = translate("Checking PHP extensions");
$arrTemplate['STEP1_SUBTITLE4'] = translate("Checking available database interfaces");
$arrTemplate['STEP1_SUBTITLE5'] = translate("Checking php.ini/.htaccess settings");
$arrTemplate['STEP1_SUBTITLE6'] = translate("Checking System Permission");
$arrTemplate['STEP1_TEXT3_1'] = translate("The following modules/extensions are <em>required</em> to run NagiosQL");
$arrTemplate['STEP1_TEXT3_2'] = translate("The next couple of extensions are <em>optional</em> but recommended");
$arrTemplate['STEP1_TEXT4_1'] = translate("Check which of the supported extensions are installed. At least one of them is required.");
$arrTemplate['STEP1_TEXT5_1'] = translate("The following settings are <em>required</em> to run NagiosQL");
$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements');
$arrTemplate['STEP2_BOX'] = $myInstClass->translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish');
$arrTemplate['STEP1_TITLE'] = "NagiosQL ".$myInstClass->translate($_SESSION['install']['mode']).": ".$myInstClass->translate("Checking requirements");
$arrTemplate['STEP1_SUBTITLE1'] = $myInstClass->translate("Checking Client");
$arrTemplate['STEP1_SUBTITLE2'] = $myInstClass->translate("Checking PHP version");
$arrTemplate['STEP1_SUBTITLE3'] = $myInstClass->translate("Checking PHP extensions");
$arrTemplate['STEP1_SUBTITLE4'] = $myInstClass->translate("Checking available database interfaces");
$arrTemplate['STEP1_SUBTITLE5'] = $myInstClass->translate("Checking php.ini/.htaccess settings");
$arrTemplate['STEP1_SUBTITLE6'] = $myInstClass->translate("Checking System Permission");
$arrTemplate['STEP1_TEXT3_1'] = $myInstClass->translate("The following modules/extensions are <em>required</em> to run NagiosQL");
$arrTemplate['STEP1_TEXT3_2'] = $myInstClass->translate("The next couple of extensions are <em>optional</em> but recommended");
$arrTemplate['STEP1_TEXT4_1'] = $myInstClass->translate("Check which of the supported extensions are installed. At least one of them is required.");
$arrTemplate['STEP1_TEXT5_1'] = $myInstClass->translate("The following settings are <em>required</em> to run NagiosQL");
//
// Conditional checks
// =======================
@ -104,19 +106,21 @@ $strHTMLPart7 = "<img src=\"images/onlinehelp.png\" alt=\"online help\" title=\"
// Javascript check
if ($_SESSION['install']['jscript'] == "yes") {
$arrTemplate['CHECK_1_PIC'] = "valid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = translate("ENABLED");
$arrTemplate['CHECK_1_PIC'] = "valid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = $myInstClass->translate("ENABLED");
$arrTemplate['CHECK_1_INFO'] = "";
} else {
$arrTemplate['CHECK_1_PIC'] = "invalid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = translate("NOT ENABLED");
$arrTemplate['CHECK_1_PIC'] = "invalid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = $myInstClass->translate("NOT ENABLED");
$arrTemplate['CHECK_1_INFO'] = "(".$myInstClass->translate("After enabling Javascript, the page must be updated twice so that the status changes").")";
}
// PHP version check
define('MIN_PHP_VERSION', '5.2.0');
$arrTemplate['CHECK_2_TEXT'] = translate("Version");
$arrTemplate['CHECK_2_TEXT'] = $myInstClass->translate("Version");
if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
$arrTemplate['CHECK_2_PIC'] = "valid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = translate("OK");
$arrTemplate['CHECK_2_INFO'] = "(PHP ". PHP_VERSION ." ".translate("detected").")";
$arrTemplate['CHECK_2_PIC'] = "valid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = $myInstClass->translate("OK");
$arrTemplate['CHECK_2_INFO'] = "(PHP ". PHP_VERSION ." ".$myInstClass->translate("detected").")";
} else {
$arrTemplate['CHECK_2_PIC'] = "invalid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = "PHP ". PHP_VERSION ." ".translate("detected");
$arrTemplate['CHECK_2_INFO'] = "(PHP ". MIN_PHP_VERSION ." ".translate("or greater is required").")";
$arrTemplate['CHECK_2_PIC'] = "invalid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = "PHP ". PHP_VERSION ." ".$myInstClass->translate("detected");
$arrTemplate['CHECK_2_INFO'] = "(PHP ". MIN_PHP_VERSION ." ".$myInstClass->translate("or greater is required").")";
$intError = 1;
}
// PHP modules / extensions
@ -125,11 +129,11 @@ $strPrefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
$strHTML = "";
foreach ($arrRequiredExt as $key => $elem) {
if (extension_loaded($elem)) {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."</span>\n";
} else {
$strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX;
$strMsg = @is_readable($strPath) ? translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
$strMsg = @is_readable($strPath) ? $myInstClass->translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
$intError = 1;
}
$strHTML .= "<br>\n";
@ -138,11 +142,11 @@ $arrTemplate['CHECK_3_CONTENT_1'] = $strHTML;
$strHTML = "";
foreach ($arrOptionalExt as $key => $elem) {
if (extension_loaded($elem)) {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."</span>\n";
} else {
$strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX;
$strMsg = @is_readable($strPath) ? translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart3.$key.$strHTMLPart6.translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
$strMsg = @is_readable($strPath) ? $myInstClass->translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart3.$key.$strHTMLPart6.$myInstClass->translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
//$intError = 1;
}
$strHTML .= "<br>\n";
@ -151,16 +155,22 @@ $arrTemplate['CHECK_3_CONTENT_2'] = $strHTML;
// PHP database interfaces
$strHTML = "";
$intTemp = 0;
$_SESSION['install']['dbtype_available'] = array();
foreach ($arrSupportedDBs as $key => $elem) {
if (extension_loaded($elem)) {
$strNewInstallOnly = "";
if (($_SESSION['install']['dbtype'] != $elem) && ($_SESSION['install']['mode'] == "Update")) $strNewInstallOnly = " (".translate("New installation only - updates are only supported using the same database interface!").")";
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span> $strNewInstallOnly\n";
if (isset($_SESSION['install']['dbtype']) && ($_SESSION['install']['mode'] == "Update")) {
if (($_SESSION['install']['dbtype'] != $elem) && (substr($_SESSION['install']['dbtype'],0,5) != substr($elem,0,5))) {
$strNewInstallOnly = " (".$myInstClass->translate("New installation only - updates are only supported using the same database interface!").")";
}
}
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."</span> $strNewInstallOnly\n";
if ($strNewInstallOnly == "") $_SESSION['install']['dbtype_available'][] = $elem;
$intTemp++;
} else {
$strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX;
$strMsg = @is_readable($strPath) ? translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
$strMsg = @is_readable($strPath) ? $myInstClass->translate("Could be loaded. Please add in php.ini") : "<a href=\"".$arrSourceURLs[$key]."\" target=\"_blank\">".$strHTMLPart7."</a>";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate("NOT AVAILABLE")." (".$strMsg.")</span>\n";
}
$strHTML .= "<br>\n";
}
@ -172,16 +182,16 @@ foreach ($arrIniCheck as $key => $elem) {
$strStatus = ini_get($key);
if ($elem === '-NOTEMPTY-') {
if (empty($strStatus)) {
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.translate("NOT AVAILABLE")." (".translate("cannot be empty and needs to be set").")</span>\n";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate("NOT AVAILABLE")." (".$myInstClass->translate("cannot be empty and needs to be set").")</span>\n";
$intError = 1;
} else {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."</span>\n";
}
} else {
if ($strStatus == $elem) {
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.translate("OK")."</span>\n";
$strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."</span>\n";
} else {
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$status." (".translate("should be")." ".$elem.")</span>\n";
$strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$status." (".$myInstClass->translate("should be")." ".$elem.")</span>\n";
$intError = 1;
}
}
@ -191,77 +201,79 @@ $arrTemplate['CHECK_5_CONTENT_1'] = $strHTML;
// File access checks
$strConfigFile = "../config/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";
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart1.$myInstClass->translate("Read test on settings file (config/settings.php)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else if (file_exists($strConfigFile)&& !is_readable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart2.translate("Read test on settings file (config/settings.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart2.$myInstClass->translate("Read test on settings file (config/settings.php)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
} elseif (!file_exists($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart3.translate("Settings file does not exists (config/settings.php)").$strHTMLPart6.translate("will be created")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart3.$myInstClass->translate("Settings file does not exists (config/settings.php)").$strHTMLPart6.$myInstClass->translate("will be created")."</span><br>\n";
}
if(file_exists($strConfigFile) && is_writable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.translate("Write test on settings file (config/settings.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.$myInstClass->translate("Write test on settings file (config/settings.php)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else if (is_writable("../config") && !file_exists($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.translate("Write test on settings directory (config/)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.$myInstClass->translate("Write test on settings directory (config/)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else if (file_exists($strConfigFile) && !is_writable($strConfigFile)) {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.translate("Write test on settings file (config/settings.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.$myInstClass->translate("Write test on settings file (config/settings.php)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
} else {
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.translate("Write test on settings directory (config/)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.$myInstClass->translate("Write test on settings directory (config/)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
}
$strClassFile = "../functions/nag_class.php";
if(file_exists($strClassFile) && is_readable($strClassFile)) {
$arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart1.translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart1.$myInstClass->translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart2.translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart2.$myInstClass->translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../admin.php";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart1.translate("Read test on startsite file (admin.php)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart1.$myInstClass->translate("Read test on startsite file (admin.php)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart2.translate("Read test on startsite file (admin.php)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart2.$myInstClass->translate("Read test on startsite file (admin.php)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../templates/index.tpl.htm";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart1.translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart1.$myInstClass->translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart2.translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart2.$myInstClass->translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../templates/admin/admin_master.tpl.htm";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart1.translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart1.$myInstClass->translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart2.translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart2.$myInstClass->translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../templates/files/contacts.tpl.dat";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart1.translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart1.$myInstClass->translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart2.translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart2.$myInstClass->translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
}
$strFile = "../images/pixel.gif";
if(file_exists($strFile) && is_readable($strFile)) {
$arrTemplate['CHECK_6_CONTENT_8'] = $strHTMLPart1.translate("Read test on a image file (images/pixel.gif)").$strHTMLPart4.translate("OK")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_8'] = $strHTMLPart1.$myInstClass->translate("Read test on a image file (images/pixel.gif)").$strHTMLPart4.$myInstClass->translate("OK")."</span><br>\n";
} else {
$arrTemplate['CHECK_6_CONTENT_9'] = $strHTMLPart2.translate("Read test on a image file (images/pixel.gif)").$strHTMLPart5.translate("failed")."</span><br>\n";
$arrTemplate['CHECK_6_CONTENT_9'] = $strHTMLPart2.$myInstClass->translate("Read test on a image file (images/pixel.gif)").$strHTMLPart5.$myInstClass->translate("failed")."</span><br>\n";
$intError = 1;
}
if ($intError != 0) {
$arrTemplate['MESSAGE'] = "<span class=\"red\">".translate("There are some errors - please check your system settings and read the requirements of NagiosQL!")."</span><br><br>\n";
$arrTemplate['MESSAGE'] .= translate("Read the INSTALLATION file from NagiosQL to find out, how to fix them.") ."<br>\n";
$arrTemplate['MESSAGE'] .= translate("After that - refresh this page to proceed") ."...<br>\n";
$arrTemplate['MESSAGE'] = "<span class=\"red\">".$myInstClass->translate("There are some errors - please check your system settings and read the requirements of NagiosQL!")."</span><br><br>\n";
$arrTemplate['MESSAGE'] .= $myInstClass->translate("Read the INSTALLATION file in the NagiosQL doc directory or the installation PDF file on our");
$arrTemplate['MESSAGE'] .= " <a href=\"http://www.nagiosql.org/documentation.html\" target=\"_blank\">";
$arrTemplate['MESSAGE'] .= $myInstClass->translate("online documentation")."</a><br>".$myInstClass->translate("site to find out, how to fix them.") ."<br>\n";
$arrTemplate['MESSAGE'] .= $myInstClass->translate("After that - refresh this page to proceed") ."...<br>\n";
$arrTemplate['DIV_ID'] = "install-center";
$arrTemplate['FORM_CONTENT'] = "<input type=\"image\" src=\"images/reload.png\" title=\"refresh\" value=\"Submit\" alt=\"refresh\" onClick=\"window.location.reload()\"><br>";
$arrTemplate['FORM_CONTENT'] .= translate("Refresh")."\n";
$arrTemplate['FORM_CONTENT'] .= $myInstClass->translate("Refresh")."\n";
} else {
$arrTemplate['MESSAGE'] = "<span class=\"green\">".translate("Environment test sucessfully passed")."</span><br><br>\n";
$arrTemplate['MESSAGE'] = "<span class=\"green\">".$myInstClass->translate("Environment test sucessfully passed")."</span><br><br>\n";
$arrTemplate['DIV_ID'] = "install-next";
$arrTemplate['FORM_CONTENT'] = "<input type=\"hidden\" name=\"hidStep\" id=\"hidStep\" value=\"2\">\n";
$arrTemplate['FORM_CONTENT'] .= "<input type=\"image\" src=\"images/next.png\" value=\"Submit\" title=\"next\" alt=\"next\"><br>".translate("Next")."\n";
$arrTemplate['FORM_CONTENT'] .= "<input type=\"image\" src=\"images/next.png\" value=\"Submit\" title=\"next\" alt=\"next\"><br>".$myInstClass->translate("Next")."\n";
}
//
// Write content

View File

@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - step 2
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-23 11:44:55 +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: 1239 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@ -30,56 +30,66 @@ $intError = 0;
//
// Build content
// =============
$arrTemplate['PASSWD_MESSAGE'] = translate('The NagiosQL first passwords are not equal!');
$arrTemplate['FIELDS_MESSAGE'] = translate('Please fill in all fields marked with an *');
$arrTemplate['STEP1_BOX'] = translate('Requirements');
$arrTemplate['STEP2_BOX'] = translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = translate('Finish');
$arrTemplate['STEP2_TITLE'] = "NagiosQL ".translate($_SESSION['install']['mode']).": ".translate("Setup");
$arrTemplate['STEP2_TEXT1_1'] = translate("Please complete the form below. Mandatory fields marked <em>*</em>");
$arrTemplate['STEP2_TEXT2_1'] = translate("Database Configuration");
$arrTemplate['STEP2_TEXT2_2'] = translate("Database Type");
$arrTemplate['STEP2_VALUE2_2'] = htmlspecialchars($_SESSION['install']['dbtype'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_3'] = translate("Database Server");
$arrTemplate['PASSWD_MESSAGE'] = $myInstClass->translate('The NagiosQL first passwords are not equal!');
$arrTemplate['FIELDS_MESSAGE'] = $myInstClass->translate('Please fill in all fields marked with an *');
$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements');
$arrTemplate['STEP2_BOX'] = $myInstClass->translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish');
$arrTemplate['STEP2_TITLE'] = "NagiosQL ".$myInstClass->translate($_SESSION['install']['mode']).": ".$myInstClass->translate("Setup");
$arrTemplate['STEP2_TEXT1_1'] = $myInstClass->translate("Please complete the form below. Mandatory fields marked <em>*</em>");
$arrTemplate['STEP2_TEXT2_1'] = $myInstClass->translate("Database Configuration");
$arrTemplate['STEP2_TEXT2_2'] = $myInstClass->translate("Database Type");
if (is_array($_SESSION['install']['dbtype_available']) && (count($_SESSION['install']['dbtype_available']) != 0)) {
$strDBType = "";
foreach ($_SESSION['install']['dbtype_available'] AS $elem) {
$strSelected = "";
if (isset($_SESSION['install']['dbtype']) && ($_SESSION['install']['dbtype'] == $elem)) $strSelected = "selected=\"selected\"";
$strDBType .= "<option value=\"".$elem."\" $strSelected>".$elem."</option>\n";
}
} else {
$strDBType .= "<option value=\"mysql\" $strSelected>mysql</option>\n";
}
$arrTemplate['STEP2_VALUE2_2'] = $strDBType;
$arrTemplate['STEP2_TEXT2_3'] = $myInstClass->translate("Database Server");
$arrTemplate['STEP2_VALUE2_3'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_4'] = translate("Local hostname or IP address");
$arrTemplate['STEP2_TEXT2_4'] = $myInstClass->translate("Local hostname or IP address");
if (htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8') == "localhost") {
$arrTemplate['STEP2_VALUE2_4'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8');
}else {
$arrTemplate['STEP2_VALUE2_4'] = $_SERVER['SERVER_ADDR'];
}
$arrTemplate['STEP2_TEXT2_5'] = translate("Database Server Port");
$arrTemplate['STEP2_TEXT2_5'] = $myInstClass->translate("Database Server Port");
$arrTemplate['STEP2_VALUE2_5'] = htmlspecialchars($_SESSION['install']['dbport'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_6'] = translate("Database name");
$arrTemplate['STEP2_TEXT2_6'] = $myInstClass->translate("Database name");
$arrTemplate['STEP2_VALUE2_6'] = htmlspecialchars($_SESSION['install']['dbname'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_7'] = translate("NagiosQL DB User");
$arrTemplate['STEP2_TEXT2_7'] = $myInstClass->translate("NagiosQL DB User");
$arrTemplate['STEP2_VALUE2_7'] = htmlspecialchars($_SESSION['install']['dbuser'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_8'] = translate("NagiosQL DB Password");
$arrTemplate['STEP2_TEXT2_8'] = $myInstClass->translate("NagiosQL DB Password");
$arrTemplate['STEP2_VALUE2_8'] = htmlspecialchars($_SESSION['install']['dbpass'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_9'] = translate("Administrative Database User");
$arrTemplate['STEP2_TEXT2_9'] = $myInstClass->translate("Administrative Database User");
$arrTemplate['STEP2_VALUE2_9'] = htmlspecialchars($_SESSION['install']['admuser'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT2_10'] = translate("Administrative Database Password");
$arrTemplate['STEP2_TEXT2_11'] = translate("Drop database if already exists?");
$arrTemplate['STEP2_TEXT2_10'] = $myInstClass->translate("Administrative Database Password");
$arrTemplate['STEP2_TEXT2_11'] = $myInstClass->translate("Drop database if already exists?");
if ($_SESSION['install']['dbdrop'] == 1) {$arrTemplate['STEP2_VALUE2_11'] = "checked";} else {$arrTemplate['STEP2_VALUE2_11'] = "";}
$arrTemplate['STEP2_TEXT3_1'] = translate("NagiosQL User Setup");
$arrTemplate['STEP2_TEXT3_2'] = translate("Initial NagiosQL User");
$arrTemplate['STEP2_TEXT3_1'] = $myInstClass->translate("NagiosQL User Setup");
$arrTemplate['STEP2_TEXT3_2'] = $myInstClass->translate("Initial NagiosQL User");
$arrTemplate['STEP2_VALUE3_2'] = htmlspecialchars($_SESSION['install']['qluser'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT3_3'] = translate("Initial NagiosQL Password");
$arrTemplate['STEP2_TEXT3_3'] = $myInstClass->translate("Initial NagiosQL Password");
$arrTemplate['STEP2_VALUE3_3'] = htmlspecialchars($_SESSION['install']['qlpass'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT3_4'] = translate("Please repeat the password");
$arrTemplate['STEP2_TEXT4_1'] = translate("Nagios Configuration");
$arrTemplate['STEP2_TEXT4_2'] = translate("Import Nagios sample config?");
$arrTemplate['STEP2_TEXT3_4'] = $myInstClass->translate("Please repeat the password");
$arrTemplate['STEP2_TEXT4_1'] = $myInstClass->translate("Nagios Configuration");
$arrTemplate['STEP2_TEXT4_2'] = $myInstClass->translate("Import Nagios sample config?");
if ($_SESSION['install']['sample'] == 1) {$arrTemplate['STEP2_VALUE4_2'] = "checked";} else {$arrTemplate['STEP2_VALUE4_2'] = "";}
$arrTemplate['STEP2_FORM_1'] = translate("Next");
$arrTemplate['STEP2_TEXT5_1'] = translate("NagiosQL path values");
$arrTemplate['STEP2_TEXT5_2'] = translate("Create NagiosQL config paths?");
$arrTemplate['STEP2_FORM_1'] = $myInstClass->translate("Next");
$arrTemplate['STEP2_TEXT5_1'] = $myInstClass->translate("NagiosQL path values");
$arrTemplate['STEP2_TEXT5_2'] = $myInstClass->translate("Create NagiosQL config paths?");
if ($_SESSION['install']['createpath'] == 1) {$arrTemplate['STEP2_VALUE5_2'] = "checked";} else {$arrTemplate['STEP2_VALUE5_2'] = "";}
$arrTemplate['STEP2_TEXT5_3'] = translate("NagiosQL config path");
$arrTemplate['STEP2_TEXT5_3'] = $myInstClass->translate("NagiosQL config path");
$arrTemplate['STEP2_VALUE5_3'] = htmlspecialchars($_SESSION['install']['qlpath'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT5_4'] = translate("Nagios config path");
$arrTemplate['STEP2_TEXT5_4'] = $myInstClass->translate("Nagios config path");
$arrTemplate['STEP2_VALUE5_4'] = htmlspecialchars($_SESSION['install']['nagpath'], ENT_QUOTES, 'utf-8');
$arrTemplate['STEP2_TEXT5_5'] = translate("Both path values were stored in your configuration target settings for localhost.");
$arrTemplate['STEP2_TEXT5_6'] = translate("If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)");
$arrTemplate['STEP2_TEXT5_5'] = $myInstClass->translate("Both path values were stored in your configuration target settings for localhost.");
$arrTemplate['STEP2_TEXT5_6'] = $myInstClass->translate("If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)");
$arrTemplate['INSTALL_FIELDS'] = "";
//
@ -91,7 +101,7 @@ $arrTemplate['STEP2_TEXT1_2'] = "";
// Conditional checks
// =======================
if ($_SESSION['install']['mode'] == "Update") {
$arrTemplate['STEP2_TEXT1_2'] = "<p style=\"color:red;\"><b>".translate("Please backup your database before proceeding!")."</b></p>\n";
$arrTemplate['STEP2_TEXT1_2'] = "<p style=\"color:red;\"><b>".$myInstClass->translate("Please backup your database before proceeding!")."</b></p>\n";
$arrTemplate['INST_VISIBLE'] = "hidefield";
} else {
$arrTemplate['INSTALL_FIELDS'] = ",tfDBprivUser,tfDBprivPass,tfQLuser,tfQLpass";

View File

@ -5,15 +5,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installer script - step 2
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-02-23 11:44:55 +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: 1239 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@ -34,27 +34,28 @@ if(function_exists("date_default_timezone_set") and function_exists("date_defaul
//
// Build content
// =============
$arrTemplate['STEP1_BOX'] = translate('Requirements');
$arrTemplate['STEP2_BOX'] = translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = translate('Finish');
$arrTemplate['STEP3_TITLE'] = "NagiosQL ".translate($_SESSION['install']['mode']).": ".translate("Finishing Setup");
$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements');
$arrTemplate['STEP2_BOX'] = $myInstClass->translate($_SESSION['install']['mode']);
$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish');
$arrTemplate['STEP3_TITLE'] = "NagiosQL ".$myInstClass->translate($_SESSION['install']['mode']).": ".$myInstClass->translate("Finishing Setup");
$arrTemplate['INST_VISIBLE'] = "showfield";
$arrTemplate['STEP4_SUB_TITLE'] = translate("Deploy NagiosQL settings");
$arrTemplate['STEP3_TEXT_01'] = translate("Database server connection (privileged user)");
$arrTemplate['STEP3_TEXT_03'] = translate("Database server version");
$arrTemplate['STEP3_TEXT_05'] = translate("Database server support");
$arrTemplate['STEP3_TEXT_07'] = translate("Delete existing NagiosQL database");
$arrTemplate['STEP3_TEXT_09'] = translate("Creating new database");
$arrTemplate['STEP3_TEXT_11'] = translate("Create NagiosQL database user");
$arrTemplate['STEP3_TEXT_13'] = translate("Installing NagiosQL database tables");
$arrTemplate['STEP3_TEXT_15'] = translate("Set initial NagiosQL Administrator");
$arrTemplate['STEP3_TEXT_17'] = translate("Database server connection (NagiosQL user)");
$arrTemplate['STEP4_TEXT_01'] = translate("Writing global settings to database");
$arrTemplate['STEP4_TEXT_03'] = translate("Writing database configuration to settings.php");
$arrTemplate['STEP4_TEXT_05'] = translate("Import Nagios sample data");
$arrTemplate['STEP4_TEXT_07'] = translate("Create and/or store NagiosQL path settings");
$arrTemplate['STEP4_SUB_TITLE'] = $myInstClass->translate("Deploy NagiosQL settings");
$arrTemplate['STEP3_TEXT_01'] = $myInstClass->translate("Database server connection (privileged user)");
$arrTemplate['STEP3_TEXT_03'] = $myInstClass->translate("Database server version");
$arrTemplate['STEP3_TEXT_05'] = $myInstClass->translate("Database server support");
$arrTemplate['STEP3_TEXT_07'] = $myInstClass->translate("Delete existing NagiosQL database");
$arrTemplate['STEP3_TEXT_09'] = $myInstClass->translate("Creating new database");
$arrTemplate['STEP3_TEXT_11'] = $myInstClass->translate("Installing NagiosQL database tables");
$arrTemplate['STEP3_TEXT_13'] = $myInstClass->translate("Create NagiosQL database user");
$arrTemplate['STEP3_TEXT_15'] = $myInstClass->translate("Set initial NagiosQL Administrator");
$arrTemplate['STEP3_TEXT_17'] = $myInstClass->translate("Database server connection (NagiosQL user)");
$arrTemplate['STEP4_TEXT_01'] = $myInstClass->translate("Writing global settings to database");
$arrTemplate['STEP4_TEXT_03'] = $myInstClass->translate("Writing database configuration to settings.php");
$arrTemplate['STEP4_TEXT_05'] = $myInstClass->translate("Import Nagios sample data");
$arrTemplate['STEP4_TEXT_07'] = $myInstClass->translate("Create and/or store NagiosQL path settings");
$arrTemplate['STEP4_VISIBLE'] = "hidefield";
$arrTemplate['STEP3_TEXT_02_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_03_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_05_SHOW'] = "hidefield";
$arrTemplate['STEP3_TEXT_07_SHOW'] = "hidefield";
@ -67,83 +68,144 @@ $arrTemplate['STEP4_TEXT_03_SHOW'] = "hidefield";
$arrTemplate['STEP4_TEXT_05_SHOW'] = "hidefield";
$arrTemplate['STEP4_TEXT_07_SHOW'] = "hidefield";
//
// Check any data before installation
// ==================================
$intInstError = 0;
//
// Doing installation/upgrade
// ==========================
if ($_SESSION['install']['mode'] == "Update") {
$arrTemplate['STEP3_SUB_TITLE'] = translate("Updating existing NagiosQL database");
if ($_SESSION['install']['dbtype'] == "mysql") {
// Check database connection
if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
// Check NagiosQL version
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_03'] = translate("Installed NagiosQL version");
$arrTemplate['STEP3_TEXT_03_SHOW'] = "showfield";
$intError = $myInstClass->checkQLVersion($arrTemplate['STEP3_TEXT_04'],$strErrorMessage,$arrUpdate,$setQLVersion);
}
// Upgrade NagiosQL DB
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_05'] = translate("Upgrading from version")." ".$setQLVersion." ".translate("to")." ".$preNagiosQL_ver;
$arrTemplate['STEP3_TEXT_05_SHOW'] = "showfield";
$intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_06'],$strErrorMessage,$arrUpdate);
}
$arrTemplate['STEP3_SUB_TITLE'] = $myInstClass->translate("Updating existing NagiosQL database");
//
// Include database class
// ======================
if ($_SESSION['install']['dbtype'] == "mysqli") {
// Include and initialize mysqli class
include("../functions/mysqli_class.php");
$myDBClass = new mysqlidb;
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
// Include and initialize pgsql class
include("../functions/pgsql_class.php");
$myDBClass = new pgsqldb;
} else {
$strErrorMessage .= $myInstClass->translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".$myInstClass->translate("failed")."</span>";
$intError = 1;
}
// Set DB parameters
$myDBClass->arrParams['server'] = $_SESSION['install']['dbserver'];
$myDBClass->arrParams['port'] = $_SESSION['install']['dbport'];
$myDBClass->arrParams['username'] = $_SESSION['install']['admuser'];
$myDBClass->arrParams['password'] = $_SESSION['install']['admpass'];
$myDBClass->arrParams['database'] = $_SESSION['install']['dbname'];
// Include classes
if ($intError == 0) $myInstClass->myDBClass =& $myDBClass;
// Check database connection
if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
$arrTemplate['STEP3_TEXT_02_SHOW'] = "showfield";
// Check NagiosQL version
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_03'] = $myInstClass->translate("Installed NagiosQL version");
$arrTemplate['STEP3_TEXT_03_SHOW'] = "showfield";
$intError = $myInstClass->checkQLVersion($arrTemplate['STEP3_TEXT_04'],$strErrorMessage,$arrUpdate,$setQLVersion);
}
// Upgrade NagiosQL DB
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_05'] = $myInstClass->translate("Upgrading from version")." ".$setQLVersion." ".$myInstClass->translate("to")." ".$preNagiosQL_ver;
$arrTemplate['STEP3_TEXT_05_SHOW'] = "showfield";
$intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_06'],$strErrorMessage,$arrUpdate);
}
if (($_SESSION['install']['dbtype'] == "mysql") && (version_compare($setQLVersion,"3.2.0") == -1)) {
// Converting database to UTF8
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_07'] = translate("Converting database to utf8 character set");
$arrTemplate['STEP3_TEXT_07'] = $myInstClass->translate("Converting database to utf8 character set");
$arrTemplate['STEP3_TEXT_07_SHOW'] = "showfield";
$intError = $myInstClass->convQLDB($arrTemplate['STEP3_TEXT_08'],$strErrorMessage);
}
// Converting database tables to UTF8
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_09'] = translate("Converting database tables to utf8 character set");
$arrTemplate['STEP3_TEXT_09'] = $myInstClass->translate("Converting database tables to utf8 character set");
$arrTemplate['STEP3_TEXT_09_SHOW'] = "showfield";
$intError = $myInstClass->convQLDBTables($arrTemplate['STEP3_TEXT_10'],$strErrorMessage);
}
// Converting database fields to UTF8
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_11'] = translate("Converting database fields to utf8 character set");
$arrTemplate['STEP3_TEXT_11'] = $myInstClass->translate("Converting database fields to utf8 character set");
$arrTemplate['STEP3_TEXT_11_SHOW'] = "showfield";
$intError = $myInstClass->convQLDBFields($arrTemplate['STEP3_TEXT_12'],$strErrorMessage);
}
// Reconnect Database with new user
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_17_SHOW'] = "showfield";
$intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
$intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
}
// Deploy NagiosQL database settings
if ($intError == 0) {
$arrTemplate['STEP4_VISIBLE'] = "showfield";
$intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'],$strErrorMessage);
}
// Write database settings to file
if ($intError == 0) {
$arrTemplate['STEP4_TEXT_03_SHOW'] = "showfield";
$intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'],$strErrorMessage);
}
}
// Reconnect Database with new user
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_17_SHOW'] = "showfield";
$intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
$intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
}
// Deploy NagiosQL database settings
if ($intError == 0) {
$arrTemplate['STEP4_VISIBLE'] = "showfield";
$intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'],$strErrorMessage);
}
// Write database settings to file
if ($intError == 0) {
$arrTemplate['STEP4_TEXT_03_SHOW'] = "showfield";
$intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'],$strErrorMessage);
}
} else {
$arrTemplate['STEP3_SUB_TITLE'] = translate("Create new NagiosQL database");
$arrTemplate['STEP3_SUB_TITLE'] = $myInstClass->translate("Create new NagiosQL database");
//
// Include database class
// ======================
if ($_SESSION['install']['dbtype'] == "mysqli") {
// Include and initialize mysqli class
include("../functions/mysqli_class.php");
$myDBClass = new mysqlidb;
} else if ($_SESSION['install']['dbtype'] == "pgsql") {
// Include and initialize pgsql class
include("../functions/pgsql_class.php");
$myDBClass = new pgsqldb;
//} else if ($_SESSION['install']['dbtype'] == "sqlite3") {
// // Include sqlite3 and initialize class
// include("../functions/sqlite3_class.php");
// $myDBClass = new sqlite3db;
} else {
$strErrorMessage .= $myInstClass->translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")<br>\n";
$strStatusMessage = "<span class=\"red\">".$myInstClass->translate("failed")."</span>";
$intError = 1;
}
// Set DB parameters
$myDBClass->arrParams['server'] = $_SESSION['install']['dbserver'];
$myDBClass->arrParams['port'] = $_SESSION['install']['dbport'];
$myDBClass->arrParams['username'] = $_SESSION['install']['admuser'];
$myDBClass->arrParams['password'] = $_SESSION['install']['admpass'];
$myDBClass->arrParams['database'] = $_SESSION['install']['dbname'];
// Include classes
if ($intError == 0) $myInstClass->myDBClass =& $myDBClass;
// Check database connection
$intOldDBStatus = 0;
if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
// Does the database already exist?
if ($intError == 0) {
$intOldDBStatus = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
$intOldDBStatus = $myInstClass->openDatabase($strTmpMessage,$strTmpError);
$myDBClass->strErrorMessage = "";
if (($intOldDBStatus == 0) && ($_SESSION['install']['dbdrop'] == 0)) {
$strErrorMessage .= translate("Database already exists and drop database was not selected, please correct or manage manually")."<br>";
$arrTemplate['STEP3_TEXT_02'] = "<span class=\"red\">".translate("failed")."</span>";
$intError = 1;
$strErrorMessage .= $myInstClass->translate("Database already exists and drop database was not selected, please correct or manage manually")."<br>";
$arrTemplate['STEP3_TEXT_02'] = "<span class=\"red\">".$myInstClass->translate("failed")."</span>";
$intError = 1;
} else {
$arrTemplate['STEP3_TEXT_02'] = "<span class=\"green\">".translate("passed")."</span>";
$myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
}
}
$arrTemplate['STEP3_TEXT_02_SHOW'] = "showfield";
$arrTemplate['STEP3_TEXT_02'] .= " (".$_SESSION['install']['dbtype'].")";
// Check database version
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_03_SHOW'] = "showfield";
$arrTemplate['STEP3_TEXT_05_SHOW'] = "showfield";
$intError = $myInstClass->checkDBVersion($arrTemplate['STEP3_TEXT_06'],$strErrorMessage,$strVersion);
if ($strVersion == "unknown") {
$arrTemplate['STEP3_TEXT_04'] = "<span class=\"red\">".translate("unknown")."</span>";
$arrTemplate['STEP3_TEXT_04'] = "<span class=\"red\">".$myInstClass->translate("unknown")."</span>";
} else {
$arrTemplate['STEP3_TEXT_04'] = "<span class=\"green\">".$strVersion."</span>";
}
@ -157,18 +219,19 @@ if ($_SESSION['install']['mode'] == "Update") {
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_09_SHOW'] = "showfield";
$intError = $myInstClass->createDB($arrTemplate['STEP3_TEXT_10'],$strErrorMessage);
echo $strErrorMessage;
}
// Write initial SQL data to database
if ($intError == 0) $intError = $myInstClass->openDatabase($strTmp,$strErrorMessage);
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_11_SHOW'] = "showfield";
$arrInsert[] = $preSqlNewInstall;
$intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_12'],$strErrorMessage,$arrInsert);
}
// Grant NagiosQL database user
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_11_SHOW'] = "showfield";
$intError = $myInstClass->grantDBUser($arrTemplate['STEP3_TEXT_12'],$strErrorMessage);
}
// Write initial SQL data to database
if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage);
if ($intError == 0) {
$arrTemplate['STEP3_TEXT_13_SHOW'] = "showfield";
$arrInsert[] = $preSqlNewInstall;
$intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_14'],$strErrorMessage,$arrInsert);
$intError = $myInstClass->grantDBUser($arrTemplate['STEP3_TEXT_14'],$strErrorMessage);
}
// Create NagiosQL admin user
if ($intError == 0) {
@ -177,6 +240,8 @@ if ($_SESSION['install']['mode'] == "Update") {
}
// Reconnect Database with new user
if ($intError == 0) {
$myDBClass->arrParams['username'] = $_SESSION['install']['dbuser'];
$myDBClass->arrParams['password'] = $_SESSION['install']['dbpass'];
$arrTemplate['STEP3_TEXT_17_SHOW'] = "showfield";
if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1);
@ -208,14 +273,14 @@ if ($intError != 0) {
$arrTemplate['INFO_TEXT'] = "";
$arrTemplate['BUTTON'] = "<div id=\"install-back\">\n";
$arrTemplate['BUTTON'] .= "<input type='hidden' name='hidStep' id='hidStep' value='2' />\n";
$arrTemplate['BUTTON'] .= "<input type='image' src='images/previous.png' value='Submit' alt='Submit' /><br />".translate("Back")."\n";
$arrTemplate['BUTTON'] .= "<input type='image' src='images/previous.png' value='Submit' alt='Submit' /><br />".$myInstClass->translate("Back")."\n";
$arrTemplate['BUTTON'] .= "</div>\n";
} else {
$arrTemplate['ERRORMESSAGE'] = "";
$arrTemplate['INST_VISIBLE'] = "showfield";
$arrTemplate['INFO_TEXT'] = translate("Please delete the install directory to continue!");
$arrTemplate['INFO_TEXT'] = $myInstClass->translate("Please delete the install directory to continue!");
$arrTemplate['BUTTON'] = "<div id=\"install-next\">\n";
$arrTemplate['BUTTON'] .= "<a href='../index.php'><img src='images/next.png' alt='finish' title='finish' border='0' /></a><br />".translate("Finish")."\n";
$arrTemplate['BUTTON'] .= "<a href='../index.php'><img src='images/next.png' alt='finish' title='finish' border='0' /></a><br />".$myInstClass->translate("Finish")."\n";
$arrTemplate['BUTTON'] .= "</div>\n";
}
//

17
install/templates/index.tpl.htm Executable file → Normal file
View File

@ -1,12 +1,12 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- (c) 2005-2017 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer main template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<!-- Version : 3.3.0 -->
<!-- Revision : $LastChangedRevision: 2 $ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
@ -22,7 +22,7 @@
<a href="index.php"><img src="images/nagiosql.png" border="0" alt="NagiosQL"></a>
</div>
<div id="documentation">
<a href='http://www.nagiosql.org/faq/' target='_blank'>{NAGIOS_FAQ}</a>
<a href='http://www.nagiosql.org/documentation.html' target='_blank'>{NAGIOS_FAQ}</a>
</div>
<div id="langselector">
<form action="" name="frmLanguage" id="frmLanguage" method="post">
@ -38,6 +38,7 @@
<div id="indexmain_content">
<h1>{MAIN_TITLE}</h1>
<center>{TEXT_PART_1}<br>{TEXT_PART_2}<a href="http://www.nagiosql.org" target="_blank">www.nagiosql.org</a></center>
<p><center><b>{TEXT_PART_9}</b></center></p>
<br>
<p>{TEXT_PART_3}</p>
<p>{TEXT_PART_4}</p>
@ -47,12 +48,8 @@
<li>{TEXT_PHP_REQ_1}</li>
<li>{TEXT_PHP_REQ_2}</li>
<li>{TEXT_PHP_REQ_3}</li>
<!--<li>{TEXT_PHP_REQ_4}</li>-->
<!--<li>{TEXT_PHP_REQ_5}</li>-->
<li>{TEXT_PHP_REQ_6}</li>
<!--<li>{TEXT_PHP_REQ_7}</li>-->
<li>{TEXT_PHP_REQ_8}</li>
<li>{TEXT_PHP_REQ_9}</li>
<li>{TEXT_PHP_REQ_10}</li>
</ul>
</ul>
@ -74,7 +71,7 @@
<input type="hidden" name="hidJScript" value="">
<p><input type="submit" name="butNewInstall" id="butNewInstall" value="{NEW_INSTALLATION}" {DISABLE_NEW}>
<input type="submit" name="butUpgrade" id="butUpgrade" value="{UPDATE}" {DISABLE_UPDATE}></p>
<p><a href='http://www.nagiosql.org/faq.html' target='_blank'>{ONLINE_DOC}</a></p>
<p><a href='http://www.nagiosql.org/documentation.html' target='_blank'>{ONLINE_DOC}</a></p>
</form>
</div>
</div>

8
install/templates/install.tpl.htm Executable file → Normal file
View File

@ -1,12 +1,12 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- (c) 2005-2017 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<!-- Version : 3.3.0 -->
<!-- Revision : $LastChangedRevision: 2 $ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

16
install/templates/step1.tpl.htm Executable file → Normal file
View File

@ -1,12 +1,12 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- (c) 2005-2017 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<!-- Version : 3.3.0 -->
<!-- Revision : $LastChangedRevision: 2 $ -->
<div id="installmenu">
<div id="installmenu_content">
<p class="step1_active"><br><br>{STEP1_BOX}</p>
@ -18,7 +18,7 @@
<div id="installmain_content">
<h1>{STEP1_TITLE}</h1>
<h3>{STEP1_SUBTITLE1}</h3>
<img src='images/{CHECK_1_PIC}.png' alt='{CHECK_1_PIC}' title='{CHECK_1_PIC}' class='textmiddle'> Javascript: <span class='{CHECK_1_CLASS}'>{CHECK_1_VALUE}</span>
<img src='images/{CHECK_1_PIC}.png' alt='{CHECK_1_PIC}' title='{CHECK_1_PIC}' class='textmiddle'> Javascript: <span class='{CHECK_1_CLASS}'>{CHECK_1_VALUE}</span>{CHECK_1_INFO}
<h3>{STEP1_SUBTITLE2}</h3>
<img src='images/{CHECK_2_PIC}.png' alt='{CHECK_2_PIC}' title='{CHECK_2_PIC}' class='textmiddle'> {CHECK_2_TEXT}: <span class='{CHECK_2_CLASS}'>{CHECK_2_VALUE}</span> {CHECK_2_INFO}
<h3>{STEP1_SUBTITLE3}</h3>
@ -46,9 +46,15 @@
<br>
<div id="{DIV_ID}">
<form name="frmStep1" id="frmStep1" action="install.php" method="post">
<input type="hidden" name="hidJScript" value="">
{FORM_CONTENT}
</form>
</div>
</div>
</div>
<script language="JavaScript">
<!--
document.frmStep1.hidJScript.value = 'yes';
//-->
</script>
<div id="ie_clearing"> </div>

29
install/templates/step2.tpl.htm Executable file → Normal file
View File

@ -1,12 +1,12 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- (c) 2005-2017 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<!-- Version : 3.3.0 -->
<!-- Revision : $LastChangedRevision: 2 $ -->
<script language="JavaScript" type="text/JavaScript">
<!--
// Send form
@ -40,6 +40,19 @@
}
return true;
}
// Modify port value
function modifyPort(db) {
if ((db == 'mysql') || (db == 'mysqli')) {
document.frmSetup.tfDBport.value = '3306';
document.frmSetup.tfDBport.className = 'required';
} else if (db == 'pgsql') {
document.frmSetup.tfDBport.value = '5432';
document.frmSetup.tfDBport.className = 'required';
} else {
document.frmSetup.tfDBport.value = '';
document.frmSetup.tfDBport.className = '';
}
}
//-->
</script>
<div id="installmenu">
@ -59,8 +72,12 @@
<legend><b>{STEP2_TEXT2_1}</b></legend>
<table cellpadding="0" cellspacing="1" border="0">
<tr>
<td style="width:250px;">{STEP2_TEXT2_2}</td>
<td><input type="text" name="tfDBtype" id="tfDBtype" class="locked" value="{STEP2_VALUE2_2}" disabled="disabled"></td>
<td style="width:250px;">{STEP2_TEXT2_2} <em>*</em></td>
<td>
<select name="selDBtype" id="selDBtype" class="required" onchange="modifyPort(this.value)">
{STEP2_VALUE2_2}
</select>
</td>
</tr>
<tr>
<td>{STEP2_TEXT2_3} <em>*</em></td>

10
install/templates/step3.tpl.htm Executable file → Normal file
View File

@ -1,12 +1,12 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- (c) 2005-2017 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : Installer template -->
<!-- Website : http://www.nagiosql.org -->
<!-- Date : $LastChangedDate: 2011-11-25 13:12:50 +0100 (Fri, 25 Nov 2011) $ -->
<!-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -->
<!-- Author : $LastChangedBy: martin $ -->
<!-- Version : 3.2.0 -->
<!-- Revision : $LastChangedRevision: 1134 $ -->
<!-- Version : 3.3.0 -->
<!-- Revision : $LastChangedRevision: 2 $ -->
<div id="installmenu">
<div id="installmenu_content">
<p class="step1_active"><a href='install.php?step=1'><br><br>{STEP1_BOX}</a></p>
@ -22,7 +22,7 @@
<legend><b>{STEP3_SUB_TITLE}</b></legend>
{ERRORMESSAGE}
<table cellpadding="0" cellspacing="1" border="0" class="{INST_VISIBLE}">
<tr>
<tr class="{STEP3_TEXT_02_SHOW}">
<td valign="top" style="width:350px;"><label>{STEP3_TEXT_01}</label></td>
<td>{STEP3_TEXT_02}</td>
</tr>

View File

@ -23,12 +23,13 @@
* @package HTML_Template_IT
* @author Ulf Wendel <uw@netuse.de>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version CVS: $Id: IT.php 295605 2010-02-28 22:48:07Z gregorycu $
* @version CVS: $Id: IT.php 3 2017-06-22 07:32:17Z martin $
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
*/
require_once (dirname(__FILE__) .'/../../PEAR.php' );
require_once 'PEAR.php';
$myPEAR = new PEAR();
define('IT_OK', 1);
define('IT_ERROR', -1);
@ -407,7 +408,7 @@ class HTML_Template_IT
* @see setRoot()
* @access public
*/
function HTML_Template_IT($root = '', $options = null)
function __construct($root = '', $options = null)
{
if (!is_null($options)) {
$this->setOptions($options);
@ -439,7 +440,8 @@ class HTML_Template_IT
*/
function setOption($option, $value)
{
switch ($option) {
global $myPEAR;
switch ($option) {
case 'removeEmptyBlocks':
$this->removeEmptyBlocks = $value;
return IT_OK;
@ -450,7 +452,7 @@ class HTML_Template_IT
return IT_OK;
}
return PEAR::raiseError(
return $myPEAR->raiseError(
$this->errorMessage(IT_UNKNOWN_OPTION) . ": '{$option}'",
IT_UNKNOWN_OPTION
);
@ -470,10 +472,12 @@ class HTML_Template_IT
*/
function setOptions($options)
{
global $myPEAR;
if (is_array($options)) {
foreach ($options as $option => $value) {
$error = $this->setOption($option, $value);
if (PEAR::isError($error)) {
if ($myPEAR->isError($error)) {
return $error;
}
}
@ -508,12 +512,13 @@ class HTML_Template_IT
*/
function get($block = '__global__')
{
if ($block == '__global__' && !$this->flagGlobalParsed) {
global $myPEAR;
if ($block == '__global__' && !$this->flagGlobalParsed) {
$this->parse('__global__');
}
if (!isset($this->blocklist[$block])) {
$this->err[] = PEAR::raiseError(
$this->err[] = $myPEAR->raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
@ -557,10 +562,11 @@ class HTML_Template_IT
*/
function parse($block = '__global__', $flag_recursion = false)
{
static $regs, $values;
global $myPEAR;
static $regs, $values;
if (!isset($this->blocklist[$block])) {
return PEAR::raiseError(
return $myPEAR->raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
@ -785,9 +791,9 @@ class HTML_Template_IT
*/
function setCurrentBlock($block = '__global__')
{
global $myPEAR;
if (!isset($this->blocklist[$block])) {
return PEAR::raiseError(
return $myPEAR->raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND)
. '"' . $block . "'",
IT_BLOCK_NOT_FOUND
@ -811,8 +817,9 @@ class HTML_Template_IT
*/
function touchBlock($block)
{
if (!isset($this->blocklist[$block])) {
return PEAR::raiseError(
global $myPEAR;
if (!isset($this->blocklist[$block])) {
return $myPEAR->raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
@ -1012,7 +1019,8 @@ class HTML_Template_IT
*/
function findBlocks($string)
{
$blocklist = array();
global $myPEAR;
$blocklist = array();
if (preg_match_all($this->blockRegExp, $string, $regs, PREG_SET_ORDER)) {
foreach ($regs as $k => $match) {
@ -1022,7 +1030,7 @@ class HTML_Template_IT
if (isset($this->blocklist[$blockname])) {
$msg = $this->errorMessage(IT_BLOCK_DUPLICATE, $blockname);
$this->err[] = PEAR::raiseError($msg, IT_BLOCK_DUPLICATE);
$this->err[] = $myPEAR->raiseError($msg, IT_BLOCK_DUPLICATE);
$this->flagBlocktrouble = true;
}
@ -1065,14 +1073,15 @@ class HTML_Template_IT
*/
function getFile($filename)
{
if ($filename{0} == '/' && substr($this->fileRoot, -1) == '/') {
global $myPEAR;
if ($filename{0} == '/' && substr($this->fileRoot, -1) == '/') {
$filename = substr($filename, 1);
}
$filename = $this->fileRoot . $filename;
if (!($fh = @fopen($filename, 'r'))) {
$this->err[] = PEAR::raiseError(
$this->err[] = $myPEAR->raiseError(
$this->errorMessage(IT_TPL_NOT_FOUND) . ': "' .$filename .'"',
IT_TPL_NOT_FOUND
);
@ -1088,8 +1097,9 @@ class HTML_Template_IT
$content = fread($fh, $fsize);
fclose($fh);
return preg_replace(
"#<!-- INCLUDE (.*) -->#ime",
// "#<!-- INCLUDE (.*) -->#ime", wma/PEAR error
return preg_replace(
"#<!-- INCLUDE (.*) -->#im",
"\$this->getFile('\\1')",
$content
);
@ -1159,7 +1169,8 @@ class HTML_Template_IT
*/
function errorMessage($value, $blockname = '')
{
static $errorMessages;
global $myPEAR;
static $errorMessages;
if (!isset($errorMessages)) {
$errorMessages = array(
IT_OK => '',
@ -1175,7 +1186,7 @@ class HTML_Template_IT
);
}
if (PEAR::isError($value)) {
if ($myPEAR->isError($value)) {
$value = $value->getCode();
}

View File

@ -23,7 +23,7 @@
* @package HTML_Template_IT
* @author Ulf Wendel <uw@netuse.de>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version CVS: $Id: ITX.php 295086 2010-02-15 06:31:36Z clockwerx $
* @version CVS: $Id: ITX.php 3 2017-06-22 07:32:17Z martin $
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
*/

View File

@ -23,7 +23,7 @@
* @package HTML_Template_IT
* @author Ulf Wendel <uw@netuse.de>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version CVS: $Id: IT_Error.php 295117 2010-02-15 23:25:21Z clockwerx $
* @version CVS: $Id: IT_Error.php 3 2017-06-22 07:32:17Z martin $
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
*/

View File

@ -6,15 +6,15 @@
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2012 by Martin Willisegger
// (c) 2005-2017 by Martin Willisegger
//
// Project : NagiosQL
// Component : Configuration scripting interface
// Website : http://www.nagiosql.org
// Date : $LastChangedDate: 2012-03-08 08:40:12 +0100 (Thu, 08 Mar 2012) $
// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $
// Author : $LastChangedBy: martin $
// Version : 3.2.0
// Revision : $LastChangedRevision: 1280 $
// Version : 3.3.0
// Revision : $LastChangedRevision: 2 $
//
///////////////////////////////////////////////////////////////////////////////
//
@ -129,7 +129,7 @@ if ($argFunction == "restart") {
if ($intMethod == 1) {
if (file_exists($strPidfile)) {
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");
@ -161,7 +161,7 @@ if ($argFunction == "restart") {
$myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage);
} else {
if (is_array($myConfigClass->sendSSHCommand('ls '.$strCommandfile))) {
$strCommandString = "[".mktime()."] RESTART_PROGRAM;".mktime();
$strCommandString = "[".time()."] RESTART_PROGRAM;".time()."\n";;
$arrResult = $myConfigClass->sendSSHCommand('echo "'.$strCommandString.'" >> '.$strCommandfile);
if ($arrResult == false) {
echo "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!\n";

View File

@ -1,12 +1,12 @@
<!-- (c) 2005-2012 by Martin Willisegger -->
<!-- (c) 2005-2017 by Martin Willisegger -->
<!-- -->
<!-- Project : NagiosQL -->
<!-- Component : admin master template -->
<!-- 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 $ -->
<!-- BEGIN datatable -->
<script language="JavaScript" type="text/JavaScript">
<!--

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