diff --git a/admin/index.php b/admin/index.php index 2d98b7e754ab3d3fd2ef7bf49c284d23efbd284f..28014efd8db206ea7f14ed8d01f95175ba03872b 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,5 +1,24 @@ <?php +/** + * This software is governed by the CeCILL-B license. If a copy of this license + * is not distributed with this file, you can obtain one at + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * + * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ + * Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft) + * + * ============================= + * + * Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence + * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * + * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ + * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) + */ + require_once '../app/inc/init.php'; $smarty->assign('title', _('Administration')); +$smarty->assign('logsAreReadable', is_readable('../' . LOG_FILE)); $smarty->display('admin/index.tpl'); \ No newline at end of file diff --git a/admin/logs.php b/admin/logs.php new file mode 100644 index 0000000000000000000000000000000000000000..e4be44d96e51a2c99afcc85edba5b70c16aa9f4e --- /dev/null +++ b/admin/logs.php @@ -0,0 +1,28 @@ +<?php +/** + * This software is governed by the CeCILL-B license. If a copy of this license + * is not distributed with this file, you can obtain one at + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * + * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ + * Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft) + * + * ============================= + * + * Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence + * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * + * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ + * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) + */ + +require_once '../app/inc/init.php'; + +ob_start(); +is_readable('../' . LOG_FILE) ? readfile('../' . LOG_FILE) : null; +$content = ob_get_clean(); + +$smarty->assign('title', _('Administration')); +$smarty->assign('logs', $content); +$smarty->display('admin/logs.tpl'); \ No newline at end of file diff --git a/admin/migration.php b/admin/migration.php index cade588b9442a91d0477274263d18d05eb1df074..8bb2d3e6f2e439ada6fbc7bff39352e0d87d0486 100644 --- a/admin/migration.php +++ b/admin/migration.php @@ -1,4 +1,22 @@ <?php +/** + * This software is governed by the CeCILL-B license. If a copy of this license + * is not distributed with this file, you can obtain one at + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt + * + * Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ + * Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft) + * + * ============================= + * + * Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence + * ne se trouve pas avec ce fichier vous pouvez l'obtenir sur + * http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt + * + * Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ + * Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft) + */ + use Framadate\Migration\From_0_0_to_0_8_Migration; use Framadate\Migration\From_0_8_to_0_9_Migration; use Framadate\Migration\From_0_9_to_0_9_1_Migration; diff --git a/admin/polls.php b/admin/polls.php index 71502e5b29f4243eac36f636f8fcbd1262e8eab0..57c1270094aa308d93eee8c60755443831743fdf 100644 --- a/admin/polls.php +++ b/admin/polls.php @@ -73,7 +73,6 @@ $smarty->assign('count', $count); $smarty->assign('page', $page); $smarty->assign('pages', ceil($count / POLLS_PER_PAGE)); $smarty->assign('poll_to_delete', $poll_to_delete); -$smarty->assign('log_file', is_readable('../' . LOG_FILE) ? LOG_FILE : null); $smarty->assign('crsf', $securityService->getToken('admin')); $smarty->display('admin/polls.tpl'); diff --git a/tpl/admin/index.tpl b/tpl/admin/index.tpl index 11bf4b7bb0e6a6f2f783dec4428d693180329204..26841f3c30ac71480129d4597e88f354ff9a4eac 100644 --- a/tpl/admin/index.tpl +++ b/tpl/admin/index.tpl @@ -8,5 +8,10 @@ <div class="col-md-6 col-xs-12"> <a href="./migration.php"><h2>{_('Migration')}</h2></a> </div> + {if $logsAreReadable} + <div class="col-md-6 col-xs-12"> + <a href="./logs.php"><h2>{_('Logs')}</h2></a> + </div> + {/if} </div> {/block} \ No newline at end of file diff --git a/tpl/admin/logs.tpl b/tpl/admin/logs.tpl new file mode 100644 index 0000000000000000000000000000000000000000..51eec0afe808962f8ecb45fe38dc54d34f91029e --- /dev/null +++ b/tpl/admin/logs.tpl @@ -0,0 +1,5 @@ +{extends 'admin/admin_page.tpl'} + +{block 'admin_main'} +<pre>{$logs}</pre> +{/block} \ No newline at end of file diff --git a/tpl/admin/polls.tpl b/tpl/admin/polls.tpl index 59414b00b45a260bd36a8324b5442909b3cd1f7a..58d442f754a638908767c27d079c4c053cef4d00 100644 --- a/tpl/admin/polls.tpl +++ b/tpl/admin/polls.tpl @@ -19,9 +19,6 @@ <div class="panel panel-default"> <div class="panel-heading"> {$polls|count} {_('polls in the database at this time')} - {if $log_file} - <a role="button" class="btn btn-default btn-xs pull-right" href="{$log_file|resource}">{_('Logs')}</a> - {/if} </div>