diff --git a/include/init/configuration.php b/include/init/configuration.php index 06c2decc3..0bdfcbe5c 100755 --- a/include/init/configuration.php +++ b/include/init/configuration.php @@ -179,32 +179,13 @@ if (post('db_host') !== null) { } // Continua con l'esecuzione delle operazioni previste else { - // Creazione manifest.json - $manifest = '{ - "dir" : "ltr", - "lang" : "'.((empty($lang) || $lang == '|lang|') ? 'it-IT' : str_replace('_','-',$lang)).'", - "name" : "'.tr('OpenSTAManager').'", - "scope" : "'.((empty(base_path()) || base_path()=='/') ? '' : '.').'", - "display" : "fullscreen", - "start_url" : "'.((empty(base_path()) || base_path()=='/') ? '/' : './').'", - "short_name" : "OSM", - "theme_color" : "transparent", - "description" : "'.tr('OpenSTAManager').'", - "orientation" : "any", - "background_color" : "transparent", - "generated" : "true", - "icons" : [ - { - "src": "assets/dist/img/logo_completo.png", - "type": "image/png", - "sizes": "489x91" - } - ] - }'; - file_put_contents('manifest.json', $manifest); + // Creazione manifest.json + include_once App::filepath('include/init', 'manifest.php'); redirect(base_path().'/index.php'); exit(); + + } } } diff --git a/include/init/manifest.php b/include/init/manifest.php new file mode 100644 index 000000000..3ed630fb7 --- /dev/null +++ b/include/init/manifest.php @@ -0,0 +1,65 @@ +. + */ + +$creation = file_put_contents('manifest.json', ''); + +if (!$creation) { + + $manifest = '{ + + "dir" : "ltr", + "lang" : "'.((empty($lang) || $lang == '|lang|') ? 'it-IT' : str_replace('_','-',$lang)).'", + "name" : "'.tr('OpenSTAManager').'", + "scope" : "'.((empty(base_path()) || base_path()=='/') ? '' : '.').'", + "display" : "fullscreen", + "start_url" : "'.((empty(base_path()) || base_path()=='/') ? '/' : './').'", + "short_name" : "OSM", + "theme_color" : "transparent", + "description" : "'.tr('OpenSTAManager').'", + "orientation" : "any", + "background_color" : "transparent", + "generated" : "true", + "icons" : [ + { + "src": "'.App::getPaths()['img'].'/logo_completo.png", + "type": "image/png", + "sizes": "489x91" + } + ] +}'; + + + file_put_contents('manifest.json', $manifest); + +}else{ + + echo ' +
+
+

'.tr('Permessi di scrittura mancanti').'

+
+
+

'.tr('Sembra che non ci siano i permessi di scrittura sul file _FILE_', [ + '_FILE_' => 'manifest.json', + ]).'

+
+
'; +} + + diff --git a/include/init/requirements.php b/include/init/requirements.php index c6ad6c2ca..477cf0901 100755 --- a/include/init/requirements.php +++ b/include/init/requirements.php @@ -210,7 +210,7 @@ foreach ($db as $name => $values) { // Percorsi di servizio -$dirs = [ +$dirs_to_check = [ 'backup' => tr('Necessario per il salvataggio dei backup'), 'files' => tr('Necessario per il salvataggio di file inseriti dagli utenti'), 'files/temp' => tr('Necessario per la generazione delle stampe'), @@ -218,7 +218,7 @@ $dirs = [ ]; $directories = []; -foreach ($dirs as $name => $description) { +foreach ($dirs_to_check as $name => $description) { $status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name); $directories[] = [ @@ -230,6 +230,28 @@ foreach ($dirs as $name => $description) { } +// File di servizio +$files_to_check = [ + 'manifest.json' => tr('Necessario per aggiunta a schermata home da terminale'), + 'database_5_7.json' => tr('Necessario per il controllo integrità con database MySQL 5.7.x'), + 'database.json' => tr('Necessario per il controllo integrità con database MySQL 8.0.x'), + 'checksum.json' => tr('Necessario per il controllo integrità dei files del gestionale'), +]; + +$files = []; +foreach ($files_to_check as $name => $description) { + $status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name); + + $files[] = [ + 'name' => $name, + 'description' => $description, + 'status' => $status, + 'type' => tr('File'), + ]; +} + + + $requirements = [ tr('Apache') => $apache, tr('PHP (_VERSION_ _SUPPORTED_)', [ @@ -238,6 +260,7 @@ $requirements = [ ]) => $php, tr('MySQL') => $mysql, tr('Percorsi di servizio') => $directories, + tr('File di servizio') => $files, ]; if (!$database->isInstalled() || empty($mysql)){ @@ -276,8 +299,8 @@ foreach ($requirements as $key => $values) { echo ' - '.$value['type'].' - '.$value['name'].' + '.$value['type'].' + '.$value['name'].' '.$value['description'].' '; } diff --git a/include/top.php b/include/top.php index 100c59315..f91543d07 100755 --- a/include/top.php +++ b/include/top.php @@ -46,7 +46,7 @@ echo ' if (file_exists(base_dir().'/manifest.json')) { echo ' - '; + '; } // CSS