From 405866228897e5c22db42ca8ea2418a8fca00a5e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 29 May 2013 14:35:00 +0800 Subject: Bug 760989: Splinter should not require login --- extensions/Splinter/Extension.pm | 6 +- .../template/en/default/pages/splinter.html.tmpl | 109 +++++++++++---------- extensions/Splinter/web/splinter.js | 95 ++++++++++-------- 3 files changed, 115 insertions(+), 95 deletions(-) (limited to 'extensions/Splinter') diff --git a/extensions/Splinter/Extension.pm b/extensions/Splinter/Extension.pm index eef9e89af..c383297c4 100644 --- a/extensions/Splinter/Extension.pm +++ b/extensions/Splinter/Extension.pm @@ -33,8 +33,7 @@ sub page_before_template { my ($vars, $page) = @$args{qw(vars page_id)}; if ($page eq 'splinter.html') { - # Login is required for performing a review - my $user = Bugzilla->login(LOGIN_REQUIRED); + my $user = Bugzilla->user; # We can either provide just a bug id to see a list # of prior reviews by the user, or just an attachment @@ -54,7 +53,8 @@ sub page_before_template { # Check to see if the user can see the bug this attachment is connected to. Bugzilla::Bug->check($attachment->bug_id); - if ($attachment->isprivate && $user->id != $attachment->attacher->id + if ($attachment->isprivate + && $user->id != $attachment->attacher->id && !$user->is_insider) { ThrowUserError('auth_failure', {action => 'access', diff --git a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl index fa6fd8316..80c0a314e 100644 --- a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl +++ b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl @@ -49,6 +49,7 @@ Splinter.configHaveExtension = true; Splinter.configHelp = '[% urlbase FILTER js %]page.cgi?id=splinter/help.html'; Splinter.configNote = ''; + Splinter.readOnly = [% user.id FILTER none %] == 0; Splinter.configAttachmentStatuses = [ [% FOREACH status = attachment_statuses %] @@ -115,8 +116,10 @@ -
-
- -
<Overall Comment>
-
-
-
- - - - - - - - - - -
- [% any_flags_requesteeble = 0 %] - [% FOREACH flag_type = flag_types %] - [% NEXT UNLESS flag_type.is_active %] - [% SET any_flags_requesteeble = 1 IF flag_type.is_requestable && flag_type.is_requesteeble %] - [% END %] - [% IF flag_types.size > 0 %] - [% PROCESS "flag/list.html.tmpl" bug_id = bug_id - attach_id = attach_d - flag_types = flag_types - read_only_flags = !can_edit - any_flags_requesteeble = any_flags_requesteeble - %] - [% END %] - + +
+
+
+ Patch Status: + + + +
- -
- Patch Status: - - - - +
-
-
+ [% ELSE %] +
+ You must be logged in to review patches. +
+ [% END %]