1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jirafeau_ynh.git synced 2024-09-03 19:35:53 +02:00

[enh] update jirafeau version to 71f70e201e53baf6936fad1dc00b87c2c50e8c3d

This commit is contained in:
Julien Malik 2015-03-22 18:49:31 +01:00
parent b6402f1122
commit 311e57b056
34 changed files with 1777 additions and 1578 deletions

30
sources/NEWCOMER.txt Normal file
View file

@ -0,0 +1,30 @@
Hi,
This document is only made for newcomers in Jirafeau who are digging into
the code.
Here is a little explaination of Jirafeau's arboresence in a simplified
view only to show the most importants files and their role.
.
├── admin.php : adminitration interface, also permits to download files
├── f.php : permits to download files or show the download page
├── index.php : only provide a html/javascript client to interact with API
├── script.php : API interface and it's html documentation
├── install.php : installation script
├── tos.php : terms of use the user may edit
├── lib
│   ├── config.local.php : user's parameters
│   ├── config.original.php : default parameters with their documentation
│   ├── functions_*.js : javascript functions for html/javascript client
│   ├── functions.php : core functions and tools of jirafeau
│   ├── lang : langage folder, contain all langage files
│   └── template
│   ├── footer.php
│   └── header.php
├── media : folder containing all skins
└── var-xxxxxxx : folder containing all data
├── async : chunks of uploaded files
├── files : all files that has been successfully uploaded
└── links : all links pointing to files with meta-informations

12
sources/README.txt Normal file
View file

@ -0,0 +1,12 @@
Any project would be sad without it's README file :)
Jirafeau is a web site permitting to upload a file in a simple way and give
an unique link to it.
Jirafeau is an Open-Source project under AGPL v3 license (see COPYING file)
To install Jirafeau project, just open your browser and go to /install.php
For more informations on Jirafeau project, go to it's web page:
https://gitlab.com/mojo42/Jirafeau/wikis/home

99
sources/admin.php Executable file → Normal file
View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Jirafeau, your web file repository * Jirafeau, your web file repository
* Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com> * Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
@ -32,26 +32,8 @@ if (file_exists (JIRAFEAU_ROOT . 'install.php')
exit; exit;
} }
/* Check if the install.php script is still in the directory. */
if (file_exists (JIRAFEAU_ROOT . 'install.php'))
{
require (JIRAFEAU_ROOT . 'lib/template/header.php');
echo '<div class="error"><p>'.
t('Installer script still present') .
'</p></div>';
require (JIRAFEAU_ROOT.'lib/template/footer.php');
exit;
}
if (!$cfg['admin_user'] || $_SERVER['PHP_AUTH_USER'] != $cfg['admin_user'])
{
header('Location: index.php');
exit;
}
/* Disable admin interface if we have a empty admin password. */ /* Disable admin interface if we have a empty admin password. */
/* if (empty($cfg['admin_password']) && empty($cfg['admin_http_auth_user']))
if (!$cfg['admin_password'])
{ {
require (JIRAFEAU_ROOT . 'lib/template/header.php'); require (JIRAFEAU_ROOT . 'lib/template/header.php');
echo '<div class="error"><p>'. echo '<div class="error"><p>'.
@ -60,22 +42,16 @@ if (!$cfg['admin_password'])
require (JIRAFEAU_ROOT.'lib/template/footer.php'); require (JIRAFEAU_ROOT.'lib/template/footer.php');
exit; exit;
} }
*/
/* Check session. */ /* Check session. */
/*
session_start(); session_start();
*/
/* Unlog if asked. */ /* Unlog if asked. */
/*
if (isset ($_POST['action']) && (strcmp ($_POST['action'], 'logout') == 0)) if (isset ($_POST['action']) && (strcmp ($_POST['action'], 'logout') == 0))
$_SESSION['admin_auth'] = false; $_SESSION['admin_auth'] = false;
*/
/* Check password. */ /* Check classic admin password authentification. */
/* if (isset ($_POST['admin_password']) && empty($cfg['admin_http_auth_user']))
if (isset ($_POST['admin_password']))
{ {
if (strcmp ($cfg['admin_password'], $_POST['admin_password']) == 0) if (strcmp ($cfg['admin_password'], $_POST['admin_password']) == 0)
$_SESSION['admin_auth'] = true; $_SESSION['admin_auth'] = true;
@ -89,11 +65,9 @@ if (isset ($_POST['admin_password']))
exit; exit;
} }
} }
*/ /* Ask for classic admin password authentification. */
elseif ((!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
/* Ask for password. */ && empty($cfg['admin_http_auth_user']))
/*
elseif (!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
{ {
require (JIRAFEAU_ROOT . 'lib/template/header.php'); ?> require (JIRAFEAU_ROOT . 'lib/template/header.php'); ?>
<form action = "<?php echo basename(__FILE__); ?>" method = "post"> <form action = "<?php echo basename(__FILE__); ?>" method = "post">
@ -122,7 +96,25 @@ elseif (!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
require (JIRAFEAU_ROOT.'lib/template/footer.php'); require (JIRAFEAU_ROOT.'lib/template/footer.php');
exit; exit;
} }
*/ /* Check authenticated user if HTTP authentification is enable. */
elseif ((!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
&& !empty($cfg['admin_http_auth_user']))
{
if ($cfg['admin_http_auth_user'] == $_SERVER['PHP_AUTH_USER'])
$_SESSION['admin_auth'] = true;
}
/* Be sure that no one can access further without admin_auth. */
if (!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
{
$_SESSION['admin_auth'] = false;
require (JIRAFEAU_ROOT . 'lib/template/header.php');
echo '<div class="error"><p>'.
t('Sorry, you are not authenticated on admin interface.') .
'</p></div>';
require (JIRAFEAU_ROOT.'lib/template/footer.php');
exit;
}
/* Operations may take a long time. /* Operations may take a long time.
* Be sure PHP's safe mode is off. * Be sure PHP's safe mode is off.
@ -131,12 +123,12 @@ elseif (!isset ($_SESSION['admin_auth']) || $_SESSION['admin_auth'] != true)
/* Remove errors. */ /* Remove errors. */
@error_reporting(0); @error_reporting(0);
/* Admin interface. */ /* Show admin interface if not downloading a file. */
require (JIRAFEAU_ROOT . 'lib/template/header.php'); if (!(isset ($_POST['action']) && strcmp ($_POST['action'], 'download') == 0))
?><h2><?php echo t('Admin interface'); ?></h2><?php
/* Show admin interface. */
{ {
require (JIRAFEAU_ROOT . 'lib/template/header.php');
?><h2><?php echo t('Admin interface'); ?></h2><?php
?><div id = "install"> ?><div id = "install">
<fieldset><legend><?php echo t('Actions');?></legend> <fieldset><legend><?php echo t('Actions');?></legend>
<table> <table>
@ -164,26 +156,6 @@ require (JIRAFEAU_ROOT . 'lib/template/header.php');
</td> </td>
</tr> </tr>
</form> </form>
<?php
if ($cfg['enable_blocks'])
{
?>
<form action = "<?php echo basename(__FILE__); ?>" method = "post">
<tr>
<input type = "hidden" name = "action" value = "clean_block"/>
<td class = "info">
<?php echo t('Clean unused blocks'); ?>
</td>
<td></td>
<td>
<input type = "submit" value = "<?php echo t('Clean'); ?>" />
</td>
</tr>
</form>
<?php
}
?>
<form action = "<?php echo basename(__FILE__); ?>" method = "post"> <form action = "<?php echo basename(__FILE__); ?>" method = "post">
<tr> <tr>
<input type = "hidden" name = "action" value = "list"/> <input type = "hidden" name = "action" value = "list"/>
@ -265,14 +237,6 @@ if (isset ($_POST['action']))
echo t('Number of cleaned files') . ' : ' . $total; echo t('Number of cleaned files') . ' : ' . $total;
echo '</p></div>'; echo '</p></div>';
} }
elseif (strcmp ($_POST['action'], 'clean_block') == 0)
{
$total = jirafeau_admin_clean_block ();
echo '<div class="message">' . NL;
echo '<p>';
echo t('Number of cleaned files') . ' : ' . $total;
echo '</p></div>';
}
elseif (strcmp ($_POST['action'], 'list') == 0) elseif (strcmp ($_POST['action'], 'list') == 0)
{ {
jirafeau_admin_list ("", "", ""); jirafeau_admin_list ("", "", "");
@ -313,6 +277,7 @@ if (isset ($_POST['action']))
$l['file_name'] . '"'); $l['file_name'] . '"');
if (file_exists(VAR_FILES . $p . $l['md5'])) if (file_exists(VAR_FILES . $p . $l['md5']))
readfile (VAR_FILES . $p . $l['md5']); readfile (VAR_FILES . $p . $l['md5']);
exit;
} }
} }

View file

@ -2,7 +2,7 @@
/* /*
* Jirafeau, your web file repository * Jirafeau, your web file repository
* Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org> * Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org>
* Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com> * Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
@ -58,20 +58,20 @@ if (count ($link) == 0)
} }
$delete_code = ''; $delete_code = '';
if (isset ($_GET['d']) && !empty ($_GET['d'])) if (isset ($_GET['d']) && !empty ($_GET['d']) && $_GET['d'] != '1')
$delete_code = $_GET['d']; $delete_code = $_GET['d'];
$crypt_key = ''; $crypt_key = '';
if (isset ($_GET['k']) && !empty ($_GET['k'])) if (isset ($_GET['k']) && !empty ($_GET['k']))
$crypt_key = $_GET['k']; $crypt_key = $_GET['k'];
$button_download = false; $do_download = false;
if (isset ($_GET['bd']) && !empty ($_GET['bd'])) if (isset ($_GET['d']) && $_GET['d'] == '1')
$button_download = true; $do_download = true;
$button_preview = false; $do_preview = false;
if (isset ($_GET['bp']) && !empty ($_GET['bp'])) if (isset ($_GET['p']) && !empty ($_GET['p']))
$button_preview = true; $do_preview = true;
$p = s2p ($link['md5']); $p = s2p ($link['md5']);
if (!file_exists (VAR_FILES . $p . $link['md5'])) if (!file_exists (VAR_FILES . $p . $link['md5']))
@ -140,21 +140,21 @@ if (!empty ($link['key']))
?><input type="submit" id = "submit_download" value="<?php echo t('Download'); ?>" ?><input type="submit" id = "submit_download" value="<?php echo t('Download'); ?>"
onclick="document.getElementById('submit').action=' onclick="document.getElementById('submit').action='
<?php <?php
echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;bd=1'; echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;d=1';
if (!empty($crypt_key)) if (!empty($crypt_key))
echo '&amp;k=' . urlencode($crypt_key); echo '&amp;k=' . urlencode($crypt_key);
?>'; ?>';
document.getElementById('submit_download').submit ();"/><?php document.getElementById('submit_download').submit ();"/><?php
if ($cfg['download_page'] && $cfg['preview']) if ($cfg['download_page'] && $cfg['preview'] && jirafeau_is_viewable($link['mime_type']))
{ {
?><input type="submit" id = "submit_preview" value="<?php echo t('Preview'); ?>" ?><input type="submit" id = "submit_preview" value="<?php echo t('Preview'); ?>"
onclick="document.getElementById('submit').action=' onclick="document.getElementById('submit').action='
<?php <?php
echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;bp=1'; echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;p=1';
if (!empty($crypt_key)) if (!empty($crypt_key))
echo '&amp;k=' . urlencode($crypt_key); echo '&amp;k=' . urlencode($crypt_key);
?>'; ?>';
document.getElementById('submit_preview').submit ();"/><?php document.getElementById('submit_preview').submit ();"/><?php
} }
echo '</td></tr></table></fieldset></form></div>'; echo '</td></tr></table></fieldset></form></div>';
require (JIRAFEAU_ROOT.'lib/template/footer.php'); require (JIRAFEAU_ROOT.'lib/template/footer.php');
@ -176,7 +176,7 @@ if (!empty ($link['key']))
} }
} }
if ($cfg['download_page'] && !$password_challenged && !$button_download && !$button_preview) if ($cfg['download_page'] && !$password_challenged && !$do_download && !$do_preview)
{ {
require (JIRAFEAU_ROOT.'lib/template/header.php'); require (JIRAFEAU_ROOT.'lib/template/header.php');
echo '<div>' . echo '<div>' .
@ -194,18 +194,18 @@ if ($cfg['download_page'] && !$password_challenged && !$button_download && !$but
?></td></tr><tr><td><input type="submit" id = "submit_download" value="<?php echo t('Download'); ?>" ?></td></tr><tr><td><input type="submit" id = "submit_download" value="<?php echo t('Download'); ?>"
onclick="document.getElementById('submit').action=' onclick="document.getElementById('submit').action='
<?php <?php
echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;bd=1'; echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;d=1';
if (!empty($crypt_key)) if (!empty($crypt_key))
echo '&amp;k=' . urlencode($crypt_key); echo '&amp;k=' . urlencode($crypt_key);
?>'; ?>';
document.getElementById('submit_download').submit ();"/><?php document.getElementById('submit_download').submit ();"/><?php
if ($cfg['download_page'] && $cfg['preview']) if ($cfg['download_page'] && $cfg['preview'] && jirafeau_is_viewable($link['mime_type']))
{ {
?><input type="submit" id = "submit_preview" value="<?php echo t('Preview'); ?>" ?><input type="submit" id = "submit_preview" value="<?php echo t('Preview'); ?>"
onclick="document.getElementById('submit').action=' onclick="document.getElementById('submit').action='
<?php <?php
echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;bp=1'; echo $cfg['web_root'] . '/f.php?h=' . $link_name . '&amp;p=1';
if (!empty($crypt_key)) if (!empty($crypt_key))
echo '&amp;k=' . urlencode($crypt_key); echo '&amp;k=' . urlencode($crypt_key);
?>'; ?>';
@ -219,11 +219,10 @@ if ($cfg['download_page'] && !$password_challenged && !$button_download && !$but
header ('HTTP/1.0 200 OK'); header ('HTTP/1.0 200 OK');
header ('Content-Length: ' . $link['file_size']); header ('Content-Length: ' . $link['file_size']);
if (!jirafeau_is_viewable ($link['mime_type']) || !$cfg['preview'] || $button_download) if (!jirafeau_is_viewable ($link['mime_type']) || !$cfg['preview'] || $do_download)
header ('Content-Disposition: attachment; filename="' . header ('Content-Disposition: attachment; filename="' .
$link['file_name'] . '"'); $link['file_name'] . '"');
else header ('Content-Type: ' . $link['mime_type']);
header ('Content-Type: ' . $link['mime_type']);
/* Read encrypted file. */ /* Read encrypted file. */
if ($link['crypted']) if ($link['crypted'])

117
sources/index.php Executable file → Normal file
View file

@ -26,7 +26,7 @@ require (JIRAFEAU_ROOT . 'lib/functions.php');
require (JIRAFEAU_ROOT . 'lib/lang.php'); require (JIRAFEAU_ROOT . 'lib/lang.php');
require (JIRAFEAU_ROOT . 'lib/template/header.php'); require (JIRAFEAU_ROOT . 'lib/template/header.php');
check_errors (); check_errors ($cfg);
if (has_error ()) if (has_error ())
{ {
show_errors (); show_errors ();
@ -35,19 +35,22 @@ if (has_error ())
} }
/* Ask password if upload password is set. */ /* Ask password if upload password is set. */
if (strlen ($cfg['upload_password']) > 0) if (jirafeau_has_upload_password ($cfg))
{ {
session_start(); session_start();
/* Unlog if asked. */ /* Unlog if asked. */
if (isset ($_POST['action']) && (strcmp ($_POST['action'], 'logout') == 0)) if (isset ($_POST['action']) && (strcmp ($_POST['action'], 'logout') == 0))
$_SESSION['upload_auth'] = false; session_unset ();
/* Auth. */ /* Auth. */
if (isset ($_POST['upload_password'])) if (isset ($_POST['upload_password']))
{ {
if (strcmp ($cfg['upload_password'], $_POST['upload_password']) == 0) if (jirafeau_challenge_upload_password ($cfg, $_POST['upload_password']))
{
$_SESSION['upload_auth'] = true; $_SESSION['upload_auth'] = true;
$_SESSION['user_upload_password'] = $_POST['upload_password'];
}
else else
{ {
$_SESSION['admin_auth'] = false; $_SESSION['admin_auth'] = false;
@ -91,18 +94,40 @@ if (strlen ($cfg['upload_password']) > 0)
?> ?>
<div id="upload_finished"> <div id="upload_finished">
<p> <p><?php echo t('File uploaded !') ?></p>
<?php echo t('File uploaded! Copy the following URL to get it') ?>:
<br /> <br />
<a id="upload_link" href=""></a>
<br />
</p>
<p> <?php if ($cfg['download_page'] == true) { ?>
<?php echo t('Keep the following URL to delete it at any moment'); ?>: <div id="upload_finished_download_page">
<?php echo t('Download page') ?>
<p><a id="upload_link" href=""></a></p>
<br />
</div>
<?php } ?>
<div id="upload_password_page">
<p><?php echo t('Download page') ?>:</p>
<p><a id="password_link" href=""></a></p>
<br />
</div>
<?php if ($cfg['preview'] == true) { ?>
<div id="upload_finished_preview">
<p><?php echo t('View link') ?>:</p>
<p><a id="preview_link" href=""></a></p>
<br />
</div>
<?php } ?>
<div id="upload_direct_download">
<p><?php echo t('Direct download link') ?>:</p>
<p><a id="direct_link" href=""></a></p>
<br />
</div>
<p><?php echo t('Delete link') ?>:</p>
<p><a id="delete_link" href=""></a></p>
<br /> <br />
<a id="delete_link" href=""></a>
</p>
<p id="validity"> <p id="validity">
<?php echo t('This file is valid until the following date'); ?>: <?php echo t('This file is valid until the following date'); ?>:
@ -112,10 +137,16 @@ if (strlen ($cfg['upload_password']) > 0)
<div id="uploading"> <div id="uploading">
<p> <p>
<?php echo t ('Uploading ...'); ?><div id="uploaded_percentage"></div> <?php echo t ('Uploading ...'); ?>
<div id="uploaded_percentage"></div>
<div id="uploaded_speed"></div>
<div id="uploaded_time"></div>
</p> </p>
</div> </div>
<div id="error_pop" class="error">
</div>
<div id="upload"> <div id="upload">
<fieldset> <fieldset>
<legend> <legend>
@ -123,12 +154,9 @@ if (strlen ($cfg['upload_password']) > 0)
</legend> </legend>
<p> <p>
<input type="file" id="file_select" size="30" <input type="file" id="file_select" size="30"
onchange=" onchange="control_selected_file_size(<?php echo $cfg['maximal_upload_size'] ?>, '<?php echo t ('File is too big') . ', ' . t ('File size is limited to') . " " . $cfg['maximal_upload_size'] . " MB"; ?>')"/>
document.getElementById('options').style.display = '';
document.getElementById('send').style.display = '';
"/>
</p> </p>
<div id="options"> <div id="options">
<table id="option_table"> <table id="option_table">
<tr> <tr>
@ -142,18 +170,54 @@ if (strlen ($cfg['upload_password']) > 0)
<tr> <tr>
<td><label for="select_time"><?php echo t('Time limit') . ':'; ?></label></td> <td><label for="select_time"><?php echo t('Time limit') . ':'; ?></label></td>
<td><select name="time" id="select_time"> <td><select name="time" id="select_time">
<?php if ($cfg['availabilities']['none']) { ?>
<option value="none"><?php echo t('None'); ?></option> <option value="none"><?php echo t('None'); ?></option>
<option value = "minute"><?php echo t('One minute'); ?></option> <?php } ?>
<option value = "hour"><?php echo t('One hour'); ?></option> <?php if ($cfg['availabilities']['year']) { ?>
<option value = "day"><?php echo t('One day'); ?></option> <option value = "year"><?php echo t('One year');?></option>
<option value = "week"><?php echo t('One week'); ?></option> <?php } ?>
<?php if ($cfg['availabilities']['month']) { ?>
<option value = "month"><?php echo t('One month');?></option> <option value = "month"><?php echo t('One month');?></option>
<?php } ?>
<?php if ($cfg['availabilities']['week']) { ?>
<option value = "week"><?php echo t('One week'); ?></option>
<?php } ?>
<?php if ($cfg['availabilities']['day']) { ?>
<option value = "day"><?php echo t('One day'); ?></option>
<?php } ?>
<?php if ($cfg['availabilities']['hour']) { ?>
<option value = "hour"><?php echo t('One hour'); ?></option>
<?php } ?>
<?php if ($cfg['availabilities']['minute']) { ?>
<option value = "minute"><?php echo t('One minute'); ?></option>
<?php } ?>
</select></td> </select></td>
</tr> </tr>
<?php
if ($cfg['maximal_upload_size'] > 0)
{
echo '<p class="config">' . t ('File size is limited to');
echo " " . $cfg['maximal_upload_size'] . " MB</p>";
}
?>
<p id="max_file_size" class="config"></p> <p id="max_file_size" class="config"></p>
<p> <p>
<?php
<input type="hidden" id="upload_password" name="upload_password" value="<?php echo $cfg['upload_password']?>"/> if (jirafeau_has_upload_password ($cfg) && $_SESSION['upload_auth'])
{
?>
<input type="hidden" id="upload_password" name="upload_password" value="<?php echo $_SESSION['user_upload_password'] ?>"/>
<?php
}
else
{
?>
<input type="hidden" id="upload_password" name="upload_password" value=""/>
<?php
}
?>
<input type="submit" id="send" value="<?php echo t('Send'); ?>" <input type="submit" id="send" value="<?php echo t('Send'); ?>"
onclick=" onclick="
document.getElementById('upload').style.display = 'none'; document.getElementById('upload').style.display = 'none';
@ -165,7 +229,7 @@ if (strlen ($cfg['upload_password']) > 0)
</div> </fieldset> </div> </fieldset>
<?php <?php
if (strlen ($cfg['upload_password']) > 0) if (jirafeau_has_upload_password ($cfg))
{ {
?> ?>
<form action = "<?php echo basename(__FILE__); ?>" method = "post"> <form action = "<?php echo basename(__FILE__); ?>" method = "post">
@ -179,6 +243,7 @@ if (strlen ($cfg['upload_password']) > 0)
</div> </div>
<script lang="Javascript"> <script lang="Javascript">
document.getElementById('error_pop').style.display = 'none';
document.getElementById('uploading').style.display = 'none'; document.getElementById('uploading').style.display = 'none';
document.getElementById('upload_finished').style.display = 'none'; document.getElementById('upload_finished').style.display = 'none';
document.getElementById('options').style.display = 'none'; document.getElementById('options').style.display = 'none';

14
sources/install.php Executable file → Normal file
View file

@ -23,6 +23,7 @@ define ('QUOTE', "'");
define ('JIRAFEAU_CFG', JIRAFEAU_ROOT.'lib/config.local.php'); define ('JIRAFEAU_CFG', JIRAFEAU_ROOT.'lib/config.local.php');
define ('JIRAFEAU_VAR_RAND_LENGTH', 15); define ('JIRAFEAU_VAR_RAND_LENGTH', 15);
require (JIRAFEAU_ROOT . 'lib/functions.php');
require (JIRAFEAU_ROOT . 'lib/lang.php'); require (JIRAFEAU_ROOT . 'lib/lang.php');
require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/config.original.php');
@ -51,6 +52,9 @@ jirafeau_export_cfg ($cfg)
fwrite ($handle, jirafeau_quoted ($item)); fwrite ($handle, jirafeau_quoted ($item));
else if (is_int ($item)) else if (is_int ($item))
fwrite ($handle, $item); fwrite ($handle, $item);
else if (is_array ($item))
fwrite ($handle, str_replace(array("\n", "\r"), "",
var_export ($item, true)));
else else
fwrite ($handle, 'null'); fwrite ($handle, 'null');
fwrite ($handle, ';'.NL); fwrite ($handle, ';'.NL);
@ -97,7 +101,7 @@ jirafeau_check_var_dir ($path)
$path . '</code><br />' . $solution_str . $path . '</code><br />' . $solution_str .
'<br />' . $mkdir_str2); '<br />' . $mkdir_str2);
foreach (array ('files', 'links', 'async', 'block') as $subdir) foreach (array ('files', 'links', 'async') as $subdir)
{ {
$subpath = $path.$subdir; $subpath = $path.$subdir;
@ -117,6 +121,12 @@ jirafeau_add_ending_slash ($path)
return $path . ((substr ($path, -1) == '/') ? '' : '/'); return $path . ((substr ($path, -1) == '/') ? '' : '/');
} }
if ($cfg['installation_done'] === true)
{
header('Location: index.php');
exit;
}
if (!file_exists (JIRAFEAU_CFG)) if (!file_exists (JIRAFEAU_CFG))
{ {
/* We try to create an empty one. */ /* We try to create an empty one. */
@ -349,6 +359,8 @@ case 4:
} }
else else
{ {
$cfg['installation_done'] = true;
jirafeau_export_cfg ($cfg);
echo '<div class="message"><p>' . echo '<div class="message"><p>' .
t('Jirafeau is now fully operational') . ':' . t('Jirafeau is now fully operational') . ':' .
'<br /><a href="' . $cfg['web_root'] . '">' . '<br /><a href="' . $cfg['web_root'] . '">' .

View file

@ -2,6 +2,7 @@
/* /*
* Jirafeau, your web file repository * Jirafeau, your web file repository
* Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org> * Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org>
* Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
@ -21,40 +22,72 @@
* default configuration * default configuration
* if you want to change this, overwrite in a config.local.php file * if you want to change this, overwrite in a config.local.php file
*/ */
global $cfg; global $cfg;
/* don't forget the ending '/' */ /* Don't forget the ending '/' */
$cfg['web_root'] = ''; $cfg['web_root'] = '';
$cfg['var_root'] = ''; $cfg['var_root'] = '';
/* Lang choice between 'auto', 'en' and 'fr'. /* Lang choice between 'auto', 'en' and 'fr'.
'auto' mode will take the user's browser informations. Will take english if * 'auto' mode will take the user's browser informations.
user's langage is not available. * Will take english if user's langage is not available.
*/ */
$cfg['lang'] = 'auto'; $cfg['lang'] = 'auto';
$cfg['style'] = 'modern'; /* Select your style :) See media folder */
$cfg['rewrite'] = false; $cfg['style'] = 'courgette';
/* An empty admin password will disable the admin interface. */ /* Propose a preview link if file type is previewable is set to true. */
$cfg['admin_password'] = '';
/* preview: false (will download file) or true (will preview in browser if
* possible) . */
$cfg['preview'] = true; $cfg['preview'] = true;
/* Download page: /* Download page: propose a link to a download page is set to true. */
* true: Will show a download page (with preview if permited and possible). $cfg['download_page'] = true;
* false: Will directly download file or preview (if permited and possible). */
$cfg['download_page'] = false;
/* Block feature:
The scripting interface can propose to create, read, write, delete blocks
of data. */
$cfg['enable_blocks'] = false;
/* Encryption feature. disable it by default. /* Encryption feature. disable it by default.
* By enabling it, file-level deduplication won't work. */ * By enabling it, file-level deduplication won't work.
*/
$cfg['enable_crypt'] = false; $cfg['enable_crypt'] = false;
/* Split lenght of link refenrece. */ /* Split lenght of link refenrece. */
$cfg['link_name_lenght'] = 8; $cfg['link_name_lenght'] = 8;
/* Upload password. Empty string disable the password. */ /* Upload password(s). Empty array disable password authentification.
$cfg['upload_password'] = ''; * $cfg['upload_password'] = array(); // No password
* $cfg['upload_password'] = array('psw1'); // One password
* $cfg['upload_password'] = array('psw1', 'psw2'); // Two passwords
* ... and so on
*/
$cfg['upload_password'] = array();
/* An empty admin password will disable the classic admin password
* authentication.
*/
$cfg['admin_password'] = '';
/* If set, let's the user to be authenticated as administrator.
* The user provided here is the user authenticated by HTTP authentication.
* Note that Jirafeau does not manage the HTTP login part, it just check
* that the provided user is logged.
* If admin_password parameter is also set, admin_password is ignored.
*/
$cfg['admin_http_auth_user'] = '';
/* Select different options for availability of uploaded files.
* Possible values in array:
* 'minute': file is available for one minute
* 'hour': file available for one hour
* 'day': file available for one day
* 'week': file available for one week
* 'month': file is available for one month
* 'year': file available for one year
* 'none': unlimited availability
*/
$cfg['availabilities'] = array ('minute' => true,
'hour' => true,
'day' => true,
'week' => true,
'month' => true,
'year' => false,
'none' => false);
/* Set maximal upload size expressed in MB.
* 0 mean unlimited upload size.
*/
$cfg['maximal_upload_size'] = 0;
/* Installation is done ? */
$cfg['installation_done'] = false;
/* Try to include user's local configuration. */
if ((basename (__FILE__) != 'config.local.php') if ((basename (__FILE__) != 'config.local.php')
&& file_exists (JIRAFEAU_ROOT.'lib/config.local.php')) && file_exists (JIRAFEAU_ROOT.'lib/config.local.php'))
{ {

View file

@ -1,301 +0,0 @@
/*
* Jirafeau, your web file repository
* Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function show_link (url, reference, delete_code, crypt_key, date)
{
var download_link = url + 'f.php?h=' + reference;
var download_link_href = url + 'f.php?h=' + reference;
if (crypt_key.length > 0)
{
download_link += '&amp;k=' + crypt_key;
download_link_href += '&k=' + crypt_key;
}
var delete_link = url + 'f.php?h=' + reference + '&amp;d=' + delete_code;
var delete_link_href = url + 'f.php?h=' + reference + '&d=' + delete_code;
document.getElementById('upload_link').innerHTML = download_link;
document.getElementById('upload_link').href = download_link_href;
document.getElementById('delete_link').innerHTML = delete_link;
document.getElementById('delete_link').href = delete_link_href;
if (date)
{
document.getElementById('date').innerHTML = date;
document.getElementById('validity').style.display = '';
}
else
document.getElementById('validity').style.display = 'none';
document.getElementById('uploading').style.display = 'none';
document.getElementById('upload').style.display = 'none';
document.getElementById('upload_finished').style.display = '';
document.title = 'Jirafeau - 100%';
}
function show_upload_progression (p)
{
document.getElementById('uploaded_percentage').innerHTML = p;
document.title = 'Jirafeau - ' + p;
}
function upload_progress (e)
{
if (!e.lengthComputable)
return;
/* Show the user the operation do not reach 100%, the server need time
* to give a response before providing the link.
*/
var p = Math.round (e.loaded * 100 / e.total);
if (p == 100)
show_upload_progression (' ');
else
show_upload_progression (p.toString() + '%');
}
function upload_failed (e)
{
/* Todo: Considere showing a error div. */
alert ('Sorry, upload failed');
}
function classic_upload (url, file, time, password, one_time, upload_password)
{
var req = new XMLHttpRequest ();
req.upload.addEventListener ("progress", upload_progress, false);
req.addEventListener ("error", upload_failed, false);
req.addEventListener ("abort", upload_failed, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
return;
res = res.split ("\n");
if (time != 'none')
{
var d = new Date();
if (time == 'minute')
d.setSeconds (d.getSeconds() + 60);
else if (time == 'hour')
d.setSeconds (d.getSeconds() + 3600);
else if (time == 'day')
d.setSeconds (d.getSeconds() + 86400);
else if (time == 'week')
d.setSeconds (d.getSeconds() + 604800);
else if (time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
else
return;
show_link (url, res[0], res[1], res[2], d.toString());
}
else
show_link (url, res[0], res[1], res[2]);
}
}
req.open ("POST", url + 'script.php' , true);
var form = new FormData();
form.append ("file", file);
if (time)
form.append ("time", time);
if (password)
form.append ("key", password);
if (one_time)
form.append ("one_time_download", '1');
if (upload_password.length > 0)
form.append ("upload_password", upload_password);
req.send (form);
}
function check_html5_file_api ()
{
if (window.File && window.FileReader && window.FileList && window.Blob)
return true;
return false;
}
var async_global_transfered = 0;
var async_global_url = '';
var async_global_file;
var async_global_ref = '';
var async_global_max_size = 0;
var async_global_time;
var async_global_transfering = 0;
function async_upload_start (url, max_size, file, time, password, one_time, upload_password)
{
async_global_transfered = 0;
async_global_url = url;
async_global_file = file;
async_global_max_size = max_size;
async_global_time = time;
var req = new XMLHttpRequest ();
req.addEventListener ("error", upload_failed, false);
req.addEventListener ("abort", upload_failed, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
return;
res = res.split ("\n");
async_global_ref = res[0];
var code = res[1];
async_upload_push (code);
}
}
req.open ("POST", async_global_url + 'script.php?init_async' , true);
var form = new FormData();
form.append ("filename", async_global_file.name);
form.append ("type", async_global_file.type);
if (time)
form.append ("time", time);
if (password)
form.append ("key", password);
if (one_time)
form.append ("one_time_download", '1');
if (upload_password.length > 0)
form.append ("upload_password", upload_password);
req.send (form);
}
function async_upload_progress (e)
{
if (!e.lengthComputable && async_global_file.size != 0)
return;
var p = Math.round ((e.loaded + async_global_transfered) * 100 / (async_global_file.size));
if (p == 100)
show_upload_progression (' ');
else
show_upload_progression (p.toString() + '%');
}
function async_upload_push (code)
{
if (async_global_transfered == async_global_file.size)
{
async_upload_end (code);
return;
}
var req = new XMLHttpRequest ();
req.upload.addEventListener ("progress", async_upload_progress, false);
req.addEventListener ("error", upload_failed, false);
req.addEventListener ("abort", upload_failed, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
return;
res = res.split ("\n");
var code = res[0]
async_global_transfered = async_global_transfering;
async_upload_push (code);
}
}
req.open ("POST", async_global_url + 'script.php?push_async' , true);
var chunk_size = parseInt (async_global_max_size * 0.50);
var start = async_global_transfered;
var end = start + chunk_size;
if (end >= async_global_file.size)
end = async_global_file.size;
var blob = async_global_file.slice (start, end);
async_global_transfering = end;
var form = new FormData();
form.append ("ref", async_global_ref);
form.append ("data", blob);
form.append ("code", code);
req.send (form);
}
function async_upload_end (code)
{
var req = new XMLHttpRequest ();
req.addEventListener ("error", upload_failed, false);
req.addEventListener ("abort", upload_failed, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
return;
res = res.split ("\n");
if (async_global_time != 'none')
{
var d = new Date();
if (async_global_time == 'minute')
d.setSeconds (d.getSeconds() + 60);
else if (async_global_time == 'hour')
d.setSeconds (d.getSeconds() + 3600);
else if (async_global_time == 'day')
d.setSeconds (d.getSeconds() + 86400);
else if (async_global_time == 'week')
d.setSeconds (d.getSeconds() + 604800);
else if (async_global_time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
else
return;
show_link (async_global_url, res[0], res[1], res[2], d.toString());
}
else
show_link (async_global_url, res[0], res[1], res[2]);
}
}
req.open ("POST", async_global_url + 'script.php?end_async' , true);
var form = new FormData();
form.append ("ref", async_global_ref);
form.append ("code", code);
req.send (form);
}
function upload (url, max_size)
{
if (check_html5_file_api ()
&& document.getElementById('file_select').files[0].size >= max_size)
{
async_upload_start (url,
max_size,
document.getElementById('file_select').files[0],
document.getElementById('select_time').value,
document.getElementById('input_key').value,
document.getElementById('one_time_download').checked,
document.getElementById('upload_password').value
);
}
else
{
classic_upload (url,
document.getElementById('file_select').files[0],
document.getElementById('select_time').value,
document.getElementById('input_key').value,
document.getElementById('one_time_download').checked,
document.getElementById('upload_password').value
);
}
}

429
sources/lib/functions.php Executable file → Normal file
View file

@ -2,7 +2,7 @@
/* /*
* Jirafeau, your web file repository * Jirafeau, your web file repository
* Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org> * Copyright (C) 2008 Julien "axolotl" BERNARD <axolotl@magieeternelle.org>
* Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com> * Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
@ -90,6 +90,18 @@ jirafeau_gen_random ($l)
return $code; return $code;
} }
function is_ssl() {
if ( isset($_SERVER['HTTPS']) ) {
if ( 'on' == strtolower($_SERVER['HTTPS']) )
return true;
if ( '1' == $_SERVER['HTTPS'] )
return true;
} elseif ( isset($_SERVER['SERVER_PORT']) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {
return true;
}
return false;
}
function function
jirafeau_human_size ($octets) jirafeau_human_size ($octets)
{ {
@ -333,7 +345,9 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $ip, $crypt, $link_name
/* Crypt file if option is enabled. */ /* Crypt file if option is enabled. */
$crypted = false; $crypted = false;
$crypt_key = ''; $crypt_key = '';
if ($crypt == true && extension_loaded('mcrypt')) if ($crypt == true && !(extension_loaded('mcrypt') == true))
error_log ("PHP extension mcrypt not loaded, won't encrypt in Jirafeau");
if ($crypt == true && extension_loaded('mcrypt') == true)
{ {
$crypt_key = jirafeau_encrypt_file ($file['tmp_name'], $file['tmp_name']); $crypt_key = jirafeau_encrypt_file ($file['tmp_name'], $file['tmp_name']);
if (strlen($crypt_key) > 0) if (strlen($crypt_key) > 0)
@ -429,7 +443,7 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $ip, $crypt, $link_name
} }
/** /**
* tells if a mime-type is viewable in a browser * Tells if a mime-type is viewable in a browser
* @param $mime the mime type * @param $mime the mime type
* @returns a boolean telling if a mime type is viewable * @returns a boolean telling if a mime type is viewable
*/ */
@ -439,7 +453,7 @@ jirafeau_is_viewable ($mime)
if (!empty ($mime)) if (!empty ($mime))
{ {
/* Actually, verify if mime-type is an image or a text. */ /* Actually, verify if mime-type is an image or a text. */
$viewable = array ('image', 'text'); $viewable = array ('image', 'text', 'video', 'audio');
$decomposed = explode ('/', $mime); $decomposed = explode ('/', $mime);
return in_array ($decomposed[0], $viewable); return in_array ($decomposed[0], $viewable);
} }
@ -491,10 +505,10 @@ show_errors ()
} }
} }
function check_errors () function check_errors ($cfg)
{ {
if (file_exists (JIRAFEAU_ROOT . 'install.php') if (file_exists (JIRAFEAU_ROOT . 'install.php')
&& !file_exists (JIRAFEAU_ROOT . 'lib/config.local.php')) && !($cfg['installation_done'] === true))
{ {
header('Location: install.php'); header('Location: install.php');
exit; exit;
@ -512,15 +526,6 @@ function check_errors ()
if (!is_writable (VAR_ASYNC)) if (!is_writable (VAR_ASYNC))
add_error (t('The async directory is not writable!'), VAR_ASYNC); add_error (t('The async directory is not writable!'), VAR_ASYNC);
if (!is_writable (VAR_BLOCK))
add_error (t('The block directory is not writable!'), VAR_BLOCK);
/* Check if the install.php script is still in the directory. */
if (file_exists (JIRAFEAU_ROOT . 'install.php'))
add_error (t('Installer script still present'),
t('Please make sure to delete the installer script ' .
'"install.php" before continuing.'));
} }
/** /**
@ -549,6 +554,8 @@ jirafeau_get_link ($hash)
$out['link_code'] = trim ($c[9]); $out['link_code'] = trim ($c[9]);
if (trim ($c[10]) == 'C') if (trim ($c[10]) == 'C')
$out['crypted'] = true; $out['crypted'] = true;
else
$out['crypted'] = false;
return $out; return $out;
} }
@ -834,10 +841,11 @@ jirafeau_async_init ($filename, $type, $one_time, $key, $time, $ip)
* @param $ref asynchronous upload reference * @param $ref asynchronous upload reference
* @param $file piece of data * @param $file piece of data
* @param $code client code for this operation * @param $code client code for this operation
* @param $max_file_size maximum allowed file size
* @return a string containing a next code to use or the string "Error" * @return a string containing a next code to use or the string "Error"
*/ */
function function
jirafeau_async_push ($ref, $data, $code) jirafeau_async_push ($ref, $data, $code, $max_file_size)
{ {
/* Get async infos. */ /* Get async infos. */
$a = jirafeau_get_async_ref ($ref); $a = jirafeau_get_async_ref ($ref);
@ -851,9 +859,21 @@ jirafeau_async_push ($ref, $data, $code)
$p = s2p ($ref); $p = s2p ($ref);
/* File path. */
$r_path = $data['tmp_name'];
$w_path = VAR_ASYNC . $p . $ref . '_data';
/* Check that file size is not above upload limit. */
if ($max_file_size > 0 &&
filesize ($r_path) + filesize ($w_path) > $max_file_size * 1024 * 1024)
{
jirafeau_async_delete ($ref);
return "Error";
}
/* Concatenate data. */ /* Concatenate data. */
$r = fopen ($data['tmp_name'], 'r'); $r = fopen ($r_path, 'r');
$w = fopen (VAR_ASYNC . $p . $ref . '_data', 'a'); $w = fopen ($w_path, 'a');
while (!feof ($r)) while (!feof ($r))
{ {
if (fwrite ($w, fread ($r, 1024)) === false) if (fwrite ($w, fread ($r, 1024)) === false)
@ -866,7 +886,7 @@ jirafeau_async_push ($ref, $data, $code)
} }
fclose ($r); fclose ($r);
fclose ($w); fclose ($w);
unlink ($data['tmp_name']); unlink ($r_path);
/* Update async file. */ /* Update async file. */
$code = jirafeau_gen_random (4); $code = jirafeau_gen_random (4);
@ -903,7 +923,7 @@ jirafeau_async_end ($ref, $code, $crypt, $link_name_length)
$crypted = false; $crypted = false;
$crypt_key = ''; $crypt_key = '';
if ($crypt == true && extension_loaded('mcrypt')) if ($crypt == true && extension_loaded('mcrypt') == true)
{ {
$crypt_key = jirafeau_encrypt_file ($p, $p); $crypt_key = jirafeau_encrypt_file ($p, $p);
if (strlen($crypt_key) > 0) if (strlen($crypt_key) > 0)
@ -952,346 +972,6 @@ jirafeau_async_end ($ref, $code, $crypt, $link_name_length)
return $md5_link . NL . $delete_link_code . NL . urlencode($crypt_key); return $md5_link . NL . $delete_link_code . NL . urlencode($crypt_key);
} }
/**
* Delete a block.
* @param $id identifier of the block.
*/
function
jirafeau_block_delete_ ($id)
{
$p = VAR_BLOCK . s2p ($id);
if (!file_exists ($p))
return;
if (file_exists ($p . $id))
unlink ($p . $id);
if (file_exists ($p . $id . '_infos'))
unlink ($p . $id . '_infos');
$parse = $p;
$scan = array();
while (file_exists ($parse)
&& ($scan = scandir ($parse))
&& count ($scan) == 2 // '.' and '..' folders => empty.
&& basename ($parse) != basename (VAR_BLOCK))
{
rmdir ($parse);
$parse = substr ($parse, 0, strlen($parse) - strlen(basename ($parse)) - 1);
}
}
/**
* Create a file filled with zeros.
* @param $size size of the file.
* @return a string corresponding to an id or the string "Error"
*/
function
jirafeau_block_init ($size)
{
if (!ctype_digit ($size) || $size <= 0)
return "Error";
/* Create folder. */
$id;
do
{
$id = jirafeau_gen_random (32);
$p = VAR_BLOCK . s2p ($id);
} while (file_exists ($p));
@mkdir ($p, 0755, true);
if (!file_exists ($p))
{
echo "Error";
return;
}
/* Create block. */
$p .= $id;
$h = fopen ($p, 'w');
$fill = str_repeat ("\0", 1024);
for ($cnt = 0; $cnt < $size; $cnt += 1024)
{
if ($size - $cnt < 1024)
$fill = str_repeat ("\0", $size - $cnt);
if (fwrite ($h, $fill) === false)
{
fclose ($h);
jirafeau_block_delete_ ($id);
return "Error";
}
}
fclose ($h);
/* Generate a write/delete code. */
$code = jirafeau_gen_random (12);
/* Add block infos. */
if (file_put_contents ($p . '_infos', date ('U') . NL . $size . NL . $code) === FALSE)
{
jirafeau_block_delete_ ($id);
return "Error";
}
return $id . NL . $code;
}
/** Get block size in bytes.
* @param $id identifier of the block
* @return block size in bytes
*/
function
jirafeau_block_get_size ($id)
{
$p = VAR_BLOCK . s2p ($id) . $id;
if (!file_exists ($p))
return "Error";
/* Check date. */
$f = file ($p . '_infos');
$date = trim ($f[0]);
$block_size = trim ($f[1]);
$stored_code = trim ($f[2]);
/* Update date. */
if (date ('U') - $date > JIRAFEAU_HOUR
&& date ('U') - $date < JIRAFEAU_MONTH)
{
if (file_put_contents ($p . '_infos', date ('U') . NL . $block_size . NL . $stored_code) === FALSE)
{
jirafeau_block_delete_ ($id);
return "Error";
}
}
/* Remove data. */
elseif (date ('U') - $date >= JIRAFEAU_MONTH)
{
echo date ('U'). " $date ";
jirafeau_block_delete_ ($id);
return "Error";
}
return $block_size;
}
/**
* Read some data in a block.
* @param $id identifier of the block
* @param $start where to read data (starting from zero).
* @param $length length to read.
* @return echo data
*/
function
jirafeau_block_read ($id, $start, $length)
{
if (!ctype_digit ($start) || $start < 0
|| !ctype_digit ($length) || $length <= 0)
{
echo "Error";
return;
}
$p = VAR_BLOCK . s2p ($id) . $id;
if (!file_exists ($p))
{
echo "Error";
return;
}
/* Check date. */
$f = file ($p . '_infos');
$date = trim ($f[0]);
$block_size = trim ($f[1]);
$stored_code = trim ($f[2]);
/* Update date. */
if (date ('U') - $date > JIRAFEAU_HOUR
&& date ('U') - $date < JIRAFEAU_MONTH)
{
if (file_put_contents ($p . '_infos', date ('U') . NL . $block_size . NL . $stored_code) === FALSE)
{
jirafeau_block_delete_ ($id);
echo "Error";
return;
}
}
/* Remove data. */
elseif (date ('U') - $date >= JIRAFEAU_MONTH)
{
echo date ('U'). " $date ";
jirafeau_block_delete_ ($id);
echo "Error";
return;
}
if ($start + $length > $block_size)
{
echo "Error";
return;
}
/* Read content. */
header ('Content-Length: ' . $length);
header ('Content-Disposition: attachment');
$r = fopen ($p, 'r');
if (fseek ($r, $start) != 0)
{
echo "Error";
return;
}
$c = 1024;
for ($cnt = 0; $cnt < $length && !feof ($r); $cnt += 1024)
{
if ($length - $cnt < 1024)
$c = $length - $cnt;
print fread ($r, $c);
ob_flush();
}
fclose ($r);
}
/**
* Write some data in a block.
* @param $id identifier of the block
* @param $start where to writing data (starting from zero).
* @param $data data to write.
* @param $code code to allow writing.
* @return string "Ok" or string "Error".
*/
function
jirafeau_block_write ($id, $start, $data, $code)
{
if (!ctype_digit ($start) || $start < 0
|| strlen ($code) == 0)
return "Error";
$p = VAR_BLOCK . s2p ($id) . $id;
if (!file_exists ($p))
return "Error";
/* Check date. */
$f = file ($p . '_infos');
$date = trim ($f[0]);
$block_size = trim ($f[1]);
$stored_code = trim ($f[2]);
/* Update date. */
if (date ('U') - $date > JIRAFEAU_HOUR
&& date ('U') - $date < JIRAFEAU_MONTH)
{
if (file_put_contents ($p . '_infos', date ('U') . NL . $block_size . NL . $stored_code) === FALSE)
{
jirafeau_block_delete_ ($id);
return "Error";
}
}
/* Remove data. */
elseif (date ('U') - $date >= JIRAFEAU_MONTH)
{
jirafeau_block_delete_ ($id);
return "Error";
}
/* Check code. */
if ($stored_code != $code)
{
echo "Error";
return;
}
/* Check data. */
$size = $data['size'];
if ($size <= 0)
return "Error";
if ($start + $size > $block_size)
return "Error";
/* Open data. */
$r = fopen ($data['tmp_name'], 'r');
/* Open Block. */
$w = fopen ($p, 'r+');
if (fseek ($w, $start) != 0)
return "Error";
/* Write content. */
$c = 1024;
for ($cnt = 0; $cnt <= $size && !feof ($w); $cnt += 1024)
{
if ($size - $cnt < 1024)
$c = $size - $cnt;
$d = fread ($r, $c);
fwrite ($w, $d);
}
fclose ($r);
fclose ($w);
unlink ($data['tmp_name']);
return "Ok";
}
/**
* Delete a block.
* @param $id identifier of the block.
* @param $code code to allow writing.
* @return string "Ok" or string "Error".
*/
function
jirafeau_block_delete ($id, $code)
{
$p = VAR_BLOCK . s2p ($id) . $id;
if (!file_exists ($p))
return "Error";
$f = file ($p . '_infos');
$date = trim ($f[0]);
$block_size = trim ($f[1]);
$stored_code = trim ($f[2]);
if ($code != $stored_code)
return "Error";
jirafeau_block_delete_ ($id);
return "Ok";
}
/**
* Clean old unused blocks.
* @return number of cleaned blocks.
*/
function
jirafeau_admin_clean_block ()
{
$count = 0;
/* Get all blocks. */
$stack = array (VAR_BLOCK);
while (($d = array_shift ($stack)) && $d != NULL)
{
$dir = scandir ($d);
foreach ($dir as $node)
{
if (strcmp ($node, '.') == 0 || strcmp ($node, '..') == 0)
continue;
if (is_dir ($d . $node))
{
/* Push new found directory. */
$stack[] = $d . $node . '/';
}
elseif (is_file ($d . $node) && preg_match ('/\_infos/i', "$node"))
{
/* Read block informations. */
$f = file ($d . $node);
$date = trim ($f[0]);
$block_size = trim ($f[1]);
if (date ('U') - $date >= JIRAFEAU_MONTH)
{
jirafeau_block_delete_ (substr($node, 0, -6));
$count++;
}
}
}
}
return $count;
}
function function
jirafeau_crypt_create_iv($base, $size) jirafeau_crypt_create_iv($base, $size)
{ {
@ -1312,7 +992,7 @@ function
jirafeau_encrypt_file ($fp_src, $fp_dst) jirafeau_encrypt_file ($fp_src, $fp_dst)
{ {
$fs = filesize ($fp_src); $fs = filesize ($fp_src);
if ($fs === false || $fs == 0 || !extension_loaded('mcrypt')) if ($fs === false || $fs == 0 || !(extension_loaded('mcrypt') == true))
return ''; return '';
/* Prepare module. */ /* Prepare module. */
@ -1351,7 +1031,7 @@ function
jirafeau_decrypt_file ($fp_src, $fp_dst, $k) jirafeau_decrypt_file ($fp_src, $fp_dst, $k)
{ {
$fs = filesize ($fp_src); $fs = filesize ($fp_src);
if ($fs === false || $fs == 0 || !extension_loaded('mcrypt')) if ($fs === false || $fs == 0 || !(extension_loaded('mcrypt') == true))
return false; return false;
/* Init module */ /* Init module */
@ -1377,4 +1057,27 @@ jirafeau_decrypt_file ($fp_src, $fp_dst, $k)
return true; return true;
} }
?> /**
* Check if Jirafeau is password protected for visitors.
* @return true if Jirafeau is password protected, false otherwise.
*/
function jirafeau_has_upload_password ($cfg)
{
return count ($cfg['upload_password']) > 0;
}
/**
* Challenge password for a visitor.
* @param $password password to be challenged
* @return true if password is valid, false otherwise.
*/
function jirafeau_challenge_upload_password ($cfg, $password)
{
if (!jirafeau_has_upload_password($cfg))
return false;
forEach ($cfg['upload_password'] as $p)
if ($password == $p)
return true;
return false;
}

560
sources/lib/functions_v3.js Normal file
View file

@ -0,0 +1,560 @@
/*
* Jirafeau, your web file repository
* Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function show_link (url, reference, delete_code, crypt_key, date)
{
// Download page if element exists
var download_link = url + 'f.php?h=' + reference;
var download_link_href = url + 'f.php?h=' + reference;
if (crypt_key.length > 0)
{
download_link += '&amp;k=' + crypt_key;
download_link_href += '&k=' + crypt_key;
}
if (!!document.getElementById('upload_finished_download_page'))
{
document.getElementById('upload_link').innerHTML = download_link;
document.getElementById('upload_link').href = download_link_href;
}
// Is the preview allowed ?
if (!!document.getElementById('preview_link'))
{
document.getElementById('upload_finished_preview').style.display = 'none';
var preview_link = url + 'f.php?h=' + reference + '&amp;p=1';
var preview_link_href = url + 'f.php?h=' + reference + '&p=1';
if (crypt_key.length > 0)
{
preview_link += '&amp;k=' + crypt_key;
preview_link_href += '&k=' + crypt_key;
}
// Test if content can be previewed
type = document.getElementById('file_select').files[0].type;
if (type.indexOf("image") > -1 ||
type.indexOf("audio") > -1 ||
type.indexOf("text") > -1 ||
type.indexOf("video") > -1)
{
document.getElementById('preview_link').innerHTML = preview_link;
document.getElementById('preview_link').href = preview_link_href;
document.getElementById('upload_finished_preview').style.display = '';
}
}
// Only show link to password page if password is set
document.getElementById('upload_password_page').style.display = 'none';
if (document.getElementById('input_key').value.length > 0)
{
if (!!document.getElementById('upload_finished_download_page'))
document.getElementById('upload_finished_download_page').style.display = 'none';
document.getElementById('upload_password_page').style.display = '';
if (!!document.getElementById('upload_finished_preview'))
document.getElementById('upload_finished_preview').style.display = 'none';
document.getElementById('upload_direct_download').style.display = 'none';
document.getElementById('password_link').innerHTML = download_link;
document.getElementById('password_link').href = download_link_href;
}
// Direct download link
else
{
var direct_download_link = url + 'f.php?h=' + reference + '&amp;d=1';
var direct_download_link_href = url + 'f.php?h=' + reference + '&d=1';
if (crypt_key.length > 0)
{
direct_download_link += '&amp;k=' + crypt_key;
direct_download_link_href += '&k=' + crypt_key;
}
document.getElementById('direct_link').innerHTML = direct_download_link;
document.getElementById('direct_link').href = direct_download_link_href;
}
// Delete link
var delete_link = url + 'f.php?h=' + reference + '&amp;d=' + delete_code;
var delete_link_href = url + 'f.php?h=' + reference + '&d=' + delete_code;
document.getElementById('delete_link').innerHTML = delete_link;
document.getElementById('delete_link').href = delete_link_href;
if (date)
{
document.getElementById('date').innerHTML = date;
document.getElementById('validity').style.display = '';
}
else
document.getElementById('validity').style.display = 'none';
document.getElementById('uploading').style.display = 'none';
document.getElementById('upload').style.display = 'none';
document.getElementById('upload_finished').style.display = '';
document.title = 'Jirafeau - 100%';
}
function show_upload_progression (percentage, speed, time_left)
{
document.getElementById('uploaded_percentage').innerHTML = percentage;
document.getElementById('uploaded_speed').innerHTML = speed;
document.getElementById('uploaded_time').innerHTML = time_left;
document.title = 'Jirafeau - ' + percentage;
}
function hide_upload_progression ()
{
document.getElementById('uploaded_percentage').style.display = 'none';
document.getElementById('uploaded_speed').style.display = 'none';
document.getElementById('uploaded_time').style.display = 'none';
document.title = 'Jirafeau';
}
function upload_progress (e)
{
if (!e.lengthComputable)
return;
// Init time estimation if needed
if (upload_time_estimation_total_size == 0)
upload_time_estimation_total_size = e.total;
// Compute percentage
var p = Math.round (e.loaded * 100 / e.total);
var p_str = ' ';
if (p != 100)
p_str = p.toString() + '%';
// Update estimation speed
upload_time_estimation_add(e.loaded);
// Get speed string
var speed_str = upload_time_estimation_speed_string();
// Get time string
var time_str = chrono_update(upload_time_estimation_time());
show_upload_progression (p_str, speed_str, time_str);
}
function control_selected_file_size(max_size, error_str)
{
f_size = document.getElementById('file_select').files[0].size;
if (max_size > 0 && f_size > max_size * 1024 * 1024)
{
pop_failure(error_str);
document.getElementById('send').style.display = 'none';
}
else
{
document.getElementById('options').style.display = '';
document.getElementById('send').style.display = '';
document.getElementById('error_pop').style.display = 'none';
}
}
function pop_failure (e)
{
var text = "An error occured";
if (typeof e !== 'undefined')
text = e;
text = "<p>" + text + "</p>";
document.getElementById('error_pop').innerHTML = e;
document.getElementById('uploading').style.display = 'none';
document.getElementById('error_pop').style.display = '';
document.getElementById('upload').style.display = '';
document.getElementById('send').style.display = '';
}
function classic_upload (url, file, time, password, one_time, upload_password)
{
// Delay time estimation init as we can't have file size
upload_time_estimation_init(0);
var req = new XMLHttpRequest ();
req.upload.addEventListener ("progress", upload_progress, false);
req.addEventListener ("error", pop_failure, false);
req.addEventListener ("abort", pop_failure, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
{
pop_failure ();
return;
}
res = res.split ("\n");
if (time != 'none')
{
var d = new Date();
if (time == 'minute')
d.setSeconds (d.getSeconds() + 60);
else if (time == 'hour')
d.setSeconds (d.getSeconds() + 3600);
else if (time == 'day')
d.setSeconds (d.getSeconds() + 86400);
else if (time == 'week')
d.setSeconds (d.getSeconds() + 604800);
else if (time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
else if (time == 'year')
d.setSeconds (d.getSeconds() + 29030400);
else
return;
show_link (url, res[0], res[1], res[2], d.toString());
}
else
show_link (url, res[0], res[1], res[2]);
}
}
req.open ("POST", url + 'script.php' , true);
var form = new FormData();
form.append ("file", file);
if (time)
form.append ("time", time);
if (password)
form.append ("key", password);
if (one_time)
form.append ("one_time_download", '1');
if (upload_password.length > 0)
form.append ("upload_password", upload_password);
req.send (form);
}
function check_html5_file_api ()
{
if (window.File && window.FileReader && window.FileList && window.Blob)
return true;
return false;
}
var async_global_transfered = 0;
var async_global_url = '';
var async_global_file;
var async_global_ref = '';
var async_global_max_size = 0;
var async_global_time;
var async_global_transfering = 0;
function async_upload_start (url, max_size, file, time, password, one_time, upload_password)
{
async_global_transfered = 0;
async_global_url = url;
async_global_file = file;
async_global_max_size = max_size;
async_global_time = time;
var req = new XMLHttpRequest ();
req.addEventListener ("error", pop_failure, false);
req.addEventListener ("abort", pop_failure, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
{
pop_failure ();
return;
}
res = res.split ("\n");
async_global_ref = res[0];
var code = res[1];
async_upload_push (code);
}
}
req.open ("POST", async_global_url + 'script.php?init_async' , true);
var form = new FormData();
form.append ("filename", async_global_file.name);
form.append ("type", async_global_file.type);
if (time)
form.append ("time", time);
if (password)
form.append ("key", password);
if (one_time)
form.append ("one_time_download", '1');
if (upload_password.length > 0)
form.append ("upload_password", upload_password);
// Start time estimation
upload_time_estimation_init(async_global_file.size);
req.send (form);
}
function async_upload_progress (e)
{
if (!e.lengthComputable && async_global_file.size != 0)
return;
// Compute percentage
var p = Math.round ((e.loaded + async_global_transfered) * 100 / (async_global_file.size));
var p_str = ' ';
if (p != 100)
p_str = p.toString() + '%';
// Update estimation speed
upload_time_estimation_add(e.loaded + async_global_transfered);
// Get speed string
var speed_str = upload_time_estimation_speed_string();
// Get time string
var time_str = chrono_update(upload_time_estimation_time());
show_upload_progression (p_str, speed_str, time_str);
}
function async_upload_push (code)
{
if (async_global_transfered == async_global_file.size)
{
hide_upload_progression ();
async_upload_end (code);
return;
}
var req = new XMLHttpRequest ();
req.upload.addEventListener ("progress", async_upload_progress, false);
req.addEventListener ("error", pop_failure, false);
req.addEventListener ("abort", pop_failure, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
{
pop_failure ();
return;
}
res = res.split ("\n");
var code = res[0]
async_global_transfered = async_global_transfering;
async_upload_push (code);
}
}
req.open ("POST", async_global_url + 'script.php?push_async' , true);
var chunk_size = parseInt (async_global_max_size * 0.50);
var start = async_global_transfered;
var end = start + chunk_size;
if (end >= async_global_file.size)
end = async_global_file.size;
var blob = async_global_file.slice (start, end);
async_global_transfering = end;
var form = new FormData();
form.append ("ref", async_global_ref);
form.append ("data", blob);
form.append ("code", code);
req.send (form);
}
function async_upload_end (code)
{
var req = new XMLHttpRequest ();
req.addEventListener ("error", pop_failure, false);
req.addEventListener ("abort", pop_failure, false);
req.onreadystatechange = function ()
{
if (req.readyState == 4 && req.status == 200)
{
var res = req.responseText;
if (res == "Error")
{
pop_failure ();
return;
}
res = res.split ("\n");
if (async_global_time != 'none')
{
var d = new Date();
if (async_global_time == 'minute')
d.setSeconds (d.getSeconds() + 60);
else if (async_global_time == 'hour')
d.setSeconds (d.getSeconds() + 3600);
else if (async_global_time == 'day')
d.setSeconds (d.getSeconds() + 86400);
else if (async_global_time == 'week')
d.setSeconds (d.getSeconds() + 604800);
else if (async_global_time == 'month')
d.setSeconds (d.getSeconds() + 2419200);
else if (async_global_time == 'year')
d.setSeconds (d.getSeconds() + 29030400);
else
return;
show_link (async_global_url, res[0], res[1], res[2], d.toString());
}
else
show_link (async_global_url, res[0], res[1], res[2]);
}
}
req.open ("POST", async_global_url + 'script.php?end_async' , true);
var form = new FormData();
form.append ("ref", async_global_ref);
form.append ("code", code);
req.send (form);
}
function upload (url, max_size)
{
if (check_html5_file_api ()
&& document.getElementById('file_select').files[0].size >= max_size)
{
async_upload_start (url,
max_size,
document.getElementById('file_select').files[0],
document.getElementById('select_time').value,
document.getElementById('input_key').value,
document.getElementById('one_time_download').checked,
document.getElementById('upload_password').value
);
}
else
{
classic_upload (url,
document.getElementById('file_select').files[0],
document.getElementById('select_time').value,
document.getElementById('input_key').value,
document.getElementById('one_time_download').checked,
document.getElementById('upload_password').value
);
}
}
var upload_time_estimation_total_size = 42;
var upload_time_estimation_transfered_size = 42;
var upload_time_estimation_transfered_date = 42;
var upload_time_estimation_moving_average_speed = 42;
function upload_time_estimation_init(total_size)
{
upload_time_estimation_total_size = total_size;
upload_time_estimation_transfered_size = 0;
upload_time_estimation_moving_average_speed = 0;
var d = new Date();
upload_time_estimation_transfered_date = d.getTime();
}
function upload_time_estimation_add(total_transfered_size)
{
// Let's compute the current speed
var d = new Date();
var speed = upload_time_estimation_moving_average_speed;
if (d.getTime() - upload_time_estimation_transfered_date != 0)
speed = (total_transfered_size - upload_time_estimation_transfered_size)
/ (d.getTime() - upload_time_estimation_transfered_date);
// Let's compute moving average speed on 30 values
var m = (upload_time_estimation_moving_average_speed * 29 + speed) / 30;
// Update global values
upload_time_estimation_transfered_size = total_transfered_size;
upload_time_estimation_transfered_date = d.getTime();
upload_time_estimation_moving_average_speed = m;
}
function upload_time_estimation_speed_string()
{
// speed ms -> s
var s = upload_time_estimation_moving_average_speed * 1000;
var res = 0;
var scale = '';
if (s <= 1000)
{
res = s.toString();
scale = "o/s";
}
else if (s < 1000000)
{
res = Math.floor(s/100) / 10;
scale = "Ko/s";
}
else
{
res = Math.floor(s/100000) / 10;
scale = "Mo/s";
}
if (res == 0)
return '';
else
return res.toString() + ' ' + scale;
}
function milliseconds_to_time_string (milliseconds)
{
function numberEnding (number) {
return (number > 1) ? 's' : '';
}
var temp = Math.floor(milliseconds / 1000);
var years = Math.floor(temp / 31536000);
if (years) {
return years + ' year' + numberEnding(years);
}
var days = Math.floor((temp %= 31536000) / 86400);
if (days) {
return days + ' day' + numberEnding(days);
}
var hours = Math.floor((temp %= 86400) / 3600);
if (hours) {
return hours + ' hour' + numberEnding(hours);
}
var minutes = Math.floor((temp %= 3600) / 60);
if (minutes) {
return minutes + ' minute' + numberEnding(minutes);
}
var seconds = temp % 60;
if (seconds) {
return seconds + ' second' + numberEnding(seconds);
}
return 'less than a second';
}
function upload_time_estimation_time()
{
// Estimate remaining time
if (upload_time_estimation_moving_average_speed == 0)
return 0;
return (upload_time_estimation_total_size - upload_time_estimation_transfered_size)
/ upload_time_estimation_moving_average_speed;
}
var chrono_last_update = 0;
var chrono_time_ms = 0;
var chrono_time_ms_last_update = 0;
function chrono_update(time_ms)
{
var d = new Date();
var chrono = 0;
// Don't update too often
if (d.getTime() - chrono_last_update < 3000 &&
chrono_time_ms_last_update > 0)
chrono = chrono_time_ms;
else
{
chrono_last_update = d.getTime();
chrono_time_ms = time_ms;
chrono = time_ms;
chrono_time_ms_last_update = d.getTime();
}
// Adjust chrono for smooth estimation
chrono = chrono - (d.getTime() - chrono_time_ms_last_update);
// Let's update chronometer
var time_str = '';
if (chrono > 0)
time_str = milliseconds_to_time_string (chrono);
return time_str;
}

2
sources/lib/lang.php Executable file → Normal file
View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Jirafeau, your web file repository * Jirafeau, your web file repository
* Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com> * Copyright (C) 2015 Jerome Jutteau <j.jutteau@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as

29
sources/lib/lang/fr.php Executable file → Normal file
View file

@ -31,24 +31,31 @@ $tr = array (
'Maximum file size' => 'Taille maximale', 'Maximum file size' => 'Taille maximale',
'powered by Open-Source project Jirafeau' => 'Propulsé par le projet Open-Source Jirafeau', 'powered by Open-Source project Jirafeau' => 'Propulsé par le projet Open-Source Jirafeau',
'Jirafeau Project' => 'Projet Jirafeau', 'Jirafeau Project' => 'Projet Jirafeau',
'None' => 'Aucune',
'One minute' => 'Une minute', 'One minute' => 'Une minute',
'One hour' => 'Une heure', 'One hour' => 'Une heure',
'One day' => 'Une journée', 'One day' => 'Une journée',
'One week' => 'Une semaine', 'One week' => 'Une semaine',
'One month' => 'Un mois', 'One month' => 'Un mois',
'One year' => 'Une année',
'None' => 'Aucune',
'Upload password' => 'Mot de passe', 'Upload password' => 'Mot de passe',
'File is too big' => 'Le fichier est trop volumineux',
'File size is limited to' => 'La taille de fichier est limité à',
'The file directory is not writable' => 'Le dossier \'file\' ne peut être écrit.', 'The file directory is not writable' => 'Le dossier \'file\' ne peut être écrit.',
'The link directory is not writable' => 'Le dossier \'link\' ne peut être écrit.', 'The link directory is not writable' => 'Le dossier \'link\' ne peut être écrit.',
'The async directory is not writable!' => 'Le dossier \'async\' ne peut être écrit.', 'The async directory is not writable!' => 'Le dossier \'async\' ne peut être écrit.',
'Installer script still present' => 'Le script d\'installation est toujours présent', 'Installer script still present' => 'Le script d\'installation est toujours présent',
'Please make sure to delete the installer script "install.php" before continuing.' => 'Merci de supprimer le fichier "install.php" avant de continuer.', 'Please make sure to delete the installer script "install.php" before continuing.' => 'Merci de supprimer le fichier "install.php" avant de continuer.',
'An error occurred.' => 'Une erreur s\'est produite', 'An error occurred.' => 'Une erreur s\'est produite',
'File uploaded! Copy the following URL to get it' => 'Fichier envoyé! Le fichier sera accessible à l\'adresse suivante', 'File uploaded !' => 'Fichier envoyé !',
'Download page' => 'Page de téléchargement',
'This file is valid until the following date' => 'Ce fichier est valable jusqu\'à la date suivante', 'This file is valid until the following date' => 'Ce fichier est valable jusqu\'à la date suivante',
'Keep the following URL to delete it at any moment' => 'Vous pouvez supprimer le fichier lorsque vous le désirez via l\'adresse suivante', 'View link' => 'Lien d\'affichage',
'Direct download link' => 'Lien de téléchargement direct',
'Delete link' => 'Lien de suppression',
/* f.php */ /* f.php */
'Download' => 'Télécharger', 'Download' => 'Télécharger',
'Preview' => 'Prévisualiser',
'Sorry, the requested file is not found' => 'Désolé, le fichier que vous demandez n\'existe pas ou n\'existe plus', 'Sorry, the requested file is not found' => 'Désolé, le fichier que vous demandez n\'existe pas ou n\'existe plus',
'File not available.' => 'Fichier non disponible', 'File not available.' => 'Fichier non disponible',
'File has been deleted.' => 'Le fichier a été supprimé.', 'File has been deleted.' => 'Le fichier a été supprimé.',
@ -80,7 +87,6 @@ $tr = array (
'step' => 'étape', 'step' => 'étape',
'out of' => 'sur', 'out of' => 'sur',
'Administration password' => 'Mot de passe d\'administration', 'Administration password' => 'Mot de passe d\'administration',
'Clean unused blocks' => 'Nettoie les bloques inutilisés',
'Finalisation' => 'Finalisation', 'Finalisation' => 'Finalisation',
'Jirafeau is setting the website according to the configuration you provided.' => 'Jirafeau se configure selon les paramêtres donnés', 'Jirafeau is setting the website according to the configuration you provided.' => 'Jirafeau se configure selon les paramêtres donnés',
'Previous step' => 'Etape précedente', 'Previous step' => 'Etape précedente',
@ -103,6 +109,7 @@ $tr = array (
'Administration password' => 'Mot de passe d\'administration', 'Administration password' => 'Mot de passe d\'administration',
/* admin.php */ /* admin.php */
'Sorry, the admin interface is not enabled.' => 'Désolé, l\'interface d\'administration n\'est pas activée.', 'Sorry, the admin interface is not enabled.' => 'Désolé, l\'interface d\'administration n\'est pas activée.',
'Sorry, you are not authenticated on admin interface.' => 'Désolé, vous n\'êtes pas authentifié sur l\'interface d\'administration',
'Login' => 'Connexion', 'Login' => 'Connexion',
'Wrong password.' => 'Mot de passe invalide.', 'Wrong password.' => 'Mot de passe invalide.',
'Admin interface' => 'Interface d\'administration', 'Admin interface' => 'Interface d\'administration',
@ -138,6 +145,8 @@ $tr = array (
'This interface permits to script your uploads and downloads.' => 'Cette interface permet de programmer vos envoie et téléversements.', 'This interface permits to script your uploads and downloads.' => 'Cette interface permet de programmer vos envoie et téléversements.',
'The instructions above show how to query this interface.' => 'Les instructions ci-dessous montrent comment interroger cette interface.', 'The instructions above show how to query this interface.' => 'Les instructions ci-dessous montrent comment interroger cette interface.',
'Get server capacity' => 'Récupérer la capacité d\'envoie du serveur', 'Get server capacity' => 'Récupérer la capacité d\'envoie du serveur',
'Maximal allowed size of an uploaded file' => 'Récupérer la taille maximal autorisée d\'un envoie de fichier',
'First line returns size (in MB).' => 'La première ligne correspond à la taille exprimée en MB.',
'Get Jirafeau\'s version' => 'Récupérer la version de Jirafeau', 'Get Jirafeau\'s version' => 'Récupérer la version de Jirafeau',
'Send a GET query to' => 'Envoyez une requette GET à', 'Send a GET query to' => 'Envoyez une requette GET à',
'Send a POST query to' => 'Envoyez une requette POST à', 'Send a POST query to' => 'Envoyez une requette POST à',
@ -155,7 +164,7 @@ $tr = array (
'This will return "Ok" if succeded, "Error" otherwhise.' => 'Retourne "OK" en cas de succès, "Error" dans le cas contraire.', 'This will return "Ok" if succeded, "Error" otherwhise.' => 'Retourne "OK" en cas de succès, "Error" dans le cas contraire.',
'Get a generated scripts' => 'Récupérer un script généré', 'Get a generated scripts' => 'Récupérer un script généré',
'This will return brut text content of the code.' => 'Renvoie le code sous forme the texte brut.', 'This will return brut text content of the code.' => 'Renvoie le code sous forme the texte brut.',
'Initalize a asynchronous transfert' => 'Initialiser un transfert asynchrone', 'Initalize an asynchronous transfert' => 'Initialiser un transfert asynchrone',
'The goal is to permit to transfert big file, chunk by chunk.' => 'Le but est de permettre de transférer de gros fichiers, morceaux par morceaux.', 'The goal is to permit to transfert big file, chunk by chunk.' => 'Le but est de permettre de transférer de gros fichiers, morceaux par morceaux.',
'Chunks of data must be sent in order.' => 'Chaque morceau doit être envoyé dans l\'ordre.', 'Chunks of data must be sent in order.' => 'Chaque morceau doit être envoyé dans l\'ordre.',
'First line is the asynchronous transfert reference and the second line the code to use in the next operation.' 'First line is the asynchronous transfert reference and the second line the code to use in the next operation.'
@ -163,16 +172,6 @@ $tr = array (
'Push data during asynchronous transfert' => 'Envoyer des données pendant un transfert asynchrone', 'Push data during asynchronous transfert' => 'Envoyer des données pendant un transfert asynchrone',
'Returns the next code to use.' => 'Renvoie le prochain code à utiliser.', 'Returns the next code to use.' => 'Renvoie le prochain code à utiliser.',
'Finalize asynchronous transfert' => 'Finaliser un transfert asynchrone', 'Finalize asynchronous transfert' => 'Finaliser un transfert asynchrone',
'Create a data block' => 'Creer un bloque de données',
'This interface permits to create a block of data filled with zeros.' => 'Cette interface permet de creer un bloque de données remplies de zeros.',
'You can read selected parts, write (using a code) and delete the block.' => 'Vous pouvez lire, écrire (en utilisant un code) et supprimer le bloque.',
'Blocks may be removed after a month of non usage.' => 'Les bloques non utilisés depuis plus d\'un mois seront probablement supprimés.',
'Get block size' => 'Récupérer la taille d\'un bloque',
'Read data in a block' => 'Lire des données dans un bloque',
'Write data in a block' => 'Ecrire des données dans un bloque',
'First line is a block id the second line the edit/delete code.' => 'La premiere ligne est l\'identifiant du bloque, la seconde est son code d\'écriture/suppression.',
'This will return asked data or "Error" string.' => 'Retourne les données ou la chaine "Error".',
'Delete a block' => 'Supprimer un bloque',
'This will return "Ok" or "Error" string.' => 'Retourn la chaine "Ok" ou "Error".', 'This will return "Ok" or "Error" string.' => 'Retourn la chaine "Ok" ou "Error".',
); );
?> ?>

View file

@ -0,0 +1,157 @@
<?php
$tr = array (
/* index.php */
'Jirafeau, your web file repository' => '',
'Select a file' => '',
'Send' => '',
'Uploading ...' => '',
'One time download' => '',
'Password' => '',
'Time limit' => '',
'Maximum file size' => '',
'powered by Open-Source project Jirafeau' => '',
'Jirafeau Project' => '',
'One minute' => '',
'One hour' => '',
'One day' => '',
'One week' => '',
'One month' => '',
'One year' => '',
'None' => '',
'Upload password' => '',
'File is too big' => '',
'File size is limited to' => '',
'The file directory is not writable' => '',
'The link directory is not writable' => '',
'The async directory is not writable!' => '',
'Installer script still present' => '',
'Please make sure to delete the installer script "install.php" before continuing.' => '',
'An error occurred.' => '',
'File uploaded !' => '',
'Download page' => '',
'This file is valid until the following date' => '',
'View link' => '',
'Direct download link' => '',
'Delete link' => '',
/* f.php */
'Download' => '',
'Preview' => '',
'Sorry, the requested file is not found' => '',
'File not available.' => '',
'File has been deleted.' => '',
'The time limit of this file has expired.' => '',
'Password protection' => '',
'Give the password of this file' => '',
'Access denied' => '',
'You are about to download' => '',
'By using our services, you accept of our' => '',
'Term Of Service' => '',
/* functions.php */
'Internal error during file creation.' => '',
/* install.hpp */
'This file was generated by the install process. You can edit it. Please see config.original.php to understand the configuration items.' => '',
'The following directory could not be created' => '',
'You should create this directory by hand.' => '',
'The following directory is not writable' => '',
'You should give the write right to the web server on this directory.' => '',
'Here is a solution' => 'Une solution possible',
'The local configuration file could not be created. Create a ' .
'<code>lib/config.local.php</code> file and give the write ' .
'right to the web server (preferred solution), or give the ' .
'write right to the web server on the <code>lib</code> ' .
'directory.' => '',
'The local configuration is not writable by the web server. ' .
'Give the write right to the web server on the ' .
'<code>lib/config.local.php</code> file.' => '',
'Installation of Jirafeau' => '',
'step' => '',
'out of' => '',
'Administration password' => '',
'Finalisation' => '',
'Jirafeau is setting the website according to the configuration you provided.' => '',
'Previous step' => '',
'Retry this step' => '',
'Jirafeau is now fully operational' => '',
'Information' => '',
'The base address of Jirafeau is the first part of the URL, until (and including) the last slash. For example: "http://www.example.com/". Do not forget the ending slash!'
=> '',
'Base address' => 'Addresse d\'origine',
'The data directory is where your files and information about your files will be stored. You should put it outside your web site, or at least restrict the access of this directory. Do not forget the ending slash!'
=> '',
'Data directory' => '',
'Jirafeau is internationalised. Choose a specific langage or choose Automatic (langage is provided by user\'s browser).'
=> '',
'Choose the default language' => '',
'Next step' => '',
'' .
'You can set a password to access the intercace or let it be empty ' .
'to disable the interface.' => '',
'Administration password' => '',
/* admin.php */
'Sorry, the admin interface is not enabled.' => '',
'Sorry, you are not authenticated on admin interface.' => '',
'Login' => '',
'Wrong password.' => '',
'Admin interface' => '',
'Clean expired files' => '',
'Clean old unfinished transferts' => '',
'Clean' => '',
'Search files by name' => '',
'Search' => '',
'List all files' => '',
'List' => '',
'Actions' => '',
'Search files by file hash' => '',
'Search a specific link' => '',
'Number of cleaned files' => '',
'Logout' => 'Déconnexion',
'You are now Logout' => '',
'Link deleted' => '',
'Filename' => '',
'file' => '',
'link' => '',
'Type' => '',
'Size' => '',
'Expire' => '',
'Onetime' => '',
'Upload date' => '',
'Origin' => '',
'Action' => '',
'Del link' => '',
'Del file and links' => '',
'Deleted links' => '',
/* script.php */
'Welcome to Jirafeau\'s query interface' => '',
'This interface permits to script your uploads and downloads.' => '',
'The instructions above show how to query this interface.' => '',
'Get server capacity' => '',
'Maximal allowed size of an uploaded file' => '',
'First line returns size (in MB).' => '',
'Get Jirafeau\'s version' => '',
'Send a GET query to' => '',
'Send a POST query to' => '',
'Upload a file' => '',
'Get a file' => '',
'Required' => '',
'Optional' => '',
'Parameters' => '',
'This will return brut text content.' => '',
'First line is the download reference and the second line the delete code.' => '',
'First line is the server capacity (in Bytes).' => '',
'Example' => 'Exemple',
'If a password has been set, send a POST request with it.' => '',
'Delete a file' => '',
'This will return "Ok" if succeded, "Error" otherwhise.' => '',
'Get a generated scripts' => '',
'This will return brut text content of the code.' => '',
'Initalize an asynchronous transfert' => '',
'The goal is to permit to transfert big file, chunk by chunk.' => '',
'Chunks of data must be sent in order.' => '',
'First line is the asynchronous transfert reference and the second line the code to use in the next operation.'
=> '',
'Push data during asynchronous transfert' => '',
'Returns the next code to use.' => '',
'Finalize asynchronous transfert' => '',
'This will return "Ok" or "Error" string.' => '',
);
?>

View file

@ -24,7 +24,6 @@ define ('JIRAFEAU_VERSION', '1.0');
define ('VAR_FILES', $cfg['var_root'] . 'files/'); define ('VAR_FILES', $cfg['var_root'] . 'files/');
define ('VAR_LINKS', $cfg['var_root'] . 'links/'); define ('VAR_LINKS', $cfg['var_root'] . 'links/');
define ('VAR_ASYNC', $cfg['var_root'] . 'async/'); define ('VAR_ASYNC', $cfg['var_root'] . 'async/');
define ('VAR_BLOCK', $cfg['var_root'] . 'block/');
/* Useful constants. */ /* Useful constants. */
if (!defined ('NL')) if (!defined ('NL'))
@ -36,5 +35,6 @@ define ('JIRAFEAU_HOUR', 3600); // JIRAFEAU_MINUTE * 60
define ('JIRAFEAU_DAY', 86400); // JIRAFEAU_HOUR * 24 define ('JIRAFEAU_DAY', 86400); // JIRAFEAU_HOUR * 24
define ('JIRAFEAU_WEEK', 604800); // JIRAFEAU_DAY * 7 define ('JIRAFEAU_WEEK', 604800); // JIRAFEAU_DAY * 7
define ('JIRAFEAU_MONTH', 2419200); // JIRAFEAU_WEEK * 4 define ('JIRAFEAU_MONTH', 2419200); // JIRAFEAU_WEEK * 4
define ('JIRAFEAU_YEAR', 29030400); // JIRAFEAU_MONTH * 12
?> ?>

View file

@ -1,6 +1,6 @@
<div id="copyright"> <div id="copyright">
<p><a href="https://gitorious.org/jirafeau"></a><br /><a href="http://www.gnu.org/licenses/agpl.html">agplv3</a> | <a href="https://gitorious.org/jirafeau">Jirafeau Project</a> | <a href="<?php echo $cfg['web_root'] . '/tos.php'; ?>">Terms of Service</a></p> <p><a href="https://gitlab.com/mojo42/Jirafeau/wikis/home"></a><br /><a href="http://www.gnu.org/licenses/agpl.html">agplv3</a> | <a href="https://gitlab.com/mojo42/Jirafeau/wikis/home">Jirafeau Project</a> | <a href="<?php echo $cfg['web_root'] . '/tos.php'; ?>">Terms of Service</a></p>
</div> </div>
</div> </div>
<div id="jyraphe"> <div id="jyraphe">

View file

@ -8,9 +8,15 @@ if (stristr ($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml'))
header('Content-Type: ' . $content_type); header('Content-Type: ' . $content_type);
$protocol = (bool)is_ssl() ? 'https' : 'http';
if ( !empty($cfg['web_root']) ) {
$cfg['web_root'] = preg_replace('#https?://#', $protocol . '://', $cfg['web_root'], 1);
}
/* Avoids irritating errors with the installer (no conf file is present then). */ /* Avoids irritating errors with the installer (no conf file is present then). */
if (!isset ($cfg['web_root'])) if (!isset ($cfg['web_root']))
$web_root = 'http://' . $_SERVER['HTTP_HOST'] . '/'; $web_root = $protocol+'://' . $_SERVER['HTTP_HOST'] . '/';
else else
$web_root = $cfg['web_root']; $web_root = $cfg['web_root'];
@ -29,6 +35,6 @@ else
<link href="<?php echo $web_root . 'media/' . $style . '/style.css.php'; ?>" rel="stylesheet" type="text/css" /> <link href="<?php echo $web_root . 'media/' . $style . '/style.css.php'; ?>" rel="stylesheet" type="text/css" />
</head> </head>
<body> <body>
<script language="Javascript" src="lib/functions.js"></script> <script language="Javascript" src="lib/functions_v3.js"></script>
<div id="content"> <div id="content">
<h1><a href="<?php echo $web_root; ?>"><?php echo t('Jirafeau, your web file repository'); ?></a></h1> <h1><a href="<?php echo $web_root; ?>"><?php echo t('Jirafeau, your web file repository'); ?></a></h1>

View file

@ -38,6 +38,7 @@ header("Content-type: text/css");
3 = Options 3 = Options
4 = Upload 4 = Upload
5 = Terms of service 5 = Terms of service
6 = Admin
========================================================================== */ ========================================================================== */
@ -45,12 +46,6 @@ header("Content-type: text/css");
1 = Basic Style 1 = Basic Style
========================================================================== */ ========================================================================== */
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body { body {
background: #efebe9; background: #efebe9;
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
@ -66,6 +61,8 @@ h1 a {
width: 194px; width: 194px;
height: 185px; height: 185px;
margin: 1em auto; margin: 1em auto;
position: relative;
left: 0.4em;
} }
h2 { h2 {
@ -77,10 +74,11 @@ fieldset {
border: 0; border: 0;
padding: 1.5em; padding: 1.5em;
margin: 0 auto; margin: 0 auto;
border-radius: 2px; border-radius: 8px;
width: 25em; width: 20em;
border: 7px dashed #bcaaa4; border: 7px dashed #bcaaa4;
min-height: 17em; min-height: 15em;
min-width: 30em;
position: relative; position: relative;
} }
@ -90,10 +88,17 @@ legend {
color: #663D1C; color: #663D1C;
font-size: 1.2em; font-size: 1.2em;
display: block; display: block;
width: 100%; min-width: 8em;
text-align: center; text-align: center;
} }
table a { color: #000;}
table a:hover,
table a:focus {
text-decoration: none;
}
input[type="submit"] { input[type="submit"] {
background: #0D9CB2; background: #0D9CB2;
border: 0; border: 0;
@ -102,68 +107,27 @@ input[type="submit"] {
color: #FFF; color: #FFF;
border-bottom: 5px solid #085B69; border-bottom: 5px solid #085B69;
cursor: pointer; cursor: pointer;
margin: 10px;
} }
select,
input[type="text"],
input[type="password"] {
border: 1;
padding: 5px 5px;
font-size: 1em;
}
select { width: 100%; }
input[type="submit"]:hover, input[type="submit"]:hover,
input[type="submit"]:focus { input[type="submit"]:focus {
border: 0; border: 0;
position: relative; position: relative;
top: 5px; top: 5px;
margin-bottom: 5px; margin-bottom: 15px;
} }
select,
input[type="text"],
input[type="password"] {
border: 0;
padding: 0.5em 1em;
font-size: 1em;
width: 100%;
}
label {
font-weight: bold;
color: #663D1C;
}
#upload_password { width: 80%; }
.next input[type="submit"] {
position: relative;
margin-top: 0.5em;
padding: 0.4em 2.65em;
}
input[value="Déconnexion"] {
background: none;
color: #663D1C;
border: 0;
display: block;
margin: auto;
padding-left: 4em;
font-size: 1em;
font-style:italic;
}
input[value="Déconnexion"]:hover,
input[value="Déconnexion"]:focus {
top: 0;
margin-bottom: 0;
text-decoration: underline;
}
form[action="index.php"] .label {
width: 7em;
}
form[action="index.php"] fieldset {
border: 0;
background: #d7ccc8;
min-height: 5em;
}
.inner { .inner {
margin-top: 3em; margin-top: 3em;
} }
@ -181,6 +145,10 @@ form[action="index.php"] fieldset {
border-color: #663D1C; border-color: #663D1C;
} }
#upload > form {
text-align: center;
}
#file_select { #file_select {
position: absolute; position: absolute;
top: 0; top: 0;
@ -201,6 +169,7 @@ form[action="index.php"] fieldset {
text-align: center; text-align: center;
font-size: 0.8em; font-size: 0.8em;
color: #795548; color: #795548;
padding-left: 3em;
} }
#copyright a { #copyright a {
@ -221,18 +190,18 @@ form[action="index.php"] fieldset {
position: relative; position: relative;
z-index: 10; z-index: 10;
background: #efebe9; background: #efebe9;
width: 100%;
height: 90%;
} }
#options tr { height: 2.7em; } #options tr { height: 2.7em; }
#option_table tr:first-child td:first-child { #option_table tr:first-child {
width: 12em; width: 100%;
font-weight: bold; height: 100%;
color: #663D1C;
} }
#option_table tr td:first-child { #option_table td:first-child {
} }
#options input[type="submit"] { #options input[type="submit"] {
@ -250,20 +219,16 @@ form[action="index.php"] fieldset {
.error { .error {
text-align: center; text-align: center;
color: #795548; color: #795548;
padding-left: 3em;
} }
#upload_finished a, #upload_finished a,
#uploading a, #uploading a {
#submit a {
font-weight: bold; font-weight: bold;
text-decoration: none; text-decoration: none;
color: #795548; color: #795548;
} }
#submit a:before {
content: " ";
}
#uploaded_percentage { #uploaded_percentage {
font-size: 2em; font-size: 2em;
font-weight: bold; font-weight: bold;
@ -272,28 +237,15 @@ form[action="index.php"] fieldset {
#upload_finished a:hover, #upload_finished a:hover,
#uploading a:hover, #uploading a:hover,
#upload_finished a:focus, #upload_finished a:focus,
#uploading a:focus, #uploading a:focus {
#submit a:hover,
#submit a:focus {
text-decoration: underline; text-decoration: underline;
} }
.message, .message,
.error { .error {
color: #d55548;
font-style: italic; font-style: italic;
}
#submit tr:first-child td:first-child {
font-weight: bold; font-weight: bold;
color: #795548;
}
#submit tr + tr td {
padding-top: 1em;
}
#submit td {
color: #795548;
} }
/* ========================================================================== /* ==========================================================================
@ -329,4 +281,73 @@ textarea[readonly="readonly"] + p + p a:hover,
textarea[readonly="readonly"] + p a:focus, textarea[readonly="readonly"] + p a:focus,
textarea[readonly="readonly"] + p + p a:focus { textarea[readonly="readonly"] + p + p a:focus {
text-decoration: underline; text-decoration: underline;
} }
/* ==========================================================================
6 = Admin
========================================================================== */
#install fieldset,
#install + fieldset {
width: auto;
max-width: 50em;
border: 7px dashed #bcaaa4;
}
#install table,
#install + fieldset table {
width: 100%;
border-collapse: collapse;
border-bottom: 2px solid #FFF;
}
#install td,
#install + fieldset td {
padding: 0.5em 1em;
border: 2px solid #FFF;
border-bottom: 0;
}
#install td:empty {
width: 13.1em;
}
#install table form:nth-child(odd),
#install + fieldset tr:nth-child(odd) {
background: #bcaaa4;
}
#install fieldset > form {
margin-top: 2em;
text-align: center;
}
#install form {
display: table;
width: 100%;
}
#install td:last-child { text-align: left; }
#install .info { width: 19em; }
#install input[type="submit"] {
min-width: 10.5em;
}
#install + fieldset table {
font-size: 0.9em;
}
#install + fieldset td:first-child input[type="submit"] {
background: none;
padding: 0;
color: #000;
font-weight: bold;
border-bottom: 0;
}
#install + fieldset td:first-child input[type="submit"]:hover,
#install + fieldset td:first-child input[type="submit"]:focus {
text-decoration: underline;
}

0
sources/media/industrial/bandeau.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

0
sources/media/industrial/error.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

0
sources/media/industrial/jyraphe.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
sources/media/industrial/ok.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 492 B

After

Width:  |  Height:  |  Size: 492 B

8
sources/media/industrial/style.css.php Executable file → Normal file
View file

@ -158,13 +158,7 @@ input:hover {
margin-right: 5%; margin-right: 5%;
} }
#upload { #upload {}
text-align: center;
width: 30em;
background: #E2f5ff;
border: 2px solid #02233f;
margin: auto;
}
#uploading { #uploading {
text-align: center; text-align: center;

View file

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

View file

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 492 B

After

Width:  |  Height:  |  Size: 492 B

0
sources/media/modern/bandeau.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

0
sources/media/modern/error.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

0
sources/media/modern/jyraphe.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

0
sources/media/modern/ok.png Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 688 B

6
sources/media/modern/style.css.php Executable file → Normal file
View file

@ -81,6 +81,12 @@ h1 a {
color: #333; color: #333;
} }
h2 {
text-decoration: none;
color: #333;
text-align: center;
}
fieldset p { fieldset p {
margin-left: 25%; margin-left: 25%;
} }

1254
sources/script.php Executable file → Normal file

File diff suppressed because it is too large Load diff

0
sources/tos.php Executable file → Normal file
View file

0
sources/tos_text.php Executable file → Normal file
View file