... | ... |
@@ -31,7 +31,7 @@ |
31 | 31 |
# "user" and "password" |
32 | 32 |
$password = '' unless defined $password; |
33 | 33 |
my $user = $dbi->model('user')->select( |
34 |
- ['password', 'salt', 'admin'], |
|
34 |
+ ['row_id', 'password', 'salt', 'admin'], |
|
35 | 35 |
where => {id => $id} |
36 | 36 |
)->one; |
37 | 37 |
if (!$user) { |
... | ... |
@@ -56,7 +56,8 @@ |
56 | 56 |
# Login success |
57 | 57 |
my $password_encrypted = $user->{password}; |
58 | 58 |
my $admin = $user->{admin}; |
59 |
- session(user => $id); |
|
59 |
+ session(user => $id); # Deprecated! |
|
60 |
+ session(user_row_id => $user->{row_id}); |
|
60 | 61 |
session(password => $password_encrypted); |
61 | 62 |
|
62 | 63 |
if ($save) { |
... | ... |
@@ -7,6 +7,8 @@ |
7 | 7 |
my $project = param('project'); |
8 | 8 |
my $row_id = param('row_id'); |
9 | 9 |
|
10 |
+ my $user_row_id = app->dbi->model('user')->select('row_id', where => {id => $user})->value; |
|
11 |
+ |
|
10 | 12 |
# Git |
11 | 13 |
my $git = $self->app->git; |
12 | 14 |
|
... | ... |
@@ -46,6 +48,9 @@ |
46 | 48 |
stash from_id => $start_commit->{id}; |
47 | 49 |
stash rev => $end_commit->{id}; |
48 | 50 |
stash from_rev => $start_commit->{id}; |
51 |
+ |
|
52 |
+ # Allow pull request |
|
53 |
+ |
|
49 | 54 |
%> |
50 | 55 |
|
51 | 56 |
% layout 'common', title => "Pull Requests Tags \x{30fb} $user/$project"; |
... | ... |
@@ -141,28 +146,31 @@ |
141 | 146 |
</div> |
142 | 147 |
|
143 | 148 |
%= include '/include/commit_body'; |
144 |
- <form action="<%= url_for %>" method="post"> |
|
145 |
- <div class="pull-request-form"> |
|
146 |
- <div style="overflow:hidden"> |
|
147 |
- <div style="float:left;padding:10px;padding-right:0"> |
|
148 |
- <div style="width:30px;height:30px;text-align:center;border-radius:15px;background:#95c97e;color:white;padding-top:5px;"><%= "\x{2714}" %></div> |
|
149 |
- </div> |
|
150 |
- <div style="float:left"> |
|
151 |
- <div class="pull-request-form-title"> |
|
152 |
- <div> |
|
153 |
- <b>This branch has no conflicts with the base branch</b> |
|
154 |
- </div> |
|
155 |
- <div> |
|
156 |
- <span style="color:#767676">Merging can be performed automatically.</span> |
|
149 |
+ |
|
150 |
+ % if (session('user_row_id') eq $user_row_id) { |
|
151 |
+ <form action="<%= url_for %>" method="post"> |
|
152 |
+ <div class="pull-request-form"> |
|
153 |
+ <div style="overflow:hidden"> |
|
154 |
+ <div style="float:left;padding:10px;padding-right:0"> |
|
155 |
+ <div style="width:30px;height:30px;text-align:center;border-radius:15px;background:#95c97e;color:white;padding-top:5px;"><%= "\x{2714}" %></div> |
|
156 |
+ </div> |
|
157 |
+ <div style="float:left"> |
|
158 |
+ <div class="pull-request-form-title"> |
|
159 |
+ <div> |
|
160 |
+ <b>This branch has no conflicts with the base branch</b> |
|
161 |
+ </div> |
|
162 |
+ <div> |
|
163 |
+ <span style="color:#767676">Merging can be performed automatically.</span> |
|
164 |
+ </div> |
|
157 | 165 |
</div> |
158 | 166 |
</div> |
159 | 167 |
</div> |
160 |
- </div> |
|
161 |
- <div class="pull-request-form-button"> |
|
162 |
- <%= submit_button 'Merge pull request', class => "btn btn-success" %> |
|
168 |
+ <div class="pull-request-form-button"> |
|
169 |
+ <%= submit_button 'Merge pull request', class => "btn btn-success" %> |
|
170 |
+ </div> |
|
163 | 171 |
</div> |
164 | 172 |
</div> |
165 |
- </div> |
|
173 |
+ % } |
|
166 | 174 |
</div> |
167 | 175 |
</div> |
168 | 176 |
|