From: Banana Date: Wed, 15 Jun 2011 10:39:31 +0000 (+0200) Subject: code cleanup and export only if authenticated X-Git-Tag: 2.1-alpha-2019-0-29~125 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=abef542966234d8845e4efb1e153912772b62d7c;p=insipid.git code cleanup and export only if authenticated --- 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; }