Commit 6194e0851193d83de047786a7cdf5a157d5caeb2
1 parent
55fcdbe2
Exists in
master
and in
1 other branch
Adds username and password to redmine tracker config.
Showing
1 changed file
with
9 additions
and
1 deletions
Show diff stats
app/models/issue_trackers/redmine_tracker.rb
@@ -9,6 +9,12 @@ if defined? RedmineClient | @@ -9,6 +9,12 @@ if defined? RedmineClient | ||
9 | [:api_token, { | 9 | [:api_token, { |
10 | :placeholder => "API Token for your account" | 10 | :placeholder => "API Token for your account" |
11 | }], | 11 | }], |
12 | + [:username, { | ||
13 | + :placeholder => "Your username" | ||
14 | + }], | ||
15 | + [:password, { | ||
16 | + :placeholder => "Your password" | ||
17 | + }], | ||
12 | [:project_id, { | 18 | [:project_id, { |
13 | :label => "Ticket Project", | 19 | :label => "Ticket Project", |
14 | :placeholder => "Redmine Project where tickets will be created" | 20 | :placeholder => "Redmine Project where tickets will be created" |
@@ -22,7 +28,7 @@ if defined? RedmineClient | @@ -22,7 +28,7 @@ if defined? RedmineClient | ||
22 | 28 | ||
23 | def check_params | 29 | def check_params |
24 | if Fields.detect {|f| self[f[0]].blank? && !f[1][:optional]} | 30 | if Fields.detect {|f| self[f[0]].blank? && !f[1][:optional]} |
25 | - errors.add :base, 'You must specify your Redmine URL, API token and Project ID' | 31 | + errors.add :base, 'You must specify your Redmine URL, API token, Username, Password and Project ID' |
26 | end | 32 | end |
27 | end | 33 | end |
28 | 34 | ||
@@ -31,6 +37,8 @@ if defined? RedmineClient | @@ -31,6 +37,8 @@ if defined? RedmineClient | ||
31 | acc = account | 37 | acc = account |
32 | RedmineClient::Base.configure do | 38 | RedmineClient::Base.configure do |
33 | self.token = token | 39 | self.token = token |
40 | + self.user = username | ||
41 | + self.password = password | ||
34 | self.site = acc | 42 | self.site = acc |
35 | self.format = :xml | 43 | self.format = :xml |
36 | end | 44 | end |