setting.global.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php
  2. global $myUser, $conf;
  3. if(!$myUser->can('setting_global','read')) throw new Exception("Permissions insuffisantes",403);
  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. <div>
  16. <h5>Informations générales :</h5>
  17. <ul>
  18. <li>Nom du programme : <strong><?php echo PROGRAM_NAME; ?></strong></li>
  19. <li>Version : <strong><?php echo SOURCE_VERSION; ?></strong></li>
  20. <li>Version PHP : <strong><?php echo phpversion(); ?></strong></li>
  21. <li>Version Apache : <strong><?php echo apache_get_version(); ?></strong></li>
  22. <li>Version de la base: <strong><?php echo BASE_SGBD.' - '.Database::version(); ?></strong></li>
  23. <li>Adresse de la base : <strong><?php echo BASE_HOST; ?></strong></li>
  24. <li>Time Zone : <strong><?php echo TIME_ZONE; ?></strong></li>
  25. <li>OS : <strong><?php echo PHP_OS; ?></strong></li>
  26. <li>Horodatage serveur : <strong><?php echo date('d/m/Y H:i.s'); ?></strong></li>
  27. </ul>
  28. </div>
  29. <hr>
  30. <!-- Réglages généraux de l'application -->
  31. <div>
  32. <h5>Theme :</h5>
  33. <div class="row">
  34. <div class="col-md-12 identity-block">
  35. <div class="row">
  36. <div class="col-md-6">
  37. <label> Logo application (clair) <small class="text-muted">(S'appliquera sur les fonds sombre de l'ensemble des établissements)</small> : </label>
  38. <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">
  39. <br>
  40. </div>
  41. <div class="col-md-6">
  42. <label> Logo application (sombre) <small class="text-muted">(S'appliquera sur les fonds clairs de l'ensemble des établissements)</small> : </label>
  43. <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">
  44. <br>
  45. </div>
  46. <div class="col-md-6">
  47. <label> Favicon de l'application <small class="text-muted">(Cette favicon s'appliquera sur l'ensemble du site)</small> : </label>
  48. <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">
  49. <br>
  50. </div>
  51. <div class="col-md-6"></div>
  52. <div class="col-md-6">
  53. <label class="pointer">
  54. <input type="checkbox" <?php echo $conf->get('show_application_name')? 'checked="checked"':'' ?> id="show_application_name" name="show_application_name" data-type="checkbox"> Afficher le nom du programme <small class="text-muted">(Partie en-tête uniquement)</small>
  55. </label>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. <hr>
  61. <div class="row">
  62. <div class="col-md-12">
  63. <h5>Mots de passes :</h5>
  64. <p>Définissez la politique de format et de changement des mots de passes</p>
  65. <h6 class="font-weight-bold">FORMATS</h6>
  66. <div id="password-format-form">
  67. <?php
  68. $selectedFormats = json_decode($conf->get('password_format'),true);
  69. if(!is_array($selectedFormats )) $selectedFormats = array();
  70. foreach(User::passwordFormats() as $format):
  71. ?>
  72. <label><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/>
  73. <?php endforeach; ?>
  74. </div>
  75. <h6 class="font-weight-bold">RENOUVELLEMENT</h6>
  76. <label>Forcer l'utilisateur a renouveller son mot de passe tous les :</label>
  77. <div class="input-group">
  78. <input type="text" id="password-delay" value="<?php echo $conf->get('password_delay'); ?>" class="form-control form-control-sm col-sm-1">
  79. <div class="input-group-append">
  80. <span class="input-group-text">jours</span>
  81. </div>
  82. </div>
  83. <small class="text-muted">Laisser vide pour désactiver cette fonctionnalité</small>
  84. <br/><div class="btn btn-success" onclick="general_reset_password_delay()"> Forcer les utilisateurs à changer maintenant</div>
  85. </div>
  86. </div>
  87. <hr/>
  88. <h5>Logs :</h5>
  89. <p>Veuillez définir la durée de conservation des logs en Jours poru chaques catégorie<br>
  90. Laisser vide si vous souhaitez conserver les logs indéfiniment (déconseillé)</p>
  91. <?php foreach(Log::staticQuery('SELECT DISTINCT category FROM {{table}}',array(),true) as $log):
  92. $slug = slugify($log->category);
  93. ?>
  94. <div class="row mt-2">
  95. <div class="col-md-12">
  96. <div class="input-group">
  97. <div class="input-group-prepend">
  98. <span class="input-group-text"><small class="text-muted mini-title mr-1">catégorie</small> <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. </div>
  104. <?php endforeach; ?>
  105. <hr/>
  106. <h5>Divers :</h5>
  107. <div class="row">
  108. <div class="col-md-12 general-settings-block">
  109. <?php echo Configuration::html('configuration-global'); ?>
  110. </div>
  111. </div>
  112. <hr/>
  113. <div class="row">
  114. <div class="col-md-12 maintenance-block">
  115. <span class="float-right">
  116. <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="">
  117. <label for="maintenance" class="pointer">Site en maintenance</label><br>
  118. </span>
  119. <h5>Maintenance :</h5>
  120. <div class="clear"></div>
  121. <textarea data-type="wysiwyg" name="maintenance-content" id="maintenance-content" cols="30" rows="3" class="form-control">
  122. <?php echo file_exists('enabled.maintenance') ? file_get_contents('enabled.maintenance') : (file_exists('disabled.maintenance') ? file_get_contents('disabled.maintenance') : ''); ?>
  123. </textarea>
  124. </div>
  125. </div>
  126. </div>
  127. <?php endif; ?>
  128. </div>
  129. </div>
  130. <br>