From abef542966234d8845e4efb1e153912772b62d7c Mon Sep 17 00:00:00 2001 From: Banana Date: Wed, 15 Jun 2011 12:39:31 +0200 Subject: [PATCH] code cleanup and export only if authenticated --- lib/Insipid/Main.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/Insipid/Main.pm b/lib/Insipid/Main.pm index bfb983f..6101b65 100755 --- a/lib/Insipid/Main.pm +++ b/lib/Insipid/Main.pm @@ -114,6 +114,12 @@ sub main { if ( defined( url_param('op') ) ) { if ( url_param('op') eq 'export' ) { + + if ( logged_in() ne 1 ) { + push( @errors,"You have to be logged in to perform that operation." ); + #return; + } + my $sn = 'n'; if ( defined( param('snapshots') ) ) { $sn = 'y'; @@ -140,16 +146,14 @@ sub main { # JSON # JSON Show tags: if ( url_param('op') eq 'json_tags' ) { - print - "Content-Type: application/x-javascript;charset=UTF-8\r\n\r\n"; + print "Content-Type: application/x-javascript;charset=UTF-8\r\n\r\n"; send_json_tags(); exit; } # JSON Show bookmarks: if ( url_param('op') eq 'json_posts' ) { - print - "Content-Type: application/x-javascript;charset=UTF-8\r\n\r\n"; + print "Content-Type: application/x-javascript;charset=UTF-8\r\n\r\n"; send_json_posts(); exit; } @@ -282,9 +286,7 @@ IFORM { if ( logged_in() ne 1 ) { - push( @errors, - "You have to be logged in to perform that operation." ); - + push( @errors,"You have to be logged in to perform that operation." ); #return; } -- 2.39.5