setting.global.php 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. global $myUser, $conf;
  3. User::check_access('setting_global','read');
  4. global $databases_credentials;
  5. ?>
  6. <div class="row">
  7. <div class="col-md-12 general-settings" id="general-settings" data-action="core_general_settings_save">
  8. <br>
  9. <?php if($myUser->can('setting_global','configure')): ?>
  10. <div class="btn btn-success float-right" onclick="core_general_settings_save();"><i class="fas fa-check"></i> Enregistrer</div>
  11. <?php endif; ?>
  12. <h3>Réglages généraux</h3>
  13. <p>Bienvenue sur l'espace de configuration, cliquez sur le menu de gauche pour acceder aux différents réglages de l'application.</p>
  14. <hr/>
  15. <?php if($myUser->can('setting_global','configure')): ?>
  16. <div>
  17. <h5>Informations générales :</h5>
  18. <ul>
  19. <li>Nom du programme : <strong><?php echo PROGRAM_NAME; ?></strong></li>
  20. <li>Version : <strong><?php echo SOURCE_VERSION; ?></strong></li>
  21. <li>Version PHP : <strong><?php echo phpversion(); ?></strong></li>
  22. <li>Version Apache : <strong><?php echo apache_get_version(); ?></strong></li>
  23. <li>Version de la base: <strong><?php echo $databases_credentials['local']['connector'].' - '.Database::version(); ?></strong></li>
  24. <li>Adresse de la base : <strong><?php echo $databases_credentials['local']['host']; ?></strong></li>
  25. <li>Time Zone : <strong><?php echo TIME_ZONE; ?></strong></li>
  26. <li>OS : <strong><?php echo PHP_OS; ?></strong></li>
  27. <li>Horodatage serveur : <strong><?php echo date('d/m/Y H:i.s'); ?></strong></li>
  28. </ul>
  29. </div>
  30. <hr>
  31. <!-- Réglages généraux de l'application -->
  32. <div>
  33. <div>
  34. <h5 class="d-inline-block mb-2">Logs</h5><small class="text-muted"> - Définition de la durée de conservation des logs par catégorie en nombre de jours</small> :
  35. <small class="d-inline-block float-right text-danger">
  36. Laisser vide si vous souhaitez conserver les logs indéfiniment (<strong>déconseillé</strong>)
  37. </small>
  38. <div class="clear"></div>
  39. </div>
  40. <div class="row mt-2">
  41. <?php foreach(Log::staticQuery('SELECT DISTINCT category FROM {{table}}',array(),true) as $log):
  42. $slug = slugify($log->category);
  43. ?>
  44. <div class="col-md-3">
  45. <div class="input-group input-group-sm">
  46. <div class="input-group-prepend w-75">
  47. <span class="input-group-text w-100"><code><?php echo $log->category ?></code></span>
  48. </div>
  49. <input type="number" onkeydown="return input_number_control(event);" class="form-inline form-control" id="log_retention_time_<?php echo $slug; ?>" placeholder="ex. 30" value="<?php echo $conf->get('log_retention_time_'.$slug); ?>">
  50. </div>
  51. </div>
  52. <?php endforeach; ?>
  53. </div>
  54. <hr>
  55. <div class="row password-block">
  56. <div class="col-md-12">
  57. <h5 class="d-inline-block mb-2">Mots de passes</h5><small class="text-muted"> - Définition de la politique de format des mots de passes</small> :
  58. <div id="password-format-form">
  59. <?php
  60. $selectedFormats = json_decode($conf->get('password_format'),true);
  61. if(!is_array($selectedFormats )) $selectedFormats = array();
  62. foreach(User::password_formats() as $format):
  63. ?>
  64. <label class="pl-3 pointer"><input type="checkbox" data-type="checkbox" <?php echo in_array($format['pattern'], $selectedFormats)?'checked="checked"':''; ?> data-label="<?php echo $format['label'] ?>" data-pattern="<?php echo $format['pattern'] ?>" onclick="password_settings_format()"> <?php echo $format['label'] ?></label><br/>
  65. <?php endforeach; ?>
  66. </div>
  67. </div>
  68. </div>
  69. <hr>
  70. <div class="row">
  71. <div class="col-md-12 general-settings-block">
  72. <?php echo Configuration::html('configuration-global'); ?>
  73. </div>
  74. </div>
  75. <hr>
  76. <div class="row">
  77. <div class="col-md-12 maintenance-block">
  78. <span class="float-right">
  79. <input onchange="toggle_maintenance();" <?php echo file_exists(File::dir().SLASH.'enabled.maintenance') ? 'checked="checked"' : '' ?> type="checkbox" autocomplete="off" name="maintenance" id="maintenance" data-type="checkbox">
  80. <label for="maintenance" class="pointer">Site en maintenance</label><br>
  81. </span>
  82. <h5>Maintenance :</h5>
  83. <div class="clear"></div>
  84. <textarea data-type="wysiwyg" name="maintenance-content" id="maintenance-content" cols="30" rows="3" class="m-0">
  85. <?php echo file_exists(File::dir().SLASH.'enabled.maintenance') ? file_get_contents(File::dir().SLASH.'enabled.maintenance') : (file_exists(File::dir().SLASH.'disabled.maintenance') ? file_get_contents(File::dir().SLASH.'disabled.maintenance') : ''); ?>
  86. </textarea>
  87. </div>
  88. </div>
  89. </div>
  90. <?php endif; ?>
  91. </div>
  92. </div><br>