]> git.p6c8.net - jirafeau_project.git/blob - index.php
Fix error checks
[jirafeau_project.git] / index.php
1 <?php
2 /*
3 * Jirafeau, your web file repository
4 * Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/');
20
21 require (JIRAFEAU_ROOT . 'lib/config.php');
22 require (JIRAFEAU_ROOT . 'lib/settings.php');
23 require (JIRAFEAU_ROOT . 'lib/functions.php');
24 require (JIRAFEAU_ROOT . 'lib/lang.php');
25 require (JIRAFEAU_ROOT . 'lib/template/header.php');
26
27 check_errors ();
28 if (has_error ())
29 {
30 show_errors ();
31 require (JIRAFEAU_ROOT . 'lib/template/footer.php');
32 exit;
33 }
34 ?>
35 <div id="upload_finished">
36 <p>
37 <?php echo t('File uploaded! Copy the following URL to get it') ?>:
38 <br />
39 <a id="upload_link" href=""></a>
40 <br />
41 </p>
42
43 <p>
44 <?php echo t('Keep the following URL to delete it at any moment'); ?>:
45 <br />
46 <a id="delete_link" href=""></a>
47 </p>
48
49 <p id="validity">
50 <?php echo t('This file is valid until the following date'); ?>:
51 <br /><strong><div id="date"></div></strong>
52 </p>
53 </div>
54
55 <div id="uploading">
56 <p>
57 <?php echo t ('Uploading ...'); ?><div id="uploaded_percentage"></div>
58 </p>
59 </div>
60
61 <div id="upload">
62 <legend>
63 <?php echo t('Select a file'); ?> :
64 </legend>
65 <p>
66 <input type="file" id="file_select" size="30"
67 onchange="
68 document.getElementById('options').style.display = '';
69 document.getElementById('send').style.display = '';
70 "/>
71 </p>
72 <p class="config">
73 <?php echo t('Maximum file size') . ': ' . jirafeau_get_max_upload_size (); ?>
74 </p>
75 <p>
76 <input type="submit" id="send" value="<?php echo t('Send'); ?>"
77 onclick="
78 document.getElementById('upload').style.display = 'none';
79 document.getElementById('uploading').style.display = '';
80 start_upload('<?php echo $cfg['web_root']; ?>');
81 "/>
82 </p>
83 <div id="options">
84 <table id="option_table">
85 <tr>
86 <td><?php echo t('One time download'); ?>:</td>
87 <td><input type="checkbox" id="one_time_download" /></td>
88 </tr>
89 <tr>
90 <td><label for="input_key"><?php echo t('Password') . ':'; ?></label></td>
91 <td><input type="text" name="key" id="input_key" /></td>
92 </tr>
93 <tr>
94 <td><label for="select_time"><?php echo t('Time limit') . ':'; ?></label></td>
95 <td><select name="time" id="select_time">
96 <option value="none"><?php echo t('None'); ?></option>
97 <option value = "minute"><?php echo t('One minute'); ?></option>
98 <option value = "hour"><?php echo t('One hour'); ?></option>
99 <option value = "day"><?php echo t('One day'); ?></option>
100 <option value = "week"><?php echo t('One week'); ?></option>
101 <option value = "month"><?php echo t('One month');?></option>
102 </select></td>
103 </tr>
104 </table>
105 </div>
106 </div>
107 <script lang="Javascript">
108 document.getElementById('uploading').style.display = 'none';
109 document.getElementById('upload_finished').style.display = 'none';
110 document.getElementById('options').style.display = 'none';
111 document.getElementById('send').style.display = 'none';
112 </script>
113 <?php require (JIRAFEAU_ROOT . 'lib/template/footer.php'); ?>

patrick-canterino.de