From 50b1f00c1703a5055c1d9343137479b0d2f1f994 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Jul 14 2017 10:52:03 +0000 Subject: Add ability to protect download with a password --- diff --git a/cpanfile b/cpanfile index b006806..358d0d4 100644 --- a/cpanfile +++ b/cpanfile @@ -15,3 +15,4 @@ requires 'Filesys::DfPortable'; requires 'Switch'; requires 'Data::Entropy'; requires 'Net::LDAP'; +requires 'Crypt::SaltedHash'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 38d6810..dd257b8 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -65,6 +65,15 @@ DISTRIBUTIONS requirements: ExtUtils::MakeMaker 0 perl 5.006 + Crypt-SaltedHash-0.09 + pathname: G/GS/GSHANK/Crypt-SaltedHash-0.09.tar.gz + provides: + Crypt::SaltedHash 0.09 + requirements: + Digest 0 + ExtUtils::MakeMaker 6.30 + Test::Fatal 0 + Test::More 0 DBD-SQLite-1.48 pathname: I/IS/ISHIGAKI/DBD-SQLite-1.48.tar.gz provides: @@ -893,6 +902,18 @@ DISTRIBUTIONS Text::Balanced 2 if 0 perl 5.005 + Test-Fatal-0.014 + pathname: R/RJ/RJBS/Test-Fatal-0.014.tar.gz + provides: + Test::Fatal 0.014 + requirements: + Carp 0 + Exporter 5.57 + ExtUtils::MakeMaker 0 + Test::Builder 0 + Try::Tiny 0.07 + strict 0 + warnings 0 Test-Script-1.10 pathname: P/PL/PLICEASE/Test-Script-1.10.tar.gz provides: @@ -969,6 +990,18 @@ DISTRIBUTIONS Time::Zone 2.24 requirements: ExtUtils::MakeMaker 0 + Try-Tiny-0.28 + pathname: E/ET/ETHER/Try-Tiny-0.28.tar.gz + provides: + Try::Tiny 0.28 + requirements: + Carp 0 + Exporter 5.57 + ExtUtils::MakeMaker 0 + constant 0 + perl 5.006 + strict 0 + warnings 0 URI-1.71 pathname: E/ET/ETHER/URI-1.71.tar.gz provides: diff --git a/lib/Lufi.pm b/lib/Lufi.pm index a27b00f..5374754 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -13,20 +13,21 @@ sub startup { my $config = $self->plugin('Config' => { default => { - provisioning => 100, - provis_step => 5, - length => 10, - token_length => 32, - secrets => ['hfudsifdsih'], - default_delay => 0, - max_delay => 0, - mail => { + provisioning => 100, + provis_step => 5, + length => 10, + token_length => 32, + secrets => ['hfudsifdsih'], + default_delay => 0, + max_delay => 0, + mail => { how => 'sendmail' }, - mail_sender => 'no-reply@lufi.io', - theme => 'default', - upload_dir => 'files', - session_duration => 3600, + mail_sender => 'no-reply@lufi.io', + theme => 'default', + upload_dir => 'files', + session_duration => 3600, + allow_pwd_on_files => 0, } }); @@ -229,6 +230,16 @@ sub startup { mkdir($self->config('upload_dir'), 0700) unless (-d $self->config('upload_dir')); die ('The upload directory ('.$self->config('upload_dir').') is not writable') unless (-w $self->config('upload_dir')); + # SQLite database migration if needed + my $columns = LufiDB::Files->table_info; + my $pwd_col = 0; + foreach my $col (@{$columns}) { + $pwd_col = 1 if $col->{name} eq 'passwd'; + } + unless ($pwd_col) { + LufiDB->do('ALTER TABLE files ADD COLUMN passwd TEXT;'); + } + # Default layout $self->defaults(layout => 'default'); diff --git a/lib/Lufi/Controller/Files.pm b/lib/Lufi/Controller/Files.pm index a56b01a..b25bca6 100644 --- a/lib/Lufi/Controller/Files.pm +++ b/lib/Lufi/Controller/Files.pm @@ -9,6 +9,7 @@ use Lufi::Slice; use File::Spec::Functions; use Number::Bytes::Human qw(format_bytes); use Filesys::DfPortable; +use Crypt::SaltedHash; sub upload { my $c = shift; @@ -98,6 +99,14 @@ sub upload { unless (defined $delay) { $delay = (($json->{delay} > 0 && $json->{delay} <= $c->max_delay) || $c->max_delay == 0) ? $json->{delay} : $c->max_delay; } + # If we have a password + my $salted_pwd; + if ($c->config('allow_pwd_on_files') && defined($json->{file_pwd}) && $json->{file_pwd} ne '') { + my $csh = Crypt::SaltedHash->new(algorithm => 'SHA-256', salt_len => 8); + $csh->add($json->{file_pwd}); + + $salted_pwd = $csh->generate(); + } my $creator = $c->ip; if (defined($c->config('ldap'))) { @@ -112,7 +121,8 @@ sub upload { filename => $json->{name}, filesize => $json->{size}, nbslices => $json->{total}, - mod_token => $c->shortener($c->config('token_length')) + mod_token => $c->shortener($c->config('token_length')), + passwd => $salted_pwd ); $f->write; } @@ -228,29 +238,41 @@ sub download { message => sub { my ($ws, $json) = @_; $json = decode_json $json; - if (defined($json->{part})) { - # Make $num an integer instead of a string - my $num = $json->{part} + 0; - - # Get the slice - my $e = $f->slices->[$num]; - my $text = slurp $e->path; - - my ($json2) = split('XXMOJOXX', $text, 2); - $json2 = decode 'UTF-8', $json2; - $text =~ s/^.*?XXMOJOXX/${json2}XXMOJOXX/; - - # Send the slice - $c->send($text); - } elsif (defined($json->{ended}) && $json->{ended}) { - $f->counter($f->counter + 1); - $f->last_access_at(time); - - if ($f->delete_at_first_view) { - $f->delete; - } else { - $f->write; + + # Do we need a password? + my $valid = 1; + if ($c->config('allow_pwd_on_files') && defined($f->{passwd})) { + my $pwd = $json->{file_pwd}; + $valid = Crypt::SaltedHash->validate($f->{passwd}, $json->{file_pwd}, 8); + } + + if ($valid) { + if (defined($json->{part})) { + # Make $num an integer instead of a string + my $num = $json->{part} + 0; + + # Get the slice + my $e = $f->slices->[$num]; + my $text = slurp $e->path; + + my ($json2) = split('XXMOJOXX', $text, 2); + $json2 = decode 'UTF-8', $json2; + $text =~ s/^.*?XXMOJOXX/${json2}XXMOJOXX/; + + # Send the slice + $c->send($text); + } elsif (defined($json->{ended}) && $json->{ended}) { + $f->counter($f->counter + 1); + $f->last_access_at(time); + + if ($f->delete_at_first_view) { + $f->delete; + } else { + $f->write; + } } + } else { + $c->send(encode_json({msg => $c->l('Your password is not valid. Please refresh the page to retry.')})); } } ); @@ -291,7 +313,8 @@ sub r { my $f = Lufi::File->new(record => $records[0]); return $c->render( template => 'render', - f => $f + f => $f, + file_pwd => ($c->config('allow_pwd_on_files') && defined($records[0]->{passwd})) ); } else { return $c->render( diff --git a/lib/Lufi/File.pm b/lib/Lufi/File.pm index 584eda4..ddc3613 100644 --- a/lib/Lufi/File.pm +++ b/lib/Lufi/File.pm @@ -25,6 +25,7 @@ has 'complete' => 0; has 'slices' => sub { return Mojo::Collection->new(); }; +has 'passwd'; sub new { my $c = shift; @@ -53,6 +54,7 @@ sub write { mod_token => $c->mod_token, nbslices => $c->nbslices, complete => $c->complete, + passwd => $c->passwd, ); return $c; @@ -89,6 +91,7 @@ sub _slurp { $c->mod_token($c->record->mod_token) if defined $c->record->mod_token; $c->nbslices($c->record->nbslices) if defined $c->record->nbslices; $c->complete($c->record->complete) if defined $c->record->complete; + $c->passwd($c->record->passwd) if defined $c->record->passwd; my @slices = LufiDB::Slices->select('WHERE short = ? ORDER BY j ASC', $c->short); diff --git a/lib/LufiDB.pm b/lib/LufiDB.pm index 6d35470..1bb66f4 100644 --- a/lib/LufiDB.pm +++ b/lib/LufiDB.pm @@ -37,7 +37,8 @@ use ORLite { last_access_at INTEGER, mod_token TEXT, nbslices INTEGER, - complete INTEGER)' + complete INTEGER, + passwd TEXT)' ); $dbh->do( 'CREATE TABLE slices ( diff --git a/lufi.conf.template b/lufi.conf.template index a337d1c..33aefac 100644 --- a/lufi.conf.template +++ b/lufi.conf.template @@ -137,6 +137,10 @@ # optional, default is 3600 #session_duration => 3600, + # allow to add a password on files, asked before allowing to download files + # optional, default to 0 + #allow_pwd_on_files => 0, + ######################### # Lufi cron jobs settings ######################### diff --git a/themes/default/lib/Lufi/I18N/en.po b/themes/default/lib/Lufi/I18N/en.po index d3bdec0..f4d7548 100644 --- a/themes/default/lib/Lufi/I18N/en.po +++ b/themes/default/lib/Lufi/I18N/en.po @@ -37,7 +37,7 @@ msgstr "" msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" msgstr "" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "" @@ -45,12 +45,16 @@ msgstr "" msgid "About" msgstr "" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." msgstr "" #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "" @@ -62,11 +66,11 @@ msgstr "" msgid "Bad CSRF token!" msgstr "" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "" -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "" @@ -78,23 +82,23 @@ msgstr "" msgid "Comma-separated email addresses" msgstr "" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:422 msgid "Could not delete the file. You are not authenticated." msgstr "" -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:406 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "" @@ -106,7 +110,7 @@ msgstr "" msgid "Delete at first download?" msgstr "" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "" @@ -114,15 +118,15 @@ msgstr "" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "" -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "" -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "" @@ -130,7 +134,7 @@ msgstr "" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "" -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "" @@ -146,23 +150,23 @@ msgstr "" msgid "Emails" msgstr "" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:229 msgid "Error: the file existed but was deleted." msgstr "" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "" @@ -174,7 +178,7 @@ msgstr "" msgid "Export localStorage data" msgstr "" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:390 msgid "File deleted" msgstr "" @@ -182,7 +186,7 @@ msgstr "" msgid "File name" msgstr "" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "" @@ -198,11 +202,11 @@ msgstr "" msgid "Here's some files" msgstr "" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "" @@ -238,7 +242,7 @@ msgstr "" msgid "Information about delays" msgstr "" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "" @@ -263,11 +267,11 @@ msgid "My files" msgstr "" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "" -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "" @@ -275,7 +279,7 @@ msgstr "" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "" -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "" @@ -284,7 +288,7 @@ msgstr "" msgid "Please contact the administrator: %1" msgstr "" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "" @@ -300,7 +304,7 @@ msgstr "" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "" -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "" @@ -312,7 +316,7 @@ msgstr "" msgid "Send with your own mail software" msgstr "" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "" @@ -329,7 +333,7 @@ msgstr "" msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "" -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "" @@ -349,7 +353,7 @@ msgstr "" msgid "The email subject can't be empty." msgstr "" -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:387 msgid "The file has already been deleted" msgstr "" @@ -362,7 +366,7 @@ msgstr "" msgid "The following email addresses are not valid: %1" msgstr "" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "" @@ -374,7 +378,7 @@ msgstr "" msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "" -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:181 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "" @@ -382,22 +386,22 @@ msgstr "" msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:360 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:350 msgid "Unable to get counter for %1. The token is invalid." msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:370 msgid "Unable to get counter for %1. You are not authenticated." msgstr "" @@ -409,11 +413,11 @@ msgstr "" msgid "Uploaded at" msgstr "" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "" @@ -433,15 +437,15 @@ msgstr "" msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "" -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "" -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "" @@ -454,10 +458,14 @@ msgid "You must give email addresses." msgstr "" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "" +#: lib/Lufi/Controller/Files.pm:275 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -486,6 +494,6 @@ msgstr "" msgid "no time limit" msgstr "" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "" diff --git a/themes/default/lib/Lufi/I18N/fr.po b/themes/default/lib/Lufi/I18N/fr.po index 4f4e386..f299514 100644 --- a/themes/default/lib/Lufi/I18N/fr.po +++ b/themes/default/lib/Lufi/I18N/fr.po @@ -39,7 +39,7 @@ msgstr " :" msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" msgstr "Un merci avec une photo de chaton sur Diaspora* ou Twitter fait aussi l’affaire ;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Abandonner" @@ -47,12 +47,16 @@ msgstr "Abandonner" msgid "About" msgstr "À propos" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "Ajouter un mot de passe au(x) fichier(s)" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." msgstr "Comme Lufi est un logiciel libre soumis aux termes de la license AGPLv3, vous pouvez l’installer sur votre propre serveur. Veuillez consulter le Wiki pour voir la procédure." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Demande de récupération du fragment de fichier XX1 sur %1" @@ -64,11 +68,11 @@ msgstr "Retour à la page d’accueil" msgid "Bad CSRF token!" msgstr "Mauvais jeton CSRF !" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Cliquez ici pour rafraîchir la page et redémarrer le téléchargement." -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "Cliquez pour ouvrir le navigateur de fichiers" @@ -80,23 +84,23 @@ msgstr "Fermer" msgid "Comma-separated email addresses" msgstr "Adresses mails séparées par des virgules" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "Copier tous les liens dans le presse-papier" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "Copier dans le presse-papier" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:422 msgid "Could not delete the file. You are not authenticated." msgstr "Impossible de supprimer le fichier. Vous n’êtes pas connecté·e." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:406 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Impossible de retrouver le fichier. Êtes-vous sûr(e) que l’URL et le jeton sont les bons ?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossible de retrouver le fichier. Êtes-vous sûr(e) que l’URL est la bonne ?" @@ -108,7 +112,7 @@ msgstr "Compteur" msgid "Delete at first download?" msgstr "Supprimer après le premier téléchargement ?" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Lien de suppression" @@ -116,15 +120,15 @@ msgstr "Lien de suppression" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "Ne vous inquiétez pas : si un utilisateur commence à télécharger le fichier avant son expiration et que le téléchargement se termine après l’expiration, l’utilisateur pourra quand même récupérer le fichier." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Télécharger" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Téléchargement abandonné." -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Lien de téléchargement" @@ -132,7 +136,7 @@ msgstr "Lien de téléchargement" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "Faites glisser des fichiers dans la zone prévue à cet effet ou sélectionnez un fichier de façon classique et les fichiers seront découpés en morceaux, chiffrés et envoyés au serveur. Vous récupérerez deux liens par fichier : un lien de téléchargement et un lien pour supprimer le fichier quand vous le souhaitez." -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "Glissez vos fichiers ici" @@ -148,23 +152,23 @@ msgstr "Sujet du mail" msgid "Emails" msgstr "Mails" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "Chiffrement du fragment XX1 sur XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:229 msgid "Error: the file existed but was deleted." msgstr "Erreur : le fichier existait mais a été supprimé" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "Erreur : le fichier n’a pas été envoyé dans son intégralité" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Erreur : impossible de retrouver le fichier. Êtes-vous sûr(e) de l’URL ?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "Expiration :" @@ -176,7 +180,7 @@ msgstr "Expire le" msgid "Export localStorage data" msgstr "Exporter les données localStorage" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:390 msgid "File deleted" msgstr "Fichier supprimé" @@ -184,7 +188,7 @@ msgstr "Fichier supprimé" msgid "File name" msgstr "Nom du fichier" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Récupérer le fichier" @@ -200,11 +204,11 @@ msgstr "Bonjour,\\n\\nVoici quelques fichiers que je souhaite partager avec toi msgid "Here's some files" msgstr "Voici quelques fichiers" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "Appuyez sur la touche Entrée puis faites Ctrl+C pour copier tous les liens de téléchargement" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "Appuyez sur la touche Entrée puis faites Ctrl+C pour copier le lien de téléchargement" @@ -240,7 +244,7 @@ msgstr "Important : plus d’informations sur les délais" msgid "Information about delays" msgstr "Information sur les délais" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "Il semble que la clé dans votre URL soit incorrecte. Veuillez vérifier votre URL." @@ -265,11 +269,11 @@ msgid "My files" msgstr "Mes fichiers" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "Espace disque insuffisant sur le serveur pour ce fichier (taille du fichier : %1)." -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Pas de délai d’expiration" @@ -277,7 +281,7 @@ msgstr "Pas de délai d’expiration" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "Seuls les fichiers envoyés avec ce navigateur web sont listés ici. Les informations sont stockées en localStorage : si vous supprimez vos données localStorage, vous perdrez ces informations." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Mot de passe" @@ -286,7 +290,7 @@ msgstr "Mot de passe" msgid "Please contact the administrator: %1" msgstr "Veuillez contacter l’administrateur : %1" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "Veuillez patientez pendant la récupération de votre fichier. Nous devons d’abord récupérer et déchiffrer tous les fragments avant que vous puissiez le télécharger." @@ -302,7 +306,7 @@ msgstr "Supprimer du localStorage les fichiers expirés" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "Les lignes en rouge indiquent que le fichier a expiré et n’est plus disponible." -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Envoyer tous les liens par mail" @@ -314,7 +318,7 @@ msgstr "Envoyer avec ce serveur" msgid "Send with your own mail software" msgstr "Envoyer avec votre propre logiciel de mail" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "Envoi du fragment XX1 sur XX2. Veuillez patienter, la barre de progression peut mettre du temps avant d’avancer." @@ -331,7 +335,7 @@ msgstr "Connexion" msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "Désolé, l’envoi de fichier est actuellement désactivé. Veuillez réessayer plus tard." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "Désolé, l’envoi de fichier est désactivé." @@ -351,7 +355,7 @@ msgstr "Le corps du mail ne peut être vide." msgid "The email subject can't be empty." msgstr "Le sujet du mail ne peut être vide." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:387 msgid "The file has already been deleted" msgstr "Le fichier a déjà été supprimé" @@ -364,7 +368,7 @@ msgstr "Les fichiers envoyés sur une instance de Lufi sont chiffrés avant l’ msgid "The following email addresses are not valid: %1" msgstr "Les adresses mail suivantes ne sont pas valides : %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "Le(s) lien(s) a/ont été copié dans votre presse-papier" @@ -376,7 +380,7 @@ msgstr "Le mail a été envoyé." msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "L’auteur originel (et pour l’instant, le seul) est Luc Didry. Si vous avez envie de le supporter, vous pouvez le faire via Tipeee ou via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:181 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "Le serveur a été incapable de retrouver l’enregistrement du fichier auquel ajouter votre fragment de fichier. Veuillez contacter l’administrateur." @@ -384,22 +388,22 @@ msgstr "Le serveur a été incapable de retrouver l’enregistrement du fichier msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "Ce serveur impose des limitations selon la taille des fichiers. Le délai d’expiration de votre fichier sera le minimum entre ce que vous avez choisi et les limites suivantes :" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossible de copier le(s) lien(s) dans votre presse-papier" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:360 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossible de récupérer le compteur pour %1. Le fichier n’existe pas. Il va être supprimé de votre localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:350 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossible de récupérer le compteur pour %1. Le jeton est invalide." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:370 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossible de récupérer le compteur pour %1. Vous n’êtes pas connecté·e." @@ -411,11 +415,11 @@ msgstr "Envoyer des fichiers" msgid "Uploaded at" msgstr "Envoyé le" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "Fichiers envoyés" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Erreur de communication WebSocket" @@ -435,15 +439,15 @@ msgstr "Vous pouvez voir la liste de vos fichiers en cliquant sur le lien « Mes msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "Vous n’avez pas besoin de vous enregistrer pour envoyer des fichiers mais notez que, pour des raisons légales, votre adresse IP sera enregistrée quand vous envoyez un fichier. Ne paniquez pas, c’est normalement le cas pour tous les sites où vous envoyez des fichiers." -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "Il semble que vous n’ayez pas de clé dans votre URL. Vous ne serez pas capable de déchiffrer le fichier. Téléchargement annulé." -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "Vous essayez de quitter la page. Le téléchargement sera annulé. Êtes-vous sûr(e) ?" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "Vous essayez de quitter la page. L’envoi sera annulé. Êtes-vous sûr(e) ?" @@ -456,10 +460,14 @@ msgid "You must give email addresses." msgstr "Vous devez envoyer des adresses mail." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "Votre fichier est trop volumineux : %1 (la taille maximum autorisée est %2)" +#: lib/Lufi/Controller/Files.pm:275 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "Votre mot de passe est invalide. Veuillez rafraîchir la page pour réessayer." + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -488,6 +496,6 @@ msgstr "pour %1 et plus, le fichier sera conservé indéfiniment." msgid "no time limit" msgstr "Pas de délai d'expiration" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "ou" diff --git a/themes/default/lib/Lufi/I18N/it.po b/themes/default/lib/Lufi/I18N/it.po index 9432e61..6e598da 100644 --- a/themes/default/lib/Lufi/I18N/it.po +++ b/themes/default/lib/Lufi/I18N/it.po @@ -39,7 +39,7 @@ msgstr " :" msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" msgstr "Un grazie con una foto di un gattino sur Diaspora* o Twitter è forte;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Annulla" @@ -47,12 +47,16 @@ msgstr "Annulla" msgid "About" msgstr "A proposito" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." msgstr "Poiché Lufi è un software libero soggetto ai termini della licenza AGPLv3, potete installarlo sul vostro server. Si consulti Wiki per vedere la procedura." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Recupero della porzione del file XX1 su %1" @@ -64,11 +68,11 @@ msgstr "Ritorna all'homepage" msgid "Bad CSRF token!" msgstr "Torken CSRF errato!" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Click qui per aggiornare la pagina e ricominciare il download." -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "Click per aprire il file browser" @@ -80,23 +84,23 @@ msgstr "Chiudi" msgid "Comma-separated email addresses" msgstr "Indirizzi email separati da virgole" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "Copiare tutti i link negli appunti" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "Copiare negli appunti" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:422 msgid "Could not delete the file. You are not authenticated." msgstr "Impossibile cancellare il file. Non siete autenticati." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:406 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Impossibile trovare il file. Sei sicuro che URL e token siano corretti ?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossibile trovare il file. Sei sicuro che l'URL sia corretto?" @@ -108,7 +112,7 @@ msgstr "Contatore" msgid "Delete at first download?" msgstr "Cancellare al primo download?" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Link per l'eliminazione" @@ -116,15 +120,15 @@ msgstr "Link per l'eliminazione" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "Non preoccuparti: se un utente cominciasse il download del file prima della scadenza ed il download terminasse dopo la scadenza, potrebbe ottenere il file." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Download" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Download annullato." -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Link per il download" @@ -132,7 +136,7 @@ msgstr "Link per il download" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "Trascinare e lasciare il file nell'are prevista o selezionare i file nel modo classico ed i file saranno divisi,cifrati ed inviati al server. Otterrete 2 link per ogni file : uno per il download ed uno per eliminare il file quando vorrete." -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "Lasciare i file qui" @@ -148,23 +152,23 @@ msgstr "Oggetto dell'email" msgid "Emails" msgstr "Email" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "Cifratura della parte XX1 di XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:229 msgid "Error: the file existed but was deleted." msgstr "Errore: il file esisteva ma è stato eliminato" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "Errore: il file non è stato inviato completamente" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Errore: impossibile trovare il file. Sei certo dell'URL ?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "Scadenza:" @@ -176,7 +180,7 @@ msgstr "Scade il" msgid "Export localStorage data" msgstr "Esportare i dati del localStorage" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:390 msgid "File deleted" msgstr "File cancellato" @@ -184,7 +188,7 @@ msgstr "File cancellato" msgid "File name" msgstr "Nome del file" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Ottenere il file" @@ -200,11 +204,11 @@ msgstr "Buongiorno,\\n\\necco qualche file che vorrei condividere con te:\\n" msgid "Here's some files" msgstr "Ecco qualche file" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "Premere Enter, poi Ctrl+C per copiare tutti i link di download" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "Premere Enter, poi Ctrl+C per copiare il link di download" @@ -240,7 +244,7 @@ msgstr "Importante : più informazioni sulle scadenze" msgid "Information about delays" msgstr "Informazione sulle scadenze" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "Sembra che la chiave nel tuo URL sia errata. Controllare il tuo URL." @@ -265,11 +269,11 @@ msgid "My files" msgstr "I miei file" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "Spazio disco insufficiente sul server per questo file (dimensione: %1)." -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Nessun ritardo per la scadenza" @@ -277,7 +281,7 @@ msgstr "Nessun ritardo per la scadenza" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "Solo i file inviati con questo browser web sono nella lista. Le informazioni sono memorizzate nel localStorage: se cancellaste i dati dal vostro localStorage, perdereste questa lista." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Password" @@ -286,7 +290,7 @@ msgstr "Password" msgid "Please contact the administrator: %1" msgstr "Contattare l'amministratore : %1" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "Attendere mentre otteniamo il vostro file. Dobbiamo prima scaricare e decifrare tutte le parti prima che possiate averlo." @@ -302,7 +306,7 @@ msgstr "Eliminare dal localStorage i file scaduti" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "Le righe in rosso indicano che il file è scaduto e non è più disponibile." -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Inviare tutti i link tramite email" @@ -314,7 +318,7 @@ msgstr "Inviare tramite questo server" msgid "Send with your own mail software" msgstr "Inviare tramite il vostro programma di posta" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "Invio della parte XX1 su XX2. Prego attendere, la barra di avanzamento può impiagare del tempo prima di avanzare." @@ -331,7 +335,7 @@ msgstr "Autenticazione" msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "L'invio del file è attualemente disattivato. Riprovare più tardi." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "L'invio del file è attualemente disattivato." @@ -351,7 +355,7 @@ msgstr "Il corpo dell'email non può essere vuoto." msgid "The email subject can't be empty." msgstr "Il soggetto dell'email non può essere vuoto." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:387 msgid "The file has already been deleted" msgstr "Il file è già stato cancellato" @@ -364,7 +368,7 @@ msgstr "I file inviati su un istanza di Lufi sono cifrati prima dell'invio al se msgid "The following email addresses are not valid: %1" msgstr "I seguenti indirizzi email non sono validi: %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "I link sono stati copiati negli appunti" @@ -376,7 +380,7 @@ msgstr "Email inviata." msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "L'autore ( e per ora l'unico) è Luc Didry. Se aveste voglia di aiutarlo, potreste farlo tramite Tipeee ou via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:181 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "Il server non è stato in grado di trovare il file record a cui aggiungere la vostra porzione di file. Prego contattare l'amministratore." @@ -384,22 +388,22 @@ msgstr "Il server non è stato in grado di trovare il file record a cui aggiunge msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "Questo server pone delle limitazioni in base alla dimensione del file.La data di scadenza del tuo file sarà la minore tra quella scelta e queste limitazioni:" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossibile copiare i link negli appunti" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:360 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossibile recuperare il contatore per %1. Il file non esiste. Il file sarà eliminato dal tuo localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:350 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossibile recuperare il contatore per %1. Il token non è valido." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:370 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossibile recuperare il contatore per %1. Non sei autenticato." @@ -411,11 +415,11 @@ msgstr "Invio dei file" msgid "Uploaded at" msgstr "Invio il" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "File inviati" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Errore di comunicazione WebSocket" @@ -435,15 +439,15 @@ msgstr "Puoi consultare la lista dei vostri file cliccando sul link « I miei fi msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "Non hai bisogno di registrarti per inviare i file ma devi essere consapevole che, per motivi legali, il tuo indirizzo IP sarà registrato quando invierai un file. Non ti preoccupare, avviene in tutti i siti su cui invii dei file." -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "Sembra che non ci sia una chiave nel tuo URL. Non sarai in grado di decifrare il file. Download annullato." -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "Hai cercato di uscire da questa pagina. Il download sarà cancellato. Sei sicuro?" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "Hai cercato di uscire da questa pagina. L'invio sarà cancellato. Sei sicuro?" @@ -456,10 +460,14 @@ msgid "You must give email addresses." msgstr "Devi fornire gli indirizzi email." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "Il vostro file è troppo grande : %1 (la dimensione massima permessa è %2)" +#: lib/Lufi/Controller/Files.pm:275 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -488,6 +496,6 @@ msgstr "per %1 e più, il file sarà conservato per sempre." msgid "no time limit" msgstr "nessuna limitazione temporale" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "o" diff --git a/themes/default/lib/Lufi/I18N/oc.po b/themes/default/lib/Lufi/I18N/oc.po index c9fdfa7..82266a0 100644 --- a/themes/default/lib/Lufi/I18N/oc.po +++ b/themes/default/lib/Lufi/I18N/oc.po @@ -39,7 +39,7 @@ msgstr " :" msgid "A thank you with a photo of kitten on Diaspora* or Twitter is cool too ;-)" msgstr "Un mercé amb una foto de caton sus Diaspora* o Twitter conven tanben ;-)" -#: themes/default/templates/render.html.ep:34 +#: themes/default/templates/render.html.ep:42 msgid "Abort" msgstr "Anullar" @@ -47,12 +47,16 @@ msgstr "Anullar" msgid "About" msgstr "A prepaus" +#: themes/default/templates/index.html.ep:71 +msgid "Add a password to file(s)" +msgstr "" + #: themes/default/templates/about.html.ep:18 msgid "As Lufi is a free software licensed under of the terms of the AGPLv3, you can install it on you own server. Have a look on the Wiki for the procedure." msgstr "Ja que Lufi es un logicial liure somés als tèrmes de la licéncia AGPLv3, podètz l’installer sus vòstre pròpri servidor. Mercés de consultar lo Wiki per veire la procedura." #. (stash('f') -#: themes/default/templates/render.html.ep:44 +#: themes/default/templates/render.html.ep:52 msgid "Asking for file part XX1 of %1" msgstr "Demanda del tròç XX1 sus %1 del fichièr" @@ -64,11 +68,11 @@ msgstr "Retorn a la pagina d’acuèlh" msgid "Bad CSRF token!" msgstr "Marrit geton CSRF !" -#: themes/default/templates/render.html.ep:40 +#: themes/default/templates/render.html.ep:48 msgid "Click here to refresh the page and restart the download." msgstr "Clicatz aquí per actualizar la pagina e tornar començar lo telecargament." -#: themes/default/templates/index.html.ep:72 +#: themes/default/templates/index.html.ep:80 msgid "Click to open the file browser" msgstr "Clicatz per dobrir lo navigador de fichièr" @@ -80,23 +84,23 @@ msgstr "Tampar" msgid "Comma-separated email addresses" msgstr "Adreças de corrièl separadas per de virgulas" -#: themes/default/templates/index.html.ep:92 +#: themes/default/templates/index.html.ep:100 msgid "Copy all links to clipboard" msgstr "Copiar totes los ligams dins lo quichapapièrs" -#: themes/default/templates/index.html.ep:95 +#: themes/default/templates/index.html.ep:103 msgid "Copy to clipboard" msgstr "Copiar dins lo quichapapièrs" -#: lib/Lufi/Controller/Files.pm:396 +#: lib/Lufi/Controller/Files.pm:422 msgid "Could not delete the file. You are not authenticated." msgstr "Impossible de suprimir lo fichièr. Sètz pas connectat-ada." -#: lib/Lufi/Controller/Files.pm:380 +#: lib/Lufi/Controller/Files.pm:406 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Impossible de trobar lo fichièr. Sètz segur-a que l’URL e lo geton son bons ?" -#: lib/Lufi/Controller/Files.pm:296 +#: lib/Lufi/Controller/Files.pm:322 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossible de trobar lo fichièr. Sètz segur-a que l’URL es bona ?" @@ -108,7 +112,7 @@ msgstr "Comptador" msgid "Delete at first download?" msgstr "Suprimir aprèp lo primièr telecargament ?" -#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:96 +#: themes/default/templates/files.html.ep:30 themes/default/templates/index.html.ep:104 msgid "Deletion link" msgstr "Ligam de supression" @@ -116,15 +120,15 @@ msgstr "Ligam de supression" msgid "Don't worry: if a user begins to download the file before the expiration and the download ends after the expiration, he will be able to get the file." msgstr "Vos copetz pas lo cap : se un utilizaire comença a telecagar lo fichièr abans son expiracion e que lo telecargament s’acaba aprèp l’expiracion, utilizaire poirà recuperar lo fichièr." -#: themes/default/templates/index.html.ep:98 +#: themes/default/templates/index.html.ep:106 themes/default/templates/render.html.ep:28 msgid "Download" msgstr "Telecargar" -#: themes/default/templates/render.html.ep:39 +#: themes/default/templates/render.html.ep:47 msgid "Download aborted." msgstr "Telecargament abandonat." -#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:97 +#: themes/default/templates/files.html.ep:25 themes/default/templates/index.html.ep:105 msgid "Download link" msgstr "Ligam de telecargament" @@ -132,7 +136,7 @@ msgstr "Ligam de telecargament" msgid "Drag and drop files in the appropriate area or use the traditional way to send files and the files will be chunked, encrypted and sent to the server. You will get two links per file: a download link, that you give to the people you want to share the file with and a deletion link, allowing you to delete the file whenever you want." msgstr "Fasètz lisar de fichièrs dins la zòna prevista per aquò far o seleccionatz un fichièr de faiçon classica e los fichièrs seràn decopats a tròces, chifrats e mandats al servidor. Recuperaretz dos ligams per fichièr : un ligam de telecargament e un ligam per suprimir lo fichièr quand o volètz." -#: themes/default/templates/index.html.ep:69 +#: themes/default/templates/index.html.ep:77 msgid "Drop files here" msgstr "Lisatz vòstres fichièrs aquí" @@ -148,23 +152,23 @@ msgstr "Subjècte del mail" msgid "Emails" msgstr "Corrièl" -#: themes/default/templates/index.html.ep:99 +#: themes/default/templates/index.html.ep:107 msgid "Encrypting part XX1 of XX2" msgstr "Chiframent del tròç XX1 sus XX2" -#: lib/Lufi/Controller/Files.pm:216 +#: lib/Lufi/Controller/Files.pm:229 msgid "Error: the file existed but was deleted." msgstr "Error : lo fichièr existissiá mas es estat suprimit" -#: lib/Lufi/Controller/Files.pm:266 +#: lib/Lufi/Controller/Files.pm:291 msgid "Error: the file has not been sent entirely." msgstr "Error : lo fichièr es pas estat mandat completament" -#: lib/Lufi/Controller/Files.pm:276 +#: lib/Lufi/Controller/Files.pm:301 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Error : impossible de trobar lo fichièr. Sètz segur-a de l’URL ?" -#: themes/default/templates/index.html.ep:100 +#: themes/default/templates/index.html.ep:108 msgid "Expiration:" msgstr "Expiracion :" @@ -176,7 +180,7 @@ msgstr "Expira lo" msgid "Export localStorage data" msgstr "Exportar las donadas localStorage" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:390 msgid "File deleted" msgstr "Fichièr suprimit" @@ -184,7 +188,7 @@ msgstr "Fichièr suprimit" msgid "File name" msgstr "Nom del fichièr" -#: themes/default/templates/render.html.ep:43 +#: themes/default/templates/render.html.ep:51 msgid "Get the file" msgstr "Recuperar lo fichièr" @@ -200,11 +204,11 @@ msgstr "Bonjorn,\\n\\nVaquí qualques fichièrs que desiri partejar amb tu :\\n" msgid "Here's some files" msgstr "Vaquí qualques fichièrs" -#: themes/default/templates/index.html.ep:102 +#: themes/default/templates/index.html.ep:110 msgid "Hit Enter, then Ctrl+C to copy all the download links" msgstr "Picatz sus Entrada puèi fasètz Ctrl+C per copiar totes los ligams per telecargar" -#: themes/default/templates/index.html.ep:101 +#: themes/default/templates/index.html.ep:109 msgid "Hit Enter, then Ctrl+C to copy the download link" msgstr "Picatz sus Entrada puèi fasètz Ctrl+C per copiar lo ligam per telecargar" @@ -240,7 +244,7 @@ msgstr "Important : mai d’informacions suls relambis" msgid "Information about delays" msgstr "Informacion suls relambis" -#: themes/default/templates/render.html.ep:41 +#: themes/default/templates/render.html.ep:49 msgid "It seems that the key in your URL is incorrect. Please, verify your URL." msgstr "Sembla que la clau dins vòstra URL siá incorrècta. Mercés de verificar vòstra URL." @@ -265,11 +269,11 @@ msgid "My files" msgstr "Mos fichièrs" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:68 +#: lib/Lufi/Controller/Files.pm:69 msgid "No enough space available on the server for this file (size: %1)." msgstr "Espaci disc insufisent sul servidor per aqueste fichièr (talha del fichièr : \"%1)." -#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:104 +#: themes/default/templates/files.html.ep:42 themes/default/templates/index.html.ep:112 msgid "No expiration delay" msgstr "Pas cap de relambi d’expiracion" @@ -277,7 +281,7 @@ msgstr "Pas cap de relambi d’expiracion" msgid "Only the files sent with this browser will be listed here. This list is stored in localStorage: if you delete your localStorage data, you'll lose this list." msgstr "Sols los fichièrs mandats amb aqueste navigador web son listats aicí. Las informacions son gardadas en localStorage : se suprimissètz vòstras donadas localStorage, perdretz aquelas informacions." -#: themes/default/templates/login.html.ep:21 +#: themes/default/templates/index.html.ep:70 themes/default/templates/login.html.ep:21 themes/default/templates/render.html.ep:26 msgid "Password" msgstr "Senhal" @@ -286,7 +290,7 @@ msgstr "Senhal" msgid "Please contact the administrator: %1" msgstr "Mercés de contactar l’administrator : %1" -#: themes/default/templates/render.html.ep:25 +#: themes/default/templates/render.html.ep:33 msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "Mercés d’esperar pendent la recuperacion de vòstre fichièr. Nos cal d’en primièr recuperar e deschifrar totes los fragaments abans que poscatz o telecargar." @@ -302,7 +306,7 @@ msgstr "Suprimir del localStorage los fichièrs expirats" msgid "Rows in red mean that the files have expired and are no longer available." msgstr "Las linhas en roge indican que lo fichièr a expirat e es pas mai disponible." -#: themes/default/templates/index.html.ep:103 +#: themes/default/templates/index.html.ep:111 msgid "Send all links by email" msgstr "Mandar totes los ligams per corrièl" @@ -314,7 +318,7 @@ msgstr "Mandar amb aqueste servidor" msgid "Send with your own mail software" msgstr "Mandar amb vòstre pròpri logicial de corrièl" -#: themes/default/templates/index.html.ep:105 +#: themes/default/templates/index.html.ep:113 msgid "Sending part XX1 of XX2. Please, be patient, the progress bar can take a while to move." msgstr "Mandadís del fragment XX1 sus XX2. Pacientatz, la barra de progression pòt metre de temps abans d’avançar." @@ -331,7 +335,7 @@ msgstr "Connexion" msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "O planhèm, la foncion per mandar de fichièr es desactivada pel moment. Mercés de tornar ensajar mai tard." -#: lib/Lufi/Controller/Files.pm:42 +#: lib/Lufi/Controller/Files.pm:43 msgid "Sorry, uploading is disabled." msgstr "O planhèm, la foncion per mandar de fichièr es desactivada." @@ -351,7 +355,7 @@ msgstr "Lo contengut del corrièl pòt pas èsser void." msgid "The email subject can't be empty." msgstr "Lo sujècte del corrièl pòt pas èsser void." -#: lib/Lufi/Controller/Files.pm:361 +#: lib/Lufi/Controller/Files.pm:387 msgid "The file has already been deleted" msgstr "Lo fichièr es ja estat suprimit" @@ -364,7 +368,7 @@ msgstr "Los fichièrs mandats amb una instància Lufi son chifrats abans la mand msgid "The following email addresses are not valid: %1" msgstr "Las adreças de corrièl seguentas son pas validas : %1" -#: themes/default/templates/index.html.ep:93 +#: themes/default/templates/index.html.ep:101 msgid "The link(s) has been copied to your clipboard" msgstr "Lo(s) ligam(s) es/son estat(s) copiat(s) dins vòstre quichapapièrs" @@ -376,7 +380,7 @@ msgstr "Lo corrièl es estat mandat." msgid "The original (and only for now) author is Luc Didry. If you want to support him, you can do it via Tipeee or via Liberapay." msgstr "L’autor original (e pel moment, lo sol) es Luc Didry. S’avètz enveja de lo sostenir, podètz o far via Tipeee o via Liberapay." -#: lib/Lufi/Controller/Files.pm:168 +#: lib/Lufi/Controller/Files.pm:181 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "Lo servidor es pas estat capable de retrobar l’enregistrament del fichièr que li cal ajustar vòstre tròç de fichièr. Mercés de contactar l’administrator." @@ -384,22 +388,22 @@ msgstr "Lo servidor es pas estat capable de retrobar l’enregistrament del fich msgid "This server sets limitations according to the file size. The expiration delay of your file will be the minimum between what you choose and the following limitations:" msgstr "Aqueste servidor impausa de limitacions segon la tailha dels fichièrs. Lo relambi d’expiracion de vòstre fichièr serà lo minimum entre çò qu’avètz causit e los limits seguents :" -#: themes/default/templates/index.html.ep:94 +#: themes/default/templates/index.html.ep:102 msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossible de copiar lo(s) ligams(s) dins vòstre quichapapièrs" #. ($short) -#: lib/Lufi/Controller/Files.pm:334 +#: lib/Lufi/Controller/Files.pm:360 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossible de recuperar lo comptador per %1. Lo fichièr existís pas. Serà levat de vòstre localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:350 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossible de recuperar lo comptador per %1. Lo geton es invalid." #. ($short) -#: lib/Lufi/Controller/Files.pm:344 +#: lib/Lufi/Controller/Files.pm:370 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossible de recuperar lo comptador per %1. Sètz pas connectat·ada." @@ -411,11 +415,11 @@ msgstr "Mandar de fichièrs" msgid "Uploaded at" msgstr "Mandat lo" -#: themes/default/templates/index.html.ep:77 +#: themes/default/templates/index.html.ep:85 msgid "Uploaded files" msgstr "Fichièrs mandats" -#: themes/default/templates/index.html.ep:106 +#: themes/default/templates/index.html.ep:114 msgid "Websocket communication error" msgstr "Error de comunicacion WebSocket" @@ -435,15 +439,15 @@ msgstr "Podètz veire la lista de vòstres fichièrs en clicant sul ligam « Mos msgid "You don't need to register yourself to upload files but be aware that, for legal reasons, your IP address will be stored when you send a file. Don't panic, this is normally the case for all sites on which you send files." msgstr "Avètz pas besonh de vos enregistrar per mandar de fichièrs mas notatz que, per de rasons legalas, vòstra adreça IP serà enregistrada quand mandatz un fichièr. Paniquetz pas, es normalament lo cas per totes los sites ont mandatz de fichièrs." -#: themes/default/templates/render.html.ep:45 +#: themes/default/templates/render.html.ep:53 msgid "You don't seem to have a key in your URL. You won't be able to decrypt the file. Download canceled." msgstr "Sembla qu’avètz pas la bona clau dins l’URL. Poiretz pas deschifrar lo fichièr. Telecargament anullat." -#: themes/default/templates/render.html.ep:42 +#: themes/default/templates/render.html.ep:50 msgid "You have attempted to leave this page. The download will be canceled. Are you sure?" msgstr "Ensajatz de partir de la pagina. Lo telecargament serà anullat. Sètz segur-a ?" -#: themes/default/templates/index.html.ep:91 +#: themes/default/templates/index.html.ep:99 msgid "You have attempted to leave this page. The upload will be canceled. Are you sure?" msgstr "Ensajatz de partir de la pagina. Lo mandadís serà anullat. Sètz segur-a ?" @@ -456,10 +460,14 @@ msgid "You must give email addresses." msgstr "Vos cal donar d’adreças." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:55 +#: lib/Lufi/Controller/Files.pm:56 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "Vòstre fichièr es tròp voluminós : %1 (la talha maximum autorizada es %2)" +#: lib/Lufi/Controller/Files.pm:275 +msgid "Your password is not valid. Please refresh the page to retry." +msgstr "" + #. (format_bytes($keys[$i]) #: themes/default/templates/delays.html.ep:20 msgid "between %1 and %2, the file will be kept %3 day(s)." @@ -488,6 +496,6 @@ msgstr "per %1 e mai, lo fichièr serà gardat per totjorn." msgid "no time limit" msgstr "Pas cap de relambi d’expiracion" -#: themes/default/templates/index.html.ep:70 +#: themes/default/templates/index.html.ep:78 msgid "or" msgstr "o" diff --git a/themes/default/public/css/lufi.css b/themes/default/public/css/lufi.css index 9506862..70604d8 100644 --- a/themes/default/public/css/lufi.css +++ b/themes/default/public/css/lufi.css @@ -86,3 +86,8 @@ a.classic:focus { .hiddendiv.common { min-height: 170px; } +.title-filename { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/themes/default/public/js/lufi-down.js b/themes/default/public/js/lufi-down.js index 62405e1..1af603d 100644 --- a/themes/default/public/js/lufi-down.js +++ b/themes/default/public/js/lufi-down.js @@ -35,7 +35,7 @@ function base64ToArrayBuffer(base64) { function addAlert(msg) { $('#please-wait').remove(); - var pbd = $('#pbd'); + var pbd = $('.file-progress'); pbd.attr('role', 'alert'); pbd.removeClass('progress'); pbd.html(['
', @@ -53,7 +53,11 @@ function spawnWebsocket(pa) { var l = $('#loading'); l.html(i18n.loading.replace(/XX1/, (pa + 1))); - window.ws.send('{"part":'+pa+'}'); + if ($('#file_pwd').length === 1) { + window.ws.send('{"part":'+pa+', "file_pwd": "'+$('#file_pwd').val()+'"}'); + } else { + window.ws.send('{"part":'+pa+'}'); + } }; ws.onclose = function() { console.log('Connection is closed'); @@ -70,6 +74,9 @@ function spawnWebsocket(pa) { if (data.msg !== undefined) { addAlert(data.msg); console.log(data.msg); + if ($('#file_pwd').length === 1) { + $('.file-abort').addClass('hide'); + } window.onbeforeunload = null; } else { console.log('Getting slice '+(data.part + 1)+' of '+data.total); @@ -102,7 +109,11 @@ function spawnWebsocket(pa) { } pbd.html(innerHTML.join('')); - window.ws.send('{"ended":true}'); + if ($('#file_pwd').length === 1) { + window.ws.send('{"ended":true, "file_pwd": "'+$('#file_pwd').val()+'"}'); + } else { + window.ws.send('{"ended":true}'); + } window.onbeforeunload = null; window.completed = true; $('#abort').remove(); @@ -123,7 +134,11 @@ function spawnWebsocket(pa) { console.log('Error. Retrying to get slice '+(data.part + 1)); window.ws = spawnWebsocket(data.part + 1); }; - window.ws.send('{"part":'+(data.part + 1)+'}'); + if ($('#file_pwd').length === 1) { + window.ws.send('{"part":'+(data.part + 1)+', "file_pwd": "'+$('#file_pwd').val()+'"}'); + } else { + window.ws.send('{"part":'+(data.part + 1)+'}'); + } } } } catch(err) { @@ -157,11 +172,26 @@ $(document).ready(function(){ window.completed = false; if (key !== '=') { - // Set websocket - window.ws = spawnWebsocket(0); + var go = true; + if ($('#file_pwd').length === 1) { + go = false; + $('#go').click(function() { + $('.file-progress, .file-abort').removeClass('hide'); + $('#file_pwd').parent().parent().addClass('hide'); + // Set websocket + window.ws = spawnWebsocket(0); + + // Prevent exiting page before full download + window.onbeforeunload = confirmExit; + }); + } + if (go) { + // Set websocket + window.ws = spawnWebsocket(0); - // Prevent exiting page before full download - window.onbeforeunload = confirmExit; + // Prevent exiting page before full download + window.onbeforeunload = confirmExit; + } } else { addAlert(i18n.nokey); } diff --git a/themes/default/public/js/lufi-up.js b/themes/default/public/js/lufi-up.js index dee8184..51c8903 100644 --- a/themes/default/public/js/lufi-up.js +++ b/themes/default/public/js/lufi-up.js @@ -196,6 +196,12 @@ function sliceAndUpload(randomkey, i, parts, j, delay, del_at_first_view, short) id: short, i: i }; + if ($('#file_pwd').length === 1) { + var pwd = $('#file_pwd').val(); + if (pwd !== undefined && pwd !== null && pwd !== '') { + data['file_pwd'] = $('#file_pwd').val(); + } + } data = JSON.stringify(data); console.log('sending slice '+(j + 1)+'/'+parts+' of file '+file.name); diff --git a/themes/default/templates/index.html.ep b/themes/default/templates/index.html.ep index f632d7f..7e98932 100644 --- a/themes/default/templates/index.html.ep +++ b/themes/default/templates/index.html.ep @@ -64,6 +64,14 @@

+ % if (config('allow_pwd_on_files')) { +
+
+ + +
+
+ % }

<%= l('Drop files here') %>

diff --git a/themes/default/templates/render.html.ep b/themes/default/templates/render.html.ep index b57bc8b..7c757ad 100644 --- a/themes/default/templates/render.html.ep +++ b/themes/default/templates/render.html.ep @@ -10,7 +10,7 @@
% } else { -

<%= stash('f')->filename %>

+

<%= stash('f')->filename %>

% if (defined(stash('msg'))) {
@@ -20,7 +20,15 @@
% } else { + % if (stash('file_pwd')) {
+
+ +
+ <%= l('Download') %> +
+ % } +

<%= l('Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it.') %>

@@ -30,7 +38,7 @@
-
+ %= javascript begin