mirror of
https://framagit.org/fiat-tux/hat-softwares/lutim.git
synced 2026-08-07 09:22:46 +02:00
Small bugfixes
Production always gives surprises !
This commit is contained in:
+524
-489
File diff suppressed because it is too large
Load Diff
+1
-5
@@ -86,11 +86,7 @@ sub startup {
|
||||
my $c = shift;
|
||||
my $ip_only = shift || 0;
|
||||
|
||||
my $proxy = '';
|
||||
my @x_forward = $c->req->headers->header('X-Forwarded-For');
|
||||
for my $x (@x_forward) {
|
||||
$proxy .= join(', ', @$x);
|
||||
}
|
||||
my $proxy = $c->req->headers->header('X-Forwarded-For');
|
||||
|
||||
my $ip = ($proxy) ? $proxy : $c->tx->remote_address;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ sub delete {
|
||||
if (scalar(@images)) {
|
||||
my $image = $images[0];
|
||||
my $msg;
|
||||
if ($image->mod_token() ne $token) {
|
||||
if ($image->mod_token() ne $token || $token eq '') {
|
||||
$msg = $c->l('invalid_token');
|
||||
} elsif ($image->enabled() == 0) {
|
||||
$msg = $c->l('already_deleted', $image->filename);
|
||||
@@ -227,6 +227,11 @@ sub add {
|
||||
# Give url to user
|
||||
$short = $records[0]->short;
|
||||
$real_short = $short;
|
||||
if (!defined($records[0]->mod_token)) {
|
||||
$records[0]->update(
|
||||
mod_token => $c->shortener($c->config->{token_length})
|
||||
);
|
||||
}
|
||||
$token = $records[0]->mod_token;
|
||||
$short .= '/'.$key if (defined($key));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user