<?php
/*
* Jirafeau, your web file repository
- * Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
+ * Copyright (C) 2015 Jerome Jutteau <jerome@jutteau.fr>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* Be sure PHP's safe mode is off.
*/
@set_time_limit(0);
- /* Remove errors. */
- @error_reporting(0);
/* Show admin interface if not downloading a file. */
if (!(isset($_POST['action']) && strcmp($_POST['action'], 'download') == 0)) {
</td>
</tr>
</form>
+ <form method="post">
+ <tr>
+ <input type = "hidden" name = "action" value = "size"/>
+ <?php echo jirafeau_admin_csrf_field() ?>
+ <td class = "info">
+ <?php echo t('SIZE_DATA'); ?>
+ </td>
+ <td></td>
+ <td>
+ <input type = "submit" value = "<?php echo t('SIZE'); ?>" />
+ </td>
+ </tr>
+ </form>
<form method="post">
<tr>
<input type = "hidden" name = "action" value = "search_by_name"/>
echo '<p>';
echo t('CLEANED_FILES_CNT') . ' : ' . $total;
echo '</p></div>';
+ } elseif (strcmp($_POST['action'], 'size') == 0) {
+ $size = jirafeau_dir_size($cfg['var_root']);
+ $human_size = jirafeau_human_size($size);
+ echo '<div class="message">' . NL;
+ echo '<p>' . t('SIZE_DATA') . ': ' . $human_size .'</p>';
+ echo '</div>';
} elseif (strcmp($_POST['action'], 'list') == 0) {
jirafeau_admin_list("", "", "");
} elseif (strcmp($_POST['action'], 'search_by_name') == 0) {
$r = fopen(VAR_FILES . $p . $l['hash'], 'r');
while (!feof($r)) {
print fread($r, 1024);
- ob_flush();
}
fclose($r);
}