setting.global.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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="general_settings_save">
  8. <br>
  9. <?php if($myUser->can('setting_global','configure')): ?>
  10. <div class="btn btn-success float-right" onclick="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. <h5>Theme :</h5>
  34. <div class="row">
  35. <div class="col-md-12 identity-block">
  36. <div class="row">
  37. <div class="col-md-6">
  38. <label> Logo application (clair) <small class="text-muted">(S'appliquera sur les fonds sombre de l'ensemble des établissements)</small> : </label>
  39. <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">
  40. <br>
  41. </div>
  42. <div class="col-md-6">
  43. <label> Logo application (sombre) <small class="text-muted">(S'appliquera sur les fonds clairs de l'ensemble des établissements)</small> : </label>
  44. <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">
  45. <br>
  46. </div>
  47. <div class="col-md-6">
  48. <label> Favicon de l'application <small class="text-muted">(Cette favicon s'appliquera sur l'ensemble du site)</small> : </label>
  49. <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">
  50. <br>
  51. </div>
  52. <div class="col-md-6"></div>
  53. </div><br>
  54. </div>
  55. </div>
  56. <hr>
  57. <div class="row">
  58. <div class="col-md-12">
  59. <h5 class="d-inline-block mb-2">Mots de passes :</h5>
  60. <div id="password-format-form" class="password-format-form mt-2">
  61. <?php
  62. $selectedFormats = json_decode($conf->get('password_format'),true);
  63. if(!is_array($selectedFormats )) $selectedFormats = array();
  64. foreach(User::password_formats() as $format):
  65. ?>
  66. <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/>
  67. <?php endforeach; ?>
  68. </div>
  69. </div>
  70. </div>
  71. <hr>
  72. <h5>Logs :</h5>
  73. <div>
  74. <span class="d-inline-block">
  75. Définition de la durée de conservation des logs par catégorie<small class="text-muted"> - en nombre de jours</small>
  76. </span>
  77. <small class="d-inline-block float-right text-danger">
  78. Laisser vide si vous souhaitez conserver les logs indéfiniment (<strong>déconseillé</strong>)
  79. </small>
  80. <div class="clear"></div>
  81. </div>
  82. <div class="row mt-2">
  83. <?php foreach(Log::staticQuery('SELECT DISTINCT category FROM {{table}}',array(),true) as $log):
  84. $slug = slugify($log->category);
  85. ?>
  86. <div class="col-md-3">
  87. <div class="input-group">
  88. <div class="input-group-prepend w-75">
  89. <span class="input-group-text w-100"><code><?php echo $log->category ?></code></span>
  90. </div>
  91. <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); ?>">
  92. </div>
  93. </div>
  94. <?php endforeach; ?>
  95. </div>
  96. <hr>
  97. <div class="row">
  98. <div class="col-md-12 general-settings-block">
  99. <?php echo Configuration::html('configuration-global'); ?>
  100. </div>
  101. </div>
  102. <hr/>
  103. <div class="row">
  104. <div class="col-md-12 maintenance-block">
  105. <span class="float-right">
  106. <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="">
  107. <label for="maintenance" class="pointer">Site en maintenance</label><br>
  108. </span>
  109. <h5>Maintenance :</h5>
  110. <div class="clear"></div>
  111. <textarea data-type="wysiwyg" name="maintenance-content" id="maintenance-content" cols="30" rows="3" class="">
  112. <?php echo file_exists('enabled.maintenance') ? file_get_contents('enabled.maintenance') : (file_exists('disabled.maintenance') ? file_get_contents('disabled.maintenance') : ''); ?>
  113. </textarea>
  114. </div>
  115. </div>
  116. </div>
  117. <?php endif; ?>
  118. </div>
  119. </div><br>