diff --git a/CHANGELOG b/CHANGELOG index 2a79211..fda3386 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ Revision history for Lufi - Use FiatTux plugins - Option to force "Burn after reading" for each uploaded file - Use GzipStatic and StaticCache plugins for speed + - Allow to block files by setting an abuse field in DB 0.02.2 2017-09-18 - Fix cron tasks bug diff --git a/lib/Lufi.pm b/lib/Lufi.pm index 3270ae4..1c1c281 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -10,7 +10,6 @@ $ENV{MOJO_MAX_WEBSOCKET_SIZE} = 100485760; # 10 * 1024 * 1024 = 10MiB # This method will run once at server start sub startup { my $self = shift; - my $entry; my $config = $self->plugin('Config' => { default => { @@ -112,65 +111,34 @@ sub startup { my $r = $self->routes; # Page for files uploading - $r->get('/' => sub { - my $c = shift; - if ((!defined($c->config('ldap')) && !defined($c->config('htpasswd'))) || $c->is_user_authenticated) { - $c->render(template => 'index'); - } else { - $c->redirect_to('login'); - } - })->name('index'); + $r->get('/') + ->to('Misc#index') + ->name('index'); if (defined $self->config('ldap') || defined $self->config('htpasswd')) { # Login page - $r->get('/login' => sub { - my $c = shift; - if ($c->is_user_authenticated) { - $c->redirect_to('index'); - } else { - $c->render(template => 'login'); - } - }); - # Authentication - $r->post('/login' => sub { - my $c = shift; - my $login = $c->param('login'); - my $pwd = $c->param('password'); + $r->get('/login') + ->to('Auth#login_page'); + + # Authentication + $r->post('/login') + ->to('Auth#login'); - if($c->authenticate($login, $pwd)) { - $c->redirect_to('index'); - } elsif (defined $entry) { - $c->stash(msg => $c->l('Please, check your credentials: unable to authenticate.')); - $c->render(template => 'login'); - } else { - $c->stash(msg => $c->l('Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there\'s a glitch in the matrix.')); - $c->render(template => 'login'); - } - }); # Logout page - $r->get('/logout' => sub { - my $c = shift; - if ($c->is_user_authenticated) { - $c->logout; - } - $c->render(template => 'logout'); - })->name('logout'); + $r->get('/logout') + ->to('Auth#logout') + ->name('logout'); } # About page - $r->get('/about' => sub { - shift->render(template => 'about'); - })->name('about'); + $r->get('/about') + ->to('Misc#about') + ->name('about'); # Generated js files - $r->get('/partial/:file' => sub { - my $c = shift; - $c->render( - template => 'partial/'.$c->param('file'), - format => 'js', - layout => undef, - ); - })->name('partial'); + $r->get('/partial/:file') + ->to('Misc#js_files') + ->name('partial'); # Get instance stats $r->get('/fullstats') @@ -178,58 +146,48 @@ sub startup { ->name('fullstats'); # Get a file - $r->get('/r/:short')-> - to('Files#r')-> - name('render'); + $r->get('/r/:short') + ->to('Files#r') + ->name('render'); # List of files (use localstorage, so the server know nothing about files) - $r->get('/files' => sub { - my $c = shift; - if ((!defined($c->config('ldap')) && !defined($c->config('htpasswd'))) || $c->is_user_authenticated) { - $c->render(template => 'files'); - } else { - $c->redirect_to('login'); - } - })->name('files'); + $r->get('/files') + ->to('Files#files') + ->name('files'); # Get counter informations about a file - $r->post('/c')-> - to('Files#get_counter')-> - name('counter'); + $r->post('/c') + ->to('Files#get_counter') + ->name('counter'); # Get counter informations about a file - $r->get('/d/:short/:token')-> - to('Files#delete')-> - name('delete'); + $r->get('/d/:short/:token') + ->to('Files#delete') + ->name('delete'); # Get some informations about delays - $r->get('/delays' => sub { - shift->render(template => 'delays'); - })->name('delays'); + $r->get('/delays') + ->to('Misc#delays') + ->name('delays'); # Get mail page - $r->get('/m')-> - to('Mail#render_mail')-> - name('mail'); + $r->get('/m') + ->to('Mail#render_mail') + ->name('mail'); # Submit mail - $r->post('/m')-> - to('Mail#send_mail'); - - # About page - $r->get('/about' => sub { - shift->render(template => 'about'); - })->name('about'); + $r->post('/m') + ->to('Mail#send_mail'); # Upload files websocket - $r->websocket('/upload')-> - to('Files#upload')-> - name('upload'); + $r->websocket('/upload') + ->to('Files#upload') + ->name('upload'); # Get files websocket - $r->websocket('/download/:short')-> - to('Files#download')-> - name('download'); + $r->websocket('/download/:short') + ->to('Files#download') + ->name('download'); } 1; diff --git a/lib/Lufi/Controller/Auth.pm b/lib/Lufi/Controller/Auth.pm new file mode 100644 index 0000000..8d2a50e --- /dev/null +++ b/lib/Lufi/Controller/Auth.pm @@ -0,0 +1,38 @@ +# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: +package Lufi::Controller::Auth; +use Mojo::Base 'Mojolicious::Controller'; + +sub login_page { + my $c = shift; + + if ($c->is_user_authenticated) { + $c->redirect_to('index'); + } else { + $c->render(template => 'login'); + } +} + +sub login { + my $c = shift; + + my $login = $c->param('login'); + my $pwd = $c->param('password'); + + if($c->authenticate($login, $pwd)) { + $c->redirect_to('index'); + } else { + $c->stash(msg => $c->l('Please, check your credentials or your right to access this service: unable to authenticate.')); + $c->render(template => 'login'); + } +} + +sub logout { + my $c = shift; + + if ($c->is_user_authenticated) { + $c->logout; + } + $c->render(template => 'logout'); +} + +1; diff --git a/lib/Lufi/Controller/Files.pm b/lib/Lufi/Controller/Files.pm index d4ed027..46b760c 100644 --- a/lib/Lufi/Controller/Files.pm +++ b/lib/Lufi/Controller/Files.pm @@ -11,6 +11,16 @@ use Number::Bytes::Human qw(format_bytes); use Filesys::DfPortable; use Crypt::SaltedHash; +sub files { + my $c = shift; + + if ((!defined($c->config('ldap')) && !defined($c->config('htpasswd'))) || $c->is_user_authenticated) { + $c->render(template => 'files'); + } else { + $c->redirect_to('login'); + } +} + sub upload { my $c = shift; @@ -229,6 +239,20 @@ sub download { ))); } ); + } elsif (defined($ldfile->abuse)) { + my $abuse_msg = $c->l('This file has been deactivated by the admins. Contact them to know why.'); + $abuse_msg = $c->app->config('abuse')->{$ldfile->abuse} if ($c->app->config('abuse') && $c->app->config('abuse')->{$ldfile->abuse}); + $c->on( + message => sub { + my ($ws, $json) = @_; + $c->send(decode('UTF-8', encode_json( + { + success => false, + msg => $abuse_msg + } + ))); + } + ); } elsif ($ldfile->complete) { my $f = $ldfile; diff --git a/lib/Lufi/Controller/Misc.pm b/lib/Lufi/Controller/Misc.pm index 1783d61..17eff6b 100644 --- a/lib/Lufi/Controller/Misc.pm +++ b/lib/Lufi/Controller/Misc.pm @@ -4,6 +4,30 @@ use Mojo::Base 'Mojolicious::Controller'; use Mojo::File; use Lufi::DB::File; +sub index { + my $c = shift; + if ((!defined($c->config('ldap')) && !defined($c->config('htpasswd'))) || $c->is_user_authenticated) { + $c->render(template => 'index'); + } else { + $c->redirect_to('login'); + } +} + +sub about { + shift->render(template => 'about'); +} + +sub js_files { + my $c = shift; + + $c->stash($c->req->params->to_hash); + $c->render( + template => 'partial/'.$c->param('file'), + format => 'js', + layout => undef, + ); +} + sub fullstats { my $c = shift; @@ -19,4 +43,8 @@ sub fullstats { ); } +sub delays { + shift->render(template => 'delays'); +} + 1; diff --git a/lib/Lufi/DB/File.pm b/lib/Lufi/DB/File.pm index 6ffc001..b0fd6ae 100644 --- a/lib/Lufi/DB/File.pm +++ b/lib/Lufi/DB/File.pm @@ -25,6 +25,7 @@ has 'slices' => sub { return Mojo::Collection->new(); }; has 'passwd'; +has 'abuse'; has 'record' => 0; has 'app'; @@ -75,6 +76,8 @@ Have a look at Lufi::DB::File::SQLite's code: it's simple and may be more unders =item B : string +=item B : integer + =item B : a Mojolicious object =back @@ -169,9 +172,9 @@ sub write { my $c = shift; if ($c->record) { - $c->app->dbi->db->query('UPDATE files SET short = ?, deleted = ?, mediatype = ?, filename = ?, filesize = ?, counter = ?, delete_at_first_view = ?, delete_at_day = ?, created_at = ?, created_by = ?, last_access_at = ?, mod_token = ?, nbslices = ?, complete = ?, passwd = ? WHERE short = ?', $c->short, $c->deleted, $c->mediatype, $c->filename, $c->filesize, $c->counter, $c->delete_at_first_view, $c->delete_at_day, $c->created_at, $c->created_by, $c->last_access_at, $c->mod_token, $c->nbslices, $c->complete, $c->passwd, $c->short); + $c->app->dbi->db->query('UPDATE files SET short = ?, deleted = ?, mediatype = ?, filename = ?, filesize = ?, counter = ?, delete_at_first_view = ?, delete_at_day = ?, created_at = ?, created_by = ?, last_access_at = ?, mod_token = ?, nbslices = ?, complete = ?, passwd = ?, abuse = ? WHERE short = ?', $c->short, $c->deleted, $c->mediatype, $c->filename, $c->filesize, $c->counter, $c->delete_at_first_view, $c->delete_at_day, $c->created_at, $c->created_by, $c->last_access_at, $c->mod_token, $c->nbslices, $c->complete, $c->passwd, $c->abuse, $c->short); } else { - $c->app->dbi->db->query('INSERT INTO files (short, deleted, mediatype, filename, filesize, counter, delete_at_first_view, delete_at_day, created_at, created_by, last_access_at, mod_token, nbslices, complete, passwd) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $c->short, $c->deleted, $c->mediatype, $c->filename, $c->filesize, $c->counter, $c->delete_at_first_view, $c->delete_at_day, $c->created_at, $c->created_by, $c->last_access_at, $c->mod_token, $c->nbslices, $c->complete, $c->passwd); + $c->app->dbi->db->query('INSERT INTO files (short, deleted, mediatype, filename, filesize, counter, delete_at_first_view, delete_at_day, created_at, created_by, last_access_at, mod_token, nbslices, complete, passwd, abuse) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $c->short, $c->deleted, $c->mediatype, $c->filename, $c->filesize, $c->counter, $c->delete_at_first_view, $c->delete_at_day, $c->created_at, $c->created_by, $c->last_access_at, $c->mod_token, $c->nbslices, $c->complete, $c->passwd, $c->abuse); $c->record(1); } @@ -475,6 +478,7 @@ sub _slurp { $c->nbslices($file->{nbslices}); $c->complete($file->{complete}); $c->passwd($file->{passwd}); + $c->abuse($file->{abuse}); $c->record(1) unless $c->record; } diff --git a/lib/Lufi/DB/File/SQLite.pm b/lib/Lufi/DB/File/SQLite.pm index 4a896a8..213e896 100644 --- a/lib/Lufi/DB/File/SQLite.pm +++ b/lib/Lufi/DB/File/SQLite.pm @@ -1,7 +1,6 @@ # vim:set sw=4 ts=4 sts=4 ft=perl expandtab: package Lufi::DB::File::SQLite; use Mojo::Base 'Lufi::DB::File'; -use Mojo::Collection 'c'; sub new { my $c = shift; diff --git a/lib/Lufi/Plugin/Helpers.pm b/lib/Lufi/Plugin/Helpers.pm index 55ebcdf..0599084 100644 --- a/lib/Lufi/Plugin/Helpers.pm +++ b/lib/Lufi/Plugin/Helpers.pm @@ -20,9 +20,9 @@ sub register { # Database migration my $migrations = Mojo::Pg::Migrations->new(pg => $app->dbi); if ($app->mode eq 'development' && $ENV{LUFI_DEV}) { - $migrations->from_file('utilities/migrations/pg.sql')->migrate(0)->migrate(1); + $migrations->from_file('utilities/migrations/pg.sql')->migrate(0)->migrate(2); } else { - $migrations->from_file('utilities/migrations/pg.sql')->migrate(1); + $migrations->from_file('utilities/migrations/pg.sql')->migrate(2); } } elsif ($app->config('dbtype') eq 'sqlite') { require Mojo::SQLite; @@ -33,14 +33,19 @@ sub register { my $sql = $app->dbi; my $migrations = $sql->migrations; if ($app->mode eq 'development' && $ENV{LUFI_DEV}) { - $migrations->from_file('utilities/migrations/sqlite.sql')->migrate(0)->migrate(1); + $migrations->from_file('utilities/migrations/sqlite.sql')->migrate(0)->migrate(2); } else { - $migrations->from_file('utilities/migrations/sqlite.sql')->migrate(1); + $migrations->from_file('utilities/migrations/sqlite.sql')->migrate(2); } + + # Check if passwd column is missing my $columns = $app->dbi->db->query('PRAGMA table_info(files)')->hashes; - if ($columns->size == 14) { # Missing passwd column - $app->dbi->db->query('ALTER TABLE files ADD COLUMN passwd TEXT'); - } + my $pwd_col = 0; + $columns->each(sub { + my ($e, $num) = @_; + $pwd_col = 1 if $e->{name} eq 'passwd'; + }); + $app->dbi->db->query('ALTER TABLE files ADD COLUMN passwd TEXT') unless $pwd_col; } $app->helper(provisioning => \&_provisioning); diff --git a/lufi.conf.template b/lufi.conf.template index f01833c..5b196c7 100644 --- a/lufi.conf.template +++ b/lufi.conf.template @@ -172,9 +172,18 @@ #force_burn_after_reading => 0, # if set, the files' URLs will always use this domain - # optional + # optional, no default #fixed_domain => 'example.org', + # abuse reasons + # set an integer in the abuse field of a file in the database and it will not be downloadable anymore + # the reason will be displayed to the downloader, according to the reasons you will configure here. + # optional, no default + #abuse => { + # 0 => 'Copyright infringment', + # 1 => 'Illegal content', + #}, + ######################### # Lufi cron jobs settings ######################### diff --git a/themes/default/lib/Lufi/I18N/ca.po b/themes/default/lib/Lufi/I18N/ca.po index a7de962..8fd6c1f 100644 --- a/themes/default/lib/Lufi/I18N/ca.po +++ b/themes/default/lib/Lufi/I18N/ca.po @@ -56,7 +56,7 @@ msgstr "" 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 "Com que Lufi és programari lliure, autoritzat sota els termes de l'AGPLv3, el podeu instal·lar al vostre propi servidor. Pel que fa a com fer-ho, feu un cop d'ull al Wiki." -#. (stash('f') +#. (stash('nbslices') #: themes/default/templates/partial/render.js.ep:9 msgid "Asking for file part XX1 of %1" msgstr "Demanem la part XX1 de %1 del fitxer" @@ -93,15 +93,15 @@ msgstr "Copia tots els enllaços al porta-retalls" msgid "Copy to clipboard" msgstr "Copia al porta-retalls" -#: lib/Lufi/Controller/Files.pm:431 +#: lib/Lufi/Controller/Files.pm:455 msgid "Could not delete the file. You are not authenticated." msgstr "No es pot esborrar el fitxer. No esteu autenticat." -#: lib/Lufi/Controller/Files.pm:413 +#: lib/Lufi/Controller/Files.pm:437 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "No es troba el fitxer. Esteu segur de la URL i el testimoni?" -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:348 msgid "Could not find the file. Are you sure of the URL?" msgstr "No trobo el fitxer. Esteu segurs de la URL?" @@ -161,15 +161,15 @@ msgstr "correus electrònics" msgid "Encrypting part XX1 of XX2" msgstr "S'està xifrant la part XX1 de XX2" -#: lib/Lufi/Controller/Files.pm:227 +#: lib/Lufi/Controller/Files.pm:237 msgid "Error: the file existed but was deleted." msgstr "Error: el fitxer existia però va ser eliminat." -#: lib/Lufi/Controller/Files.pm:293 +#: lib/Lufi/Controller/Files.pm:317 msgid "Error: the file has not been sent entirely." msgstr "Error: el fitxer no s'ha enviat del tot." -#: lib/Lufi/Controller/Files.pm:303 +#: lib/Lufi/Controller/Files.pm:327 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Error: no trobo el fitxer. Esteu segur de la URL ?" @@ -185,7 +185,7 @@ msgstr "Expira el" msgid "Export localStorage data" msgstr "Exporta dades a l'emmagatzematge local" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:419 msgid "File deleted" msgstr "Fitxer eliminat" @@ -283,7 +283,7 @@ msgid "My files" msgstr "Els meus fitxers" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:69 +#: lib/Lufi/Controller/Files.pm:79 msgid "No enough space available on the server for this file (size: %1)." msgstr "No hi ha prou espai al servidor per a aquest fitxer (mida: %1)" @@ -308,8 +308,8 @@ msgstr "Si us plau contacteu amb l'administrador: %1" msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "Si us plau, espereu mentre obtenim el fitxer. Abans que el tingueu disponible primer cal descarregar i desxifrar tots els trossos." -#: lib/Lufi.pm:143 -msgid "Please, check your credentials: unable to authenticate." +#: lib/Lufi/Controller/Auth.pm:24 +msgid "Please, check your credentials or your right to access this service: unable to authenticate." msgstr "" #: themes/default/templates/about.html.ep:5 @@ -349,15 +349,11 @@ msgstr "Compartiu fitxers amb total privacitat a %1" msgid "Signin" msgstr "Autenticació" -#: lib/Lufi.pm:146 -msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix." -msgstr "" - #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "Disculpeu, les pujades estan actualment desactivades. Si us plau proveu-ho més tard." -#: lib/Lufi/Controller/Files.pm:43 +#: lib/Lufi/Controller/Files.pm:53 msgid "Sorry, uploading is disabled." msgstr "Disculpeu, les pujades estan deshabilitades" @@ -379,7 +375,7 @@ msgstr "El cos del correu no pot estar buit." msgid "The email subject can't be empty." msgstr "L'assumpte dle correu no pot estar buit." -#: lib/Lufi/Controller/Files.pm:392 +#: lib/Lufi/Controller/Files.pm:416 msgid "The file has already been deleted" msgstr "El fitxer ja ha estat esborrat" @@ -404,10 +400,14 @@ msgstr "El correu ja està enviat." 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 (i per ara l'únic) és Luc Didry. Si voleu fer una contribució podeu fer-ho via Tipeee o via Liberapay." -#: lib/Lufi/Controller/Files.pm:181 +#: lib/Lufi/Controller/Files.pm:191 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "El servidor no ha pogut trobar el registre del fitxer per afegir-hi el tros del fitxer. Si us plau, contacteu l'administrador." +#: lib/Lufi/Controller/Files.pm:243 +msgid "This file has been deactivated by the admins. Contact them to know why." +msgstr "" + #: themes/default/templates/delays.html.ep:10 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 "Aquest servidor estableix limitacions segons la mida del fitxer. La moratòria d'expiració del fitxer serà el mínim de l'escollida i aquestes limitacions:" @@ -417,17 +417,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "No s'han pogut copiar l'enllaç o els enllaços al porta-retalls." #. ($short) -#: lib/Lufi/Controller/Files.pm:363 +#: lib/Lufi/Controller/Files.pm:387 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "No he pogut obtenir el comptador de %1. El fitxer no existeix. Serà eliminat del teu emmagatzematge local." #. ($short) -#: lib/Lufi/Controller/Files.pm:353 +#: lib/Lufi/Controller/Files.pm:377 msgid "Unable to get counter for %1. The token is invalid." msgstr "No he pogut obtenir el comptador de %1. El testimoni no és vàlid." #. ($short) -#: lib/Lufi/Controller/Files.pm:373 +#: lib/Lufi/Controller/Files.pm:397 msgid "Unable to get counter for %1. You are not authenticated." msgstr "No he pogut obtenir el comptador de %1. No esteu autenticat." @@ -484,11 +484,11 @@ msgid "You must give email addresses." msgstr "Heu de donar l'adreça de correu electrònic." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:56 +#: lib/Lufi/Controller/Files.pm:66 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "El fitxer és massa gran: %1 (mida màxima admesa: %2)" -#: lib/Lufi/Controller/Files.pm:275 +#: lib/Lufi/Controller/Files.pm:299 msgid "Your password is not valid. Please refresh the page to retry." msgstr "" diff --git a/themes/default/lib/Lufi/I18N/en.po b/themes/default/lib/Lufi/I18N/en.po index a2ca174..bf9e9da 100644 --- a/themes/default/lib/Lufi/I18N/en.po +++ b/themes/default/lib/Lufi/I18N/en.po @@ -53,7 +53,7 @@ msgstr "" 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') +#. (stash('nbslices') #: themes/default/templates/partial/render.js.ep:9 msgid "Asking for file part XX1 of %1" msgstr "" @@ -90,15 +90,15 @@ msgstr "" msgid "Copy to clipboard" msgstr "" -#: lib/Lufi/Controller/Files.pm:431 +#: lib/Lufi/Controller/Files.pm:455 msgid "Could not delete the file. You are not authenticated." msgstr "" -#: lib/Lufi/Controller/Files.pm:413 +#: lib/Lufi/Controller/Files.pm:437 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "" -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:348 msgid "Could not find the file. Are you sure of the URL?" msgstr "" @@ -158,15 +158,15 @@ msgstr "" msgid "Encrypting part XX1 of XX2" msgstr "" -#: lib/Lufi/Controller/Files.pm:227 +#: lib/Lufi/Controller/Files.pm:237 msgid "Error: the file existed but was deleted." msgstr "" -#: lib/Lufi/Controller/Files.pm:293 +#: lib/Lufi/Controller/Files.pm:317 msgid "Error: the file has not been sent entirely." msgstr "" -#: lib/Lufi/Controller/Files.pm:303 +#: lib/Lufi/Controller/Files.pm:327 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "" @@ -182,7 +182,7 @@ msgstr "" msgid "Export localStorage data" msgstr "" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:419 msgid "File deleted" msgstr "" @@ -279,7 +279,7 @@ msgid "My files" msgstr "" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:69 +#: lib/Lufi/Controller/Files.pm:79 msgid "No enough space available on the server for this file (size: %1)." msgstr "" @@ -304,8 +304,8 @@ msgstr "" msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "" -#: lib/Lufi.pm:143 -msgid "Please, check your credentials: unable to authenticate." +#: lib/Lufi/Controller/Auth.pm:24 +msgid "Please, check your credentials or your right to access this service: unable to authenticate." msgstr "" #: themes/default/templates/about.html.ep:5 @@ -345,15 +345,11 @@ msgstr "" msgid "Signin" msgstr "" -#: lib/Lufi.pm:146 -msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix." -msgstr "" - #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "" -#: lib/Lufi/Controller/Files.pm:43 +#: lib/Lufi/Controller/Files.pm:53 msgid "Sorry, uploading is disabled." msgstr "" @@ -373,7 +369,7 @@ msgstr "" msgid "The email subject can't be empty." msgstr "" -#: lib/Lufi/Controller/Files.pm:392 +#: lib/Lufi/Controller/Files.pm:416 msgid "The file has already been deleted" msgstr "" @@ -398,10 +394,14 @@ 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:181 +#: lib/Lufi/Controller/Files.pm:191 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "" +#: lib/Lufi/Controller/Files.pm:243 +msgid "This file has been deactivated by the admins. Contact them to know why." +msgstr "" + #: themes/default/templates/delays.html.ep:10 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 "" @@ -411,17 +411,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:363 +#: lib/Lufi/Controller/Files.pm:387 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:353 +#: lib/Lufi/Controller/Files.pm:377 msgid "Unable to get counter for %1. The token is invalid." msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:373 +#: lib/Lufi/Controller/Files.pm:397 msgid "Unable to get counter for %1. You are not authenticated." msgstr "" @@ -478,11 +478,11 @@ msgid "You must give email addresses." msgstr "" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:56 +#: lib/Lufi/Controller/Files.pm:66 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "" -#: lib/Lufi/Controller/Files.pm:275 +#: lib/Lufi/Controller/Files.pm:299 msgid "Your password is not valid. Please refresh the page to retry." msgstr "" diff --git a/themes/default/lib/Lufi/I18N/fr.po b/themes/default/lib/Lufi/I18N/fr.po index 96da5a4..3768c1d 100644 --- a/themes/default/lib/Lufi/I18N/fr.po +++ b/themes/default/lib/Lufi/I18N/fr.po @@ -55,7 +55,7 @@ msgstr "Ajouter un mot de passe au(x) fichier(s)" 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') +#. (stash('nbslices') #: themes/default/templates/partial/render.js.ep:9 msgid "Asking for file part XX1 of %1" msgstr "Demande de récupération du fragment de fichier XX1 sur %1" @@ -92,15 +92,15 @@ msgstr "Copier tous les liens dans le presse-papier" msgid "Copy to clipboard" msgstr "Copier dans le presse-papier" -#: lib/Lufi/Controller/Files.pm:431 +#: lib/Lufi/Controller/Files.pm:455 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:413 +#: lib/Lufi/Controller/Files.pm:437 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:324 +#: lib/Lufi/Controller/Files.pm:348 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 ?" @@ -160,15 +160,15 @@ msgstr "Mails" msgid "Encrypting part XX1 of XX2" msgstr "Chiffrement du fragment XX1 sur XX2" -#: lib/Lufi/Controller/Files.pm:227 +#: lib/Lufi/Controller/Files.pm:237 msgid "Error: the file existed but was deleted." msgstr "Erreur : le fichier existait mais a été supprimé" -#: lib/Lufi/Controller/Files.pm:293 +#: lib/Lufi/Controller/Files.pm:317 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:303 +#: lib/Lufi/Controller/Files.pm:327 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 ?" @@ -184,7 +184,7 @@ msgstr "Expire le" msgid "Export localStorage data" msgstr "Exporter les données localStorage" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:419 msgid "File deleted" msgstr "Fichier supprimé" @@ -274,14 +274,14 @@ msgstr "Lufi est un logiciel libre d’hébergement de fichiers." #: themes/default/templates/files.html.ep:33 msgid "Mail" -msgstr "" +msgstr "Mail" #: themes/default/templates/files.html.ep:3 themes/default/templates/layouts/default.html.ep:31 themes/default/templates/layouts/default.html.ep:43 msgid "My files" msgstr "Mes fichiers" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:69 +#: lib/Lufi/Controller/Files.pm:79 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)." @@ -306,9 +306,9 @@ msgstr "Veuillez contacter l’administrateur : %1" 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." -#: lib/Lufi.pm:143 -msgid "Please, check your credentials: unable to authenticate." -msgstr "Veuillez vérifier vos identifiants : impossible de vous authentifier." +#: lib/Lufi/Controller/Auth.pm:24 +msgid "Please, check your credentials or your right to access this service: unable to authenticate." +msgstr "Veuillez vérifier vos identifiants ou votre droit d’accès à ce service : impossible de vous authentifier." #: themes/default/templates/about.html.ep:5 msgid "Privacy" @@ -347,7 +347,7 @@ msgstr "Partagez vos fichiers en toute confidentialité sur %1" msgid "Signin" msgstr "Connexion" -#: lib/Lufi.pm:146 +#: msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix." msgstr "Désolé, vous n’êtes pas autorisé à utiliser ce service. Contactez votre administrateur si vous pensez qu’il s’agit d’une erreur." @@ -355,7 +355,7 @@ msgstr "Désolé, vous n’êtes pas autorisé à utiliser ce service. Contactez 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:43 +#: lib/Lufi/Controller/Files.pm:53 msgid "Sorry, uploading is disabled." msgstr "Désolé, l’envoi de fichier est désactivé." @@ -375,7 +375,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:392 +#: lib/Lufi/Controller/Files.pm:416 msgid "The file has already been deleted" msgstr "Le fichier a déjà été supprimé" @@ -400,10 +400,14 @@ 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:181 +#: lib/Lufi/Controller/Files.pm:191 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." +#: lib/Lufi/Controller/Files.pm:243 +msgid "This file has been deactivated by the admins. Contact them to know why." +msgstr "" + #: themes/default/templates/delays.html.ep:10 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 :" @@ -413,17 +417,17 @@ 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:363 +#: lib/Lufi/Controller/Files.pm:387 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:353 +#: lib/Lufi/Controller/Files.pm:377 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:373 +#: lib/Lufi/Controller/Files.pm:397 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." @@ -480,11 +484,11 @@ msgid "You must give email addresses." msgstr "Vous devez envoyer des adresses mail." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:56 +#: lib/Lufi/Controller/Files.pm:66 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 +#: lib/Lufi/Controller/Files.pm:299 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." diff --git a/themes/default/lib/Lufi/I18N/it.po b/themes/default/lib/Lufi/I18N/it.po index 445a764..ef703e7 100644 --- a/themes/default/lib/Lufi/I18N/it.po +++ b/themes/default/lib/Lufi/I18N/it.po @@ -55,7 +55,7 @@ msgstr "" 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') +#. (stash('nbslices') #: themes/default/templates/partial/render.js.ep:9 msgid "Asking for file part XX1 of %1" msgstr "Recupero della porzione del file XX1 su %1" @@ -92,15 +92,15 @@ msgstr "Copiare tutti i link negli appunti" msgid "Copy to clipboard" msgstr "Copiare negli appunti" -#: lib/Lufi/Controller/Files.pm:431 +#: lib/Lufi/Controller/Files.pm:455 msgid "Could not delete the file. You are not authenticated." msgstr "Impossibile cancellare il file. Non siete autenticati." -#: lib/Lufi/Controller/Files.pm:413 +#: lib/Lufi/Controller/Files.pm:437 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:324 +#: lib/Lufi/Controller/Files.pm:348 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossibile trovare il file. Sei sicuro che l'URL sia corretto?" @@ -160,15 +160,15 @@ msgstr "Email" msgid "Encrypting part XX1 of XX2" msgstr "Cifratura della parte XX1 di XX2" -#: lib/Lufi/Controller/Files.pm:227 +#: lib/Lufi/Controller/Files.pm:237 msgid "Error: the file existed but was deleted." msgstr "Errore: il file esisteva ma è stato eliminato" -#: lib/Lufi/Controller/Files.pm:293 +#: lib/Lufi/Controller/Files.pm:317 msgid "Error: the file has not been sent entirely." msgstr "Errore: il file non è stato inviato completamente" -#: lib/Lufi/Controller/Files.pm:303 +#: lib/Lufi/Controller/Files.pm:327 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Errore: impossibile trovare il file. Sei certo dell'URL ?" @@ -184,7 +184,7 @@ msgstr "Scadrà il" msgid "Export localStorage data" msgstr "Esportare i dati del localStorage" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:419 msgid "File deleted" msgstr "File cancellato" @@ -281,7 +281,7 @@ msgid "My files" msgstr "I miei file" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:69 +#: lib/Lufi/Controller/Files.pm:79 msgid "No enough space available on the server for this file (size: %1)." msgstr "Spazio disco insufficiente sul server per questo file (dimensione: %1)." @@ -306,8 +306,8 @@ msgstr "Contattare l'amministratore : %1" 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." -#: lib/Lufi.pm:143 -msgid "Please, check your credentials: unable to authenticate." +#: lib/Lufi/Controller/Auth.pm:24 +msgid "Please, check your credentials or your right to access this service: unable to authenticate." msgstr "" #: themes/default/templates/about.html.ep:5 @@ -351,15 +351,11 @@ msgstr "Condividi tutti i file in totale riservatezza su %1" msgid "Signin" msgstr "Autenticazione" -#: lib/Lufi.pm:146 -msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix." -msgstr "" - #: themes/default/templates/index.html.ep:30 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:43 +#: lib/Lufi/Controller/Files.pm:53 msgid "Sorry, uploading is disabled." msgstr "L'invio del file è attualemente disattivato." @@ -383,7 +379,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:392 +#: lib/Lufi/Controller/Files.pm:416 msgid "The file has already been deleted" msgstr "Il file è già stato cancellato" @@ -408,10 +404,14 @@ 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:181 +#: lib/Lufi/Controller/Files.pm:191 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." +#: lib/Lufi/Controller/Files.pm:243 +msgid "This file has been deactivated by the admins. Contact them to know why." +msgstr "" + #: themes/default/templates/delays.html.ep:10 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:" @@ -421,17 +421,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossibile copiare i link negli appunti" #. ($short) -#: lib/Lufi/Controller/Files.pm:363 +#: lib/Lufi/Controller/Files.pm:387 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:353 +#: lib/Lufi/Controller/Files.pm:377 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:373 +#: lib/Lufi/Controller/Files.pm:397 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossibile recuperare il contatore per %1. Non sei autenticato." @@ -488,11 +488,11 @@ msgid "You must give email addresses." msgstr "Devi fornire gli indirizzi email." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:56 +#: lib/Lufi/Controller/Files.pm:66 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 +#: lib/Lufi/Controller/Files.pm:299 msgid "Your password is not valid. Please refresh the page to retry." msgstr "" diff --git a/themes/default/lib/Lufi/I18N/nl.po b/themes/default/lib/Lufi/I18N/nl.po index de9e67d..ce7d919 100644 --- a/themes/default/lib/Lufi/I18N/nl.po +++ b/themes/default/lib/Lufi/I18N/nl.po @@ -42,7 +42,7 @@ msgstr "" 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 "Aangezien Lufi een gratis software id die gelicentieerd staat onder de voorwaarden van AGPLv3, kan je het installeren op je eigen server. Bekijk Wiki voor de procedure." -#. (stash('f') +#. (stash('nbslices') #: themes/default/templates/partial/render.js.ep:9 msgid "Asking for file part XX1 of %1" msgstr "Deel XX1 van %1 wordt opgehaald" @@ -79,15 +79,15 @@ msgstr "Kopieer alle links naar klembord" msgid "Copy to clipboard" msgstr "Kopieer naar klembord" -#: lib/Lufi/Controller/Files.pm:431 +#: lib/Lufi/Controller/Files.pm:455 msgid "Could not delete the file. You are not authenticated." msgstr "Kan het bestand niet verwijderen. Je bent niet geautoriseerd." -#: lib/Lufi/Controller/Files.pm:413 +#: lib/Lufi/Controller/Files.pm:437 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Kan het bestand niet vinden. Klopt de URL en token wel?" -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:348 msgid "Could not find the file. Are you sure of the URL?" msgstr "Kan het bestand niet vinden. Klopt de URL?" @@ -147,15 +147,15 @@ msgstr "Emails" msgid "Encrypting part XX1 of XX2" msgstr "Encrypten deel XX1 van XX2 " -#: lib/Lufi/Controller/Files.pm:227 +#: lib/Lufi/Controller/Files.pm:237 msgid "Error: the file existed but was deleted." msgstr "Fout: het bestand bestond wel maar is verwijderd." -#: lib/Lufi/Controller/Files.pm:293 +#: lib/Lufi/Controller/Files.pm:317 msgid "Error: the file has not been sent entirely." msgstr "Fout: het bestand is niet volledig opgestuurd." -#: lib/Lufi/Controller/Files.pm:303 +#: lib/Lufi/Controller/Files.pm:327 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Fout: kan het bestand niet vinden. Is de URL juist?" @@ -171,7 +171,7 @@ msgstr "Vervalt op" msgid "Export localStorage data" msgstr "Exporteer opgeslagen data" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:419 msgid "File deleted" msgstr "Bestand verwijderd" @@ -268,7 +268,7 @@ msgid "My files" msgstr "Mijn bestanden" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:69 +#: lib/Lufi/Controller/Files.pm:79 msgid "No enough space available on the server for this file (size: %1)." msgstr "Geen genoeg ruimte op de server voor deze bestand (grootte: %1)." @@ -293,8 +293,8 @@ msgstr "Neem contact op met administrator: %1" msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "Een ogenblik geduld, we pakken je bestand er bij. We moeten alle delen downloaden en decrypten voordat je het kan downloaden." -#: lib/Lufi.pm:143 -msgid "Please, check your credentials: unable to authenticate." +#: lib/Lufi/Controller/Auth.pm:24 +msgid "Please, check your credentials or your right to access this service: unable to authenticate." msgstr "" #: themes/default/templates/about.html.ep:5 @@ -338,15 +338,11 @@ msgstr "Deel je bestanden met volledige privacy op %1" msgid "Signin" msgstr "Inloggen" -#: lib/Lufi.pm:146 -msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix." -msgstr "" - #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "Sorry, uploaden is momenteel uitgeschakeld. Probeer het later nogmaals." -#: lib/Lufi/Controller/Files.pm:43 +#: lib/Lufi/Controller/Files.pm:53 msgid "Sorry, uploading is disabled." msgstr "SOrry, uploaden is uitgeschakeld." @@ -366,7 +362,7 @@ msgstr "Mail inhoud kan niet leeg zijn." msgid "The email subject can't be empty." msgstr "Onderwerp kan niet leeg zijn." -#: lib/Lufi/Controller/Files.pm:392 +#: lib/Lufi/Controller/Files.pm:416 msgid "The file has already been deleted" msgstr "Bestand is reeds verwijderd" @@ -391,10 +387,14 @@ msgstr "Email is verzonden." 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 "De oorspronkelijke auteur is Luc Didry. Als je hem wilt ondersteunen, dan kan dat via Tipeee of via Liberapay." -#: lib/Lufi/Controller/Files.pm:181 +#: lib/Lufi/Controller/Files.pm:191 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "Server kon een deel van het bestand niet vinden. Neem contact op met beheerder." +#: lib/Lufi/Controller/Files.pm:243 +msgid "This file has been deactivated by the admins. Contact them to know why." +msgstr "" + #: themes/default/templates/delays.html.ep:10 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 "Deze server stelt beperkingen vast volgens de bestandsgrootte. De vervaldatum van uw bestand zal het minimum zijn tussen wat u kiest en de volgende beperkingen:" @@ -404,17 +404,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "Kan de link(s) niet naar je klembord kopieeren" #. ($short) -#: lib/Lufi/Controller/Files.pm:363 +#: lib/Lufi/Controller/Files.pm:387 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Kan geen teller verkrijgen voor %1. Bestand bestaat niet. Het zal verwijderd worden van opgeslagen data." #. ($short) -#: lib/Lufi/Controller/Files.pm:353 +#: lib/Lufi/Controller/Files.pm:377 msgid "Unable to get counter for %1. The token is invalid." msgstr "Kan geen teller verkrijgen voor %1. De token is ongeldig." #. ($short) -#: lib/Lufi/Controller/Files.pm:373 +#: lib/Lufi/Controller/Files.pm:397 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Kan geen teller verkrijgen voor %1. Je bent niet geauthenticeerd." @@ -471,11 +471,11 @@ msgid "You must give email addresses." msgstr "Je moet een mail adres opgeven." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:56 +#: lib/Lufi/Controller/Files.pm:66 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "Je bestand is te groot: %1 (max: %2)" -#: lib/Lufi/Controller/Files.pm:275 +#: lib/Lufi/Controller/Files.pm:299 msgid "Your password is not valid. Please refresh the page to retry." msgstr "" diff --git a/themes/default/lib/Lufi/I18N/oc.po b/themes/default/lib/Lufi/I18N/oc.po index 5be5dff..211f175 100644 --- a/themes/default/lib/Lufi/I18N/oc.po +++ b/themes/default/lib/Lufi/I18N/oc.po @@ -55,7 +55,7 @@ msgstr "Apondre un senhal al(s) fichièr(s)" 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’installar sus vòstre pròpri servidor. Mercés de consultar lo Wiki per veire la procedura." -#. (stash('f') +#. (stash('nbslices') #: themes/default/templates/partial/render.js.ep:9 msgid "Asking for file part XX1 of %1" msgstr "Demanda del tròç XX1 sus %1 del fichièr" @@ -92,15 +92,15 @@ msgstr "Copiar totes los ligams al quicha-papièrs" msgid "Copy to clipboard" msgstr "Copiar al quicha-papièrs" -#: lib/Lufi/Controller/Files.pm:431 +#: lib/Lufi/Controller/Files.pm:455 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:413 +#: lib/Lufi/Controller/Files.pm:437 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:324 +#: lib/Lufi/Controller/Files.pm:348 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 ?" @@ -160,15 +160,15 @@ msgstr "Corrièl" msgid "Encrypting part XX1 of XX2" msgstr "Chiframent del tròç XX1 sus XX2" -#: lib/Lufi/Controller/Files.pm:227 +#: lib/Lufi/Controller/Files.pm:237 msgid "Error: the file existed but was deleted." msgstr "Error : lo fichièr existissiá mas es estat suprimit" -#: lib/Lufi/Controller/Files.pm:293 +#: lib/Lufi/Controller/Files.pm:317 msgid "Error: the file has not been sent entirely." msgstr "Error : lo fichièr es pas estat mandat completament" -#: lib/Lufi/Controller/Files.pm:303 +#: lib/Lufi/Controller/Files.pm:327 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 ?" @@ -184,7 +184,7 @@ msgstr "Expira lo" msgid "Export localStorage data" msgstr "Exportar las donadas localStorage" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:419 msgid "File deleted" msgstr "Fichièr suprimit" @@ -281,7 +281,7 @@ msgid "My files" msgstr "Mos fichièrs" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:69 +#: lib/Lufi/Controller/Files.pm:79 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)." @@ -306,7 +306,11 @@ msgstr "Mercés de contactar l’administrator : %1" 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." -#: lib/Lufi.pm:143 +#: lib/Lufi/Controller/Auth.pm:24 +msgid "Please, check your credentials or your right to access this service: unable to authenticate." +msgstr "" + +#: msgid "Please, check your credentials: unable to authenticate." msgstr "Mercés de verificar vòstres identificants : impossible de vos autentificar." @@ -347,7 +351,7 @@ msgstr "Partejatz vòstres fichièrs en tota confidencialitat sus %1" msgid "Signin" msgstr "Connexion" -#: lib/Lufi.pm:146 +#: msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix." msgstr "O planhèm collèga, sètz pas autorizat a utilizar aqueste servici. Contactatz vòstre administrator sistèma se pensatz que i a un problèma." @@ -355,7 +359,7 @@ msgstr "O planhèm collèga, sètz pas autorizat a utilizar aqueste servici. Con 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:43 +#: lib/Lufi/Controller/Files.pm:53 msgid "Sorry, uploading is disabled." msgstr "O planhèm, la foncion per mandar de fichièr es desactivada." @@ -375,7 +379,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:392 +#: lib/Lufi/Controller/Files.pm:416 msgid "The file has already been deleted" msgstr "Lo fichièr es ja estat suprimit" @@ -400,10 +404,14 @@ 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:181 +#: lib/Lufi/Controller/Files.pm:191 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." +#: lib/Lufi/Controller/Files.pm:243 +msgid "This file has been deactivated by the admins. Contact them to know why." +msgstr "" + #: themes/default/templates/delays.html.ep:10 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 talha dels fichièrs. Lo relambi d’expiracion de vòstre fichièr serà lo minimum entre çò qu’avètz causit e los limits seguents :" @@ -413,17 +421,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossible de copiar lo(s) ligams(s) dins vòstre quicha-papièrs" #. ($short) -#: lib/Lufi/Controller/Files.pm:363 +#: lib/Lufi/Controller/Files.pm:387 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:353 +#: lib/Lufi/Controller/Files.pm:377 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:373 +#: lib/Lufi/Controller/Files.pm:397 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossible de recuperar lo comptador per %1. Sètz pas connectat·ada." @@ -480,11 +488,11 @@ msgid "You must give email addresses." msgstr "Vos cal donar d’adreças." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:56 +#: lib/Lufi/Controller/Files.pm:66 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 +#: lib/Lufi/Controller/Files.pm:299 msgid "Your password is not valid. Please refresh the page to retry." msgstr "Lo senhal es pas valid. Mercés d’actualizar la pagina e ensajar tornamai." diff --git a/themes/default/lib/Lufi/I18N/pt.po b/themes/default/lib/Lufi/I18N/pt.po index b466d49..f8e66e9 100644 --- a/themes/default/lib/Lufi/I18N/pt.po +++ b/themes/default/lib/Lufi/I18N/pt.po @@ -56,7 +56,7 @@ msgstr "" 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 "Como Lufi é um programa livre sob os termos da licença AGPLv3, pode instalar-lo no seu prórpio servidor. Para saber mais clique aqui Wiki para ver o procedimento." -#. (stash('f') +#. (stash('nbslices') #: themes/default/templates/partial/render.js.ep:9 msgid "Asking for file part XX1 of %1" msgstr "Pedido de recuperação de um fragmento do ficheiro XX1 de %1" @@ -93,15 +93,15 @@ msgstr "Copiar todos os links para a área de transferência" msgid "Copy to clipboard" msgstr "Copiar para a área de transferência" -#: lib/Lufi/Controller/Files.pm:431 +#: lib/Lufi/Controller/Files.pm:455 msgid "Could not delete the file. You are not authenticated." msgstr "Impossível apagar o ficheiro. Não está conectado." -#: lib/Lufi/Controller/Files.pm:413 +#: lib/Lufi/Controller/Files.pm:437 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Impossível encontrar o ficheiro.Tem a certeza que o URL e os símbolos estão corretos?" -#: lib/Lufi/Controller/Files.pm:324 +#: lib/Lufi/Controller/Files.pm:348 msgid "Could not find the file. Are you sure of the URL?" msgstr "Impossível encontar o ficheiro. Tem a certeza de que o URL está correto?" @@ -165,15 +165,15 @@ msgstr "E-mails" msgid "Encrypting part XX1 of XX2" msgstr "Codificação do fragmento XX1 de XX2" -#: lib/Lufi/Controller/Files.pm:227 +#: lib/Lufi/Controller/Files.pm:237 msgid "Error: the file existed but was deleted." msgstr "Erro: o ficheiro existia mas foi apagado." -#: lib/Lufi/Controller/Files.pm:293 +#: lib/Lufi/Controller/Files.pm:317 msgid "Error: the file has not been sent entirely." msgstr "Erro: o ficheiro não foi enviado na totalidade." -#: lib/Lufi/Controller/Files.pm:303 +#: lib/Lufi/Controller/Files.pm:327 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Erro: impossível encontrar o ficheiro. Tem a certeza do URL?" @@ -189,7 +189,7 @@ msgstr "Expira no" msgid "Export localStorage data" msgstr "Exportar os dados localStorage" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:419 msgid "File deleted" msgstr "Ficheiro apagado" @@ -290,7 +290,7 @@ msgid "My files" msgstr "Meus ficheiros" #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:69 +#: lib/Lufi/Controller/Files.pm:79 msgid "No enough space available on the server for this file (size: %1)." msgstr "O servidor não tem espaço suficiente para este ficheiro (tamanho: %1)." @@ -315,8 +315,8 @@ msgstr "Contacte o administrador: %1" msgid "Please wait while we are getting your file. We first need to download and decrypt all parts before you can get it." msgstr "Por favor aguarde durante a recuperação do seu ficheiro. Primeiro devemos recuperar e descodificar todos os fragmentos e depois poderá descarregar o ficheiro." -#: lib/Lufi.pm:143 -msgid "Please, check your credentials: unable to authenticate." +#: lib/Lufi/Controller/Auth.pm:24 +msgid "Please, check your credentials or your right to access this service: unable to authenticate." msgstr "" #: themes/default/templates/about.html.ep:5 @@ -356,15 +356,11 @@ msgstr "Partilhe os seus ficheiros com toda a privacidade em %1" msgid "Signin" msgstr "Conexão" -#: lib/Lufi.pm:146 -msgid "Sorry mate, you are not authorised to use that service. Contact your sysadmin if you think there's a glitch in the matrix." -msgstr "" - #: themes/default/templates/index.html.ep:30 msgid "Sorry, the uploading is currently disabled. Please try again later." msgstr "Desculpe, o envio do ficheiro está atualmente desativado. Tente mais tarde." -#: lib/Lufi/Controller/Files.pm:43 +#: lib/Lufi/Controller/Files.pm:53 msgid "Sorry, uploading is disabled." msgstr "Desculpe, o envio do ficheiro está desativado." @@ -384,7 +380,7 @@ msgstr "A mensagem do e-mail não pode estar vazia." msgid "The email subject can't be empty." msgstr "O assunto do e-mail não pode estar vazio." -#: lib/Lufi/Controller/Files.pm:392 +#: lib/Lufi/Controller/Files.pm:416 msgid "The file has already been deleted" msgstr "O ficheiro já foi apagado" @@ -409,10 +405,14 @@ msgstr "O e-mail foi enviado." 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 "O autor original (e por agora, o único) é Luc Didry. Se o desejar apoiar pode fazer-lo via Tipeee ou via Liberapay." -#: lib/Lufi/Controller/Files.pm:181 +#: lib/Lufi/Controller/Files.pm:191 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "O servidor foi incapaz de encontrar o registo do ficheiro no qual devia-se juntar o fragmento do seu ficheiro. Contacte o administrador." +#: lib/Lufi/Controller/Files.pm:243 +msgid "This file has been deactivated by the admins. Contact them to know why." +msgstr "" + #: themes/default/templates/delays.html.ep:10 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 "O servidor exige limites segundo o tamanho dos ficheiros. O prazo de expiração dos seu ficheiro sera o minimo entre o que você escolheu e os limites seguintes:" @@ -422,17 +422,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "Impossível copiar o(s) link(s) na sua área de transferência" #. ($short) -#: lib/Lufi/Controller/Files.pm:363 +#: lib/Lufi/Controller/Files.pm:387 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Impossível recuperar o contador para %1. O ficheiro não existe. Isso vai apagar a sua localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:353 +#: lib/Lufi/Controller/Files.pm:377 msgid "Unable to get counter for %1. The token is invalid." msgstr "Impossível recuperar o contador para %1. O símbolo é inválido." #. ($short) -#: lib/Lufi/Controller/Files.pm:373 +#: lib/Lufi/Controller/Files.pm:397 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Impossível recuperar o contador para %1. Não está conectado." @@ -493,11 +493,11 @@ msgid "You must give email addresses." msgstr "Deve escrever os e-mails." #. (format_bytes($json->{size}) -#: lib/Lufi/Controller/Files.pm:56 +#: lib/Lufi/Controller/Files.pm:66 msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "O seu ficheiro é grande de mais: %1 (o tamanho máximo autorizado é de %2)" -#: lib/Lufi/Controller/Files.pm:275 +#: lib/Lufi/Controller/Files.pm:299 msgid "Your password is not valid. Please refresh the page to retry." msgstr "" diff --git a/themes/default/templates/mail.html.ep b/themes/default/templates/mail.html.ep index 7886b7a..d72d839 100644 --- a/themes/default/templates/mail.html.ep +++ b/themes/default/templates/mail.html.ep @@ -46,5 +46,5 @@ <%= l('Send with your own mail software') %>
-%= javascript '/partial/mail.js' +%= javascript url_for('/partial/mail.js')->query(populate => (!defined(stash('msg')) && !defined(stash('values'))), links => $links) %= javascript '/js/moment-with-locales.min.js' diff --git a/themes/default/templates/partial/mail.js.ep b/themes/default/templates/partial/mail.js.ep index ed482d7..d96bbae 100644 --- a/themes/default/templates/partial/mail.js.ep +++ b/themes/default/templates/partial/mail.js.ep @@ -23,7 +23,7 @@ function updateMailtoLink() { } function populateBody() { var links = [ - % for my $link (@{$links}) { + % for my $link (@{stash('links')}) { '<%= $link %>', % } ]; @@ -45,7 +45,7 @@ function populateBody() { updateMailtoLink(); } document.addEventListener('DOMContentLoaded', function() { -% unless (defined(stash('msg')) || defined(stash('values'))) { +% if (stash('populate')) { populateBody(); % } diff --git a/themes/default/templates/partial/render.js.ep b/themes/default/templates/partial/render.js.ep index 60435e5..0cafdad 100644 --- a/themes/default/templates/partial/render.js.ep +++ b/themes/default/templates/partial/render.js.ep @@ -1,11 +1,11 @@ % # vim:set sts=4 sw=4 ts=4 ft=javascript expandtab: -var ws_url = '<%= url_for('download')->to_abs() %>'; +var ws_url = '<%= url_for('download')->to_abs().stash('file') %>'; var i18n = { aborted1: '<%= l('Download aborted.') %>', aborted2: '<%= l('Click here to refresh the page and restart the download.') %>', badkey: '<%= l('It seems that the key in your URL is incorrect. Please, verify your URL.') %>', confirmExit: '<%= l('You have attempted to leave this page. The download will be canceled. Are you sure?') %>', download: '<%= l('Get the file') %>', - loading: '<%= l('Asking for file part XX1 of %1', stash('f')->nbslices) %>', + loading: '<%= l('Asking for file part XX1 of %1', stash('nbslices')) %>', nokey: '<%= l('You don\'t seem to have a key in your URL. You won\'t be able to decrypt the file. Download canceled.') %>', } diff --git a/themes/default/templates/render.html.ep b/themes/default/templates/render.html.ep index f1e5f13..6018c25 100644 --- a/themes/default/templates/render.html.ep +++ b/themes/default/templates/render.html.ep @@ -41,7 +41,7 @@ -%= javascript '/partial/render.js' +%= javascript '/partial/render.js?nbslices='.stash('f')->nbslices.'&file='.stash('f')->short %= javascript '/js/filesize.min.js' %= javascript '/js/sjcl.js' %= javascript '/js/lufi-down.js' diff --git a/utilities/migrations/pg.sql b/utilities/migrations/pg.sql index 5406a18..c4e3341 100644 --- a/utilities/migrations/pg.sql +++ b/utilities/migrations/pg.sql @@ -26,3 +26,7 @@ CREATE TABLE IF NOT EXISTS slices ( -- 1 down DROP TABLE slices; DROP TABLE files; +-- 2 up +ALTER TABLE files ADD COLUMN abuse integer; +-- 2 down +ALTER TABLE files DROP COLUMN abuse; diff --git a/utilities/migrations/sqlite.sql b/utilities/migrations/sqlite.sql index 90584f1..bd5bd69 100644 --- a/utilities/migrations/sqlite.sql +++ b/utilities/migrations/sqlite.sql @@ -13,7 +13,8 @@ CREATE TABLE IF NOT EXISTS files ( last_access_at INTEGER, mod_token TEXT, nbslices INTEGER, - complete INTEGER + complete INTEGER, + passwd TEXT ); CREATE TABLE IF NOT EXISTS slices ( short TEXT, @@ -26,3 +27,28 @@ CREATE INDEX IF NOT EXISTS slices_idx ON slices(short); DROP INDEX slices_idx ON slices(short); DROP TABLE slices; DROP TABLE files; +-- 2 up +ALTER TABLE files ADD COLUMN abuse INTEGER; +-- 2 down +BEGIN TRANSACTION; + CREATE TABLE files_backup ( + short TEXT PRIMARY KEY, + deleted INTEGER, + mediatype TEXT, + filename TEXT, + filesize INTEGER, + counter INTEGER, + delete_at_first_view INTEGER, + delete_at_day INTEGER, + created_at INTEGER, + created_by TEXT, + last_access_at INTEGER, + mod_token TEXT, + nbslices INTEGER, + complete INTEGER, + passwd TEXT + ); + INSERT INTO files_backup SELECT short, deleted, mediatype, filename, filesize, counter, delete_at_first_view, delete_at_day, created_at, created_by, last_access_at, mod_token, nbslices, complete, passwd FROM files; + DROP TABLE files; + ALTER TABLE files_backup RENAME TO files; +COMMIT;