setting.global.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. global $myUser, $conf;
  3. User::check_access('setting_global','read');
  4. ?>
  5. <div class="row">
  6. <div class="col-md-12 general-settings" id="general-settings" data-action="general_settings_save">
  7. <br>
  8. <?php if($myUser->can('setting_global','configure')): ?>
  9. <div class="btn btn-success float-right" onclick="general_settings_save();"><i class="fas fa-check"></i> Enregistrer</div>
  10. <?php endif; ?>
  11. <h3>Réglages généraux</h3>
  12. <p>Bienvenue sur l'espace de configuration, cliquez sur le menu de gauche pour acceder aux différents réglages de l'application.</p>
  13. <hr/>
  14. <?php if($myUser->can('setting_global','configure')): ?>
  15. <?php if(!function_exists('apache_get_version')){
  16. function apache_get_version(){
  17. if(!isset($_SERVER['SERVER_SOFTWARE']) || strlen($_SERVER['SERVER_SOFTWARE']) == 0){
  18. return "???";
  19. }
  20. return $_SERVER["SERVER_SOFTWARE"];
  21. }
  22. } ?>
  23. <div>
  24. <h5>Informations générales :</h5>
  25. <ul>
  26. <li>Nom du programme : <strong><?php echo PROGRAM_NAME; ?></strong></li>
  27. <li>Version : <strong><?php echo SOURCE_VERSION; ?></strong></li>
  28. <li>Version PHP : <strong><?php echo phpversion(); ?></strong></li>
  29. <li>Version Apache : <strong><?php echo apache_get_version(); ?></strong></li>
  30. <li>Version de la base: <strong><?php echo BASE_SGBD.' - '.Database::version(); ?></strong></li>
  31. <li>Adresse de la base : <strong><?php echo BASE_HOST; ?></strong></li>
  32. <li>Time Zone : <strong><?php echo TIME_ZONE; ?></strong></li>
  33. <li>OS : <strong><?php echo PHP_OS; ?></strong></li>
  34. <li>Horodatage serveur : <strong><?php echo date('d/m/Y H:i.s'); ?></strong></li>
  35. </ul>
  36. </div>
  37. <hr>
  38. <!-- Réglages généraux de l'application -->
  39. <div>
  40. <h5>Theme :</h5>
  41. <div class="row">
  42. <div class="col-md-12 identity-block">
  43. <div class="row">
  44. <div class="col-md-6">
  45. <label> Logo application (clair) <small class="text-muted">(S'appliquera sur les fonds sombre de l'ensemble des établissements)</small> : </label>
  46. <input type="file" data-type="image" value="action.php?action=general_logo_download" class="form-control-file" id="logo" name="logo" data-delete="general_logo_delete(this)" data-default-src="img/logo/default-logo.png">
  47. <br>
  48. </div>
  49. <div class="col-md-6">
  50. <label> Logo application (sombre) <small class="text-muted">(S'appliquera sur les fonds clairs de l'ensemble des établissements)</small> : </label>
  51. <input type="file" data-type="image" value="action.php?action=general_logo_download&variant=dark" class="form-control-file" id="logo_dark" name="logo_dark" data-delete="general_logo_delete(this)" data-default-src="img/logo/default-logo.dark.png">
  52. <br>
  53. </div>
  54. <div class="col-md-6">
  55. <label> Favicon de l'application <small class="text-muted">(Cette favicon s'appliquera sur l'ensemble du site)</small> : </label>
  56. <input type="file" data-type="image" value="action.php?action=general_favicon_download" class="form-control-file" id="favicon" name="favicon" data-delete="general_favicon_delete(this)" data-default-src="img/logo/default-favicon.png">
  57. <br>
  58. </div>
  59. <div class="col-md-6"></div>
  60. </div>
  61. </div>
  62. </div>
  63. <hr>
  64. <div class="row">
  65. <div class="col-md-12">
  66. <h5>Mots de passes :</h5>
  67. <p>Définissez la politique de format des mots de passes</p>
  68. <h6 class="font-weight-bold">FORMATS</h6>
  69. <div id="password-format-form">
  70. <?php
  71. $selectedFormats = json_decode($conf->get('password_format'),true);
  72. if(!is_array($selectedFormats )) $selectedFormats = array();
  73. foreach(User::password_formats() as $format):
  74. ?>
  75. <label class="pl-3"><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/>
  76. <?php endforeach; ?>
  77. </div>
  78. </div>
  79. </div>
  80. <hr>
  81. <h5>Logs :</h5>
  82. <div>
  83. <span class="d-inline-block">
  84. Définition de la durée de conservation des logs par catégorie<small class="text-muted"> - en nombre de jours</small>
  85. </span>
  86. <small class="d-inline-block float-right text-danger">
  87. Laisser vide si vous souhaitez conserver les logs indéfiniment (déconseillé)
  88. </small>
  89. <div class="clear"></div>
  90. </div>
  91. <div class="row mt-2">
  92. <?php foreach(Log::staticQuery('SELECT DISTINCT category FROM {{table}}',array(),true) as $log):
  93. $slug = slugify($log->category);
  94. ?>
  95. <div class="col-md-3">
  96. <div class="input-group">
  97. <div class="input-group-prepend w-75">
  98. <span class="input-group-text w-100"><code><?php echo $log->category ?></code></span>
  99. </div>
  100. <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); ?>">
  101. </div>
  102. </div>
  103. <?php endforeach; ?>
  104. </div>
  105. <hr>
  106. <div class="row">
  107. <div class="col-md-12 general-settings-block">
  108. <?php echo Configuration::html('configuration-global'); ?>
  109. </div>
  110. </div>
  111. <hr/>
  112. <div class="row">
  113. <div class="col-md-12 maintenance-block">
  114. <span class="float-right">
  115. <input onchange="toggle_maintenance();" <?php echo file_exists('enabled.maintenance') ? 'checked="checked"' : '' ?> type="checkbox" autocomplete="off" name="maintenance" id="maintenance" data-type="checkbox" data-class="">
  116. <label for="maintenance" class="pointer">Site en maintenance</label><br>
  117. </span>
  118. <h5>Maintenance :</h5>
  119. <div class="clear"></div>
  120. <textarea data-type="wysiwyg" name="maintenance-content" id="maintenance-content" cols="30" rows="3" class="form-control">
  121. <?php echo file_exists('enabled.maintenance') ? file_get_contents('enabled.maintenance') : (file_exists('disabled.maintenance') ? file_get_contents('disabled.maintenance') : ''); ?>
  122. </textarea>
  123. </div>
  124. </div>
  125. </div>
  126. <?php endif; ?>
  127. </div>
  128. </div>