31 Commits

Author SHA1 Message Date
Jerome Jutteau
33c3f08cac [BUGFIX] refactor htmlspecialchars escaping
Signed-off-by: Jerome Jutteau <mojo@couak.net>
2018-05-11 23:57:50 +02:00
Jerome Jutteau
2dc4984ad5 [TASK] set a translation string id for each element
closes #158

Signed-off-by: Jerome Jutteau <j.jutteau@gmail.com>
2018-02-16 18:18:59 +01:00
Jerome Jutteau
5efae52e30 [BUGFIX] Delete links using POST
closes #136

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2017-09-07 17:32:13 +00:00
Jerome Jutteau
379a0267c2 [TASK] Remove Alias support
Some time ago, this was a weird idea.
It's useless to keep this, it's just dead garbage code.

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2017-09-07 16:06:02 +00:00
Jerome Jutteau
75c98902b1 [BUGFIX] Prevent object ProgressEvent Error
This is done by removing unnecessary usage of web_root URL.

closes #127

Signed-off-by: Jerome Jutteau <j.jutteau@gmail.com>
2017-07-09 14:18:34 +02:00
Dan Untenzu
fd3aaad433 [FEATURE] Styles: Add classes to forms
Enable better styling for classes.
2017-03-30 16:03:42 +02:00
Dan Untenzu
96707e02b8 [FEATURE] Switch to PSR-2
Convert all PHP files to PSR-2, which defined
a basic Coding Style Guide for PHP projects.

Using the awesome friendsofphp/php-cs-fixer tool,
running with the @PSR2 ruleset.

1) script.php (no_spaces_after_function_name, braces)
2) f.php (indentation_type, no_spaces_after_function_name, braces)
3) install.php (indentation_type, function_declaration, elseif, no_spaces_after_function_name, braces)
4) lib/functions.php (no_spaces_inside_parenthesis, method_argument_space, function_declaration, elseif, no_spaces_after_function_name, lowercase_constants, lowercase_keywords, braces, single_blank_line_at_eof)
5) lib/functions.js.php (no_spaces_after_function_name)
6) lib/lang.php (function_declaration, no_spaces_after_function_name, lowercase_constants, no_closing_tag, braces, single_blank_line_at_eof)
7) lib/template/footer.php (braces)
8) lib/config.local.bak.php (method_argument_space, no_spaces_after_function_name, no_closing_tag, single_blank_line_at_eof)
9) lib/config.original.php (no_spaces_after_function_name, no_closing_tag, single_blank_line_at_eof)
0) lib/settings.php (indentation_type, no_spaces_after_function_name, braces)
1) lib/config.local.php (no_spaces_after_function_name, single_blank_line_at_eof)
2) index.php (indentation_type, no_spaces_after_function_name, braces)
3) admin.php (no_spaces_after_function_name, braces)
4) tos.php (no_spaces_after_function_name, no_closing_tag, single_blank_line_at_eof)

Refs #103
2017-02-23 18:34:20 +01:00
Dan Untenzu
bf0a496a10 [FEATURE] Replace all domain depended links
Replace all occurences of "web_root" (domain depended links)
with "JIRAFEAU_ABSPREFIX" (absolute links to the root level).

Links like "https://example.com/foo/functions.js" are replaced
with "/foo/functions.js".

Refs #79
2017-02-23 18:34:19 +01:00
Dan Untenzu
04145f58ba [BUGFIX] Translations: Rename ToS
Rename ToS label to plural
2017-01-19 19:03:03 +00:00
Dan Untenzu
af7e43a4a3 [FEATURE] Move config include into settings file
Move the include of the original and the local
configuration file into the settings file to reduce one
includes in each file, have all settings in one place
and remove unneccessary code from the config file
(which makes it easier to copy and change it).
2017-01-19 19:03:03 +00:00
Jerome Jutteau
65a2f5a4f5 add a sleep() when a bad password is provided 2015-11-13 21:57:49 +01:00
Jerome Jutteau
86f660ae27 fixed bad error printing
Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-07-16 10:51:28 +02:00
Jerome Jutteau
d98c495abf add an alias system to the API.
This alias system permits to create an "alias" to an uploaded file.
This permits to upload some new content and update the alias to the new
content.

This will permits to implement a lot of services, for example:
- Storing a live chat between two people
- Update a list of files
- Put a whole website and update it

A few notes:

- An alias MUST point to an existing upload at his creation or update.
- Alias are not protected against reading but are protected against updates
  and deletion using a password. The destination of the alias can still be
  protected by a password.
- Alias can be updated to change it's target and/or change the password.
- Alias names and passwords must be between 8 and 32 characters.

Some examples:

- Create an alias:

curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     -F "destination=13dA8apU" \
     -F "password=my-very-secret-password" \
     http://my-host/jirafeau/script.php?alias_create=1
=> OK

- Get an alias

curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     http://my-host/jirafeau/script.php?alias_get=1
=> 13dA8apU

- Update an alias:
curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     -F "destination=2Ab6f17o" \
     -F "password=my-new-password" \
     http://my-host/jirafeau/script.php?alias_update=1
=> OK

- Access to alias using the web interface, let's go to:
http://couak.net/jirafeau-dev/f.php?h=my-awsome-alias

- Delete an alias:
curl -X POST \
     --http1.0 \
     -F "alias=my-awsome-alias" \
     -F "password=my-new-password" \
     http://my-host/jirafeau/script.php?alias_delete=1
=> OK

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-07-06 23:54:04 +02:00
Jerome Jutteau
c54ae2c242 Escape filenames to not break HTML views
fixes #39

Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-05-19 13:58:36 +02:00
Jerome Jutteau
2fa05274bd add Content-MD5 header when downloading a file
Signed-off-by: Jerome Jutteau <mojo@couak.net>
2015-05-07 18:42:38 +02:00
Jerome Jutteau
90462b6a06 remove option which shows download page
This commit make Jirafeau to always have the download page link available.
This option is maybe not really usefull anymore as the user already have a
download link and a preview link after the upload.
2015-04-07 13:36:45 +02:00
Jerome Jutteau
68892c7ee6 add warning when the file will be downloadable one time only
fixes #27
2015-04-06 17:13:33 +02:00
Jerome Jutteau
d496172554 f.php: remove 'Access denied' header 2015-03-26 09:22:48 +01:00
Jerome Jutteau
e4bb712d9d f.php: fix js error in download page 2015-03-23 13:48:52 +01:00
Jerome Jutteau
a80b0189a7 f.php fix bad file name when browser cannot preview file
This permits to have the original file name when browser force user
to download the file because he cannot preview it. closes #24
2015-03-23 13:48:49 +01:00
Jerome Jutteau
a41981033b f.php: replace 'submit' id to not be confused 2015-03-23 13:48:42 +01:00
Julien Malik
ae8b0ce039 typo : accept of our / accept our 2015-03-22 23:20:37 +01:00
Jerome Jutteau
47405a7fcc cleanest distinction bewteen 'delete' and 'download'
Also fix typo
2015-03-15 10:32:47 +01:00
Jerome Jutteau
045f02b539 Fixes #17 Add links for preview and direct download after uploading
- Also fixe previewable files types
- Fixe problem with download page and previewable files
- Only show preview link if the content is previewable
- Don't propose preview and direct download links when a password is set
2015-03-11 00:08:14 +01:00
Jerome Jutteau
53819d60b1 refactor some url parameters when downloading 2015-03-10 21:25:21 +01:00
Jerome Jutteau
625f38a7de adapt license year to 2015 2015-03-10 10:21:26 +01:00
Jerome Jutteau
4013663192 Fixes #3 Content type should always be put in headers 2015-02-22 23:56:45 +01:00
Jerome Jutteau
8d0d50765b Remove errors when occurs 2013-08-01 19:29:56 +00:00
Jerome Jutteau
3d9792a36b Fix config parameter and rename config.php 2013-07-29 21:53:54 +00:00
Jerome Jutteau
53390fef42 Fix presentation with download page option activated 2013-07-29 20:03:48 +00:00
Jerome Jutteau
b66edd26d7 Rename file.php to f.php to minimize url size
Note: always better with url rewriting
2013-07-29 20:03:39 +00:00