File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 ],
1111 "require" : {
1212 "php" : " >= 5.5.9" ,
13+ "php-fileinfo" : " *" ,
1314 "vitexsoftware/ease-framework" : " dev-master"
1415 },
1516 "autoload" : {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ debian/conf/icinga-editor.conf etc/apache2/conf-available
1818debian/conf/icinga-editor.service etc/avahi/services
1919debian/conf/icinga-editor etc/sudoers.d
2020debian/plugins/* usr/lib/nagios/plugins
21- debian /bin/iecfgimporter.php usr/bin
21+ src /bin/iecfgimporter.php usr/bin
2222
2323locale/cs_CZ/LC_MESSAGES/*.mo usr/share/locale/cs_CZ/LC_MESSAGES
2424locale/en_US/LC_MESSAGES/*.mo usr/share/locale/cs_CZ/LC_MESSAGES
Original file line number Diff line number Diff line change 1+
2+ /usr/share/icinga/htdocs/images/logos /usr/share/icinga-editor/logos
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ if [ ! -f $IECFG ] ; then
6969
7070
7171 # rm -f /etc/icinga-editor/config-db.sh
72- ln -s /usr/share/icinga/htdocs/images/logos /usr/share/icinga-editor/logos
72+ # (Moved To links file) ln -s /usr/share/icinga/htdocs/images/logos /usr/share/icinga-editor/logos
7373
7474
7575 if [ " $1 " = " configure" ]; then
@@ -104,7 +104,15 @@ if [ ! -f $IECFG ] ; then
104104 fi
105105 fi
106106
107- iecfgimporter.php
107+ # Import configuration Question ?
108+ db_input medium icinga-editor/IMPORT_CONFIG || true
109+ db_go
110+
111+ # Check their answer.
112+ db_get icinga-editor/IMPORT_CONFIG
113+ if [ " $RET " = " true" ]; then
114+ /usr/bin/iecfgimporter
115+ fi
108116 fi
109117
110118fi
Original file line number Diff line number Diff line change @@ -7,5 +7,6 @@ override_dh_install:
77 dh_install
88 sed -i -e ' s/..\//.\//g' debian/icinga-editor/usr/share/icinga-editor/about.php
99 sed -i -e ' s/..\/locale/\/usr\/share\/locale/g' debian/icinga-editor/usr/share/icinga-editor/includes/IEInit.php
10- sed -i -e ' s/..\/vendor/\/var\/lib\/icinga-editor/g' debian/icinga-editor/usr/share/icinga-editor/includes/IEInit.php
1110 sed -i -e ' s/..\/i18n/\/usr\/share\/locale/g' debian/icinga-editor/usr/share/icinga-editor/includes/IEInit.php
11+ mv debian/icinga-editor/usr/bin/iecfgimporter.php debian/icinga-editor/usr/bin/iecfgimporter
12+
Original file line number Diff line number Diff line change @@ -8,3 +8,9 @@ Type: string
88Description: IP address of ICINGA server
99 Or simply press enter to use auto genrated value
1010
11+ Template: icinga-editor/IMPORT_CONFIG
12+ Type: boolean
13+ Default: true
14+ Description: Import icinga config files ?
15+ Choose yes to import all config files in /etc/icinga directory into database.
16+ Imported files remain renamed to *.disabled
Original file line number Diff line number Diff line change 1+ Template: icinga- editor/ SEND_MAILS_FROM
2+ Type: string
3+ Description: mail address of icinga admin
4+ Or simply press enter to use auto genrated name
5+ Description - cs: mailová adresa administrátora icingy
6+
7+ Template: icinga- editor/ ICINGA_SERVER_IP
8+ Type: string
9+ Description: IP address of ICINGA server
10+ Or simply press enter to use auto genrated value
11+ Description - cs: IP adresa serveru ICINGA
12+
13+ Template: icinga- editor/ IMPORT_CONFIG
14+ Type: boolean
15+ Default: true
16+ Description: Import icinga config files ?
17+ Choose yes to import all config files in / etc/ icinga directory into
18+ database. Imported files remain renamed to * .disabled
19+ Description - cs: Importovat konfigurační soubory icingy ?
Original file line number Diff line number Diff line change 1- #!/usr/bin/env php
1+ #!/usr/bin/env php -q
22<?php
3-
4- namespace Icinga \Editor ;
3+ //namespace Icinga\Editor;
54
65/**
76 * Import konfigurace ze souboru
1110 * @author Vitex <vitex@hippy.cz>
1211 * @copyright 2015 Vitex@hippy.cz (G)
1312 */
14- chdir ('/usr/share/icinga-editor ' );
15-
16- require_once 'includes/IEInit.php ' ;
13+ //require_once '/usr/share/icinga-editor/includes/IEInit.php';
14+ require_once '../includes/IEInit.php ' ;
1715
1816$ params = array ('public ' => true , 'generate ' => true );
1917
20- $ importer = new Engine \Importer ($ params );
18+ $ importer = new Icinga \ Editor \ Engine \Importer ($ params );
2119$ importer ->importCfgFile ('/etc/icinga/icinga.cfg ' );
2220
2321foreach ($ importer ->files as $ cfgFile ) {
2422 if ($ cfgFile == '/etc/icinga/icinga.cfg ' ) {
2523 continue ;
2624 }
27- if (unlink ($ cfgFile )) {
28- echo $ cfgFile . " X \n" ;
25+ if (rename ($ cfgFile, $ cfgFile . ' .disabled ' )) {
26+ echo $ cfgFile. " imported \n" ;
2927 }
3028}
3129
Original file line number Diff line number Diff line change @@ -113,24 +113,28 @@ public function __construct($host)
113113 */
114114 public static function imageTypeOK ($ tmpfilename )
115115 {
116- $ finfo = new finfo (FILEINFO_MIME );
117- $ info = $ finfo ->file ($ tmpfilename );
118- if (!$ info ) {
119- return false ;
120- }
121- if (strstr ($ info , 'gif ' )) {
122- return true ;
123- }
124- if (strstr ($ info , 'png ' )) {
125- return true ;
126- }
127- if (strstr ($ info , 'jpeg ' )) {
128- return true ;
129- }
130- if (strstr ($ info , 'ico ' )) {
131- return true ;
116+ if (class_exists ('\finfo ' )) {
117+ $ finfo = new \finfo (constant ('FILEINFO_MIME ' ));
118+ $ info = $ finfo ->file ($ tmpfilename );
119+ if (!$ info ) {
120+ return false ;
121+ }
122+ if (strstr ($ info , 'gif ' )) {
123+ return true ;
124+ }
125+ if (strstr ($ info , 'png ' )) {
126+ return true ;
127+ }
128+ if (strstr ($ info , 'jpeg ' )) {
129+ return true ;
130+ }
131+ if (strstr ($ info , 'ico ' )) {
132+ return true ;
133+ }
134+ } else {
135+ \Ease \Shared::webPage ()->addStatusMessage ('php-fileinfo ?!?!? ' ,
136+ 'error ' );
132137 }
133-
134138 return false ;
135139 }
136140
Original file line number Diff line number Diff line change 77 *
88 * @package VitexSoftware
99 * @author Vitex <vitex@hippy.cz>
10- * @copyright 2009-2011 Vitex@hippy.cz (G)
10+ * @copyright 2009-2016 Vitex@hippy.cz (G)
1111 */
1212class WebPage extends \Ease \TWB \WebPage
1313{
@@ -103,4 +103,5 @@ function onlyForLogged($loginPage = 'login.php')
103103 {
104104 return parent ::onlyForLogged ($ loginPage .'?backurl= ' .urlencode ($ _SERVER ['REQUEST_URI ' ]));
105105 }
106- }
106+
107+ }
You can’t perform that action at this time.
0 commit comments