Commit c38e664b5674ded848e93f857f36ea066a6449a5
Exists in
master
and in
1 other branch
Merge pull request #347 from magiclabs/redmine-tracker-auth-fix
Adds username and password to redmine tracker config.
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
app/models/issue_trackers/redmine_tracker.rb
| ... | ... | @@ -9,6 +9,12 @@ if defined? RedmineClient |
| 9 | 9 | [:api_token, { |
| 10 | 10 | :placeholder => "API Token for your account" |
| 11 | 11 | }], |
| 12 | + [:username, { | |
| 13 | + :placeholder => "Your username" | |
| 14 | + }], | |
| 15 | + [:password, { | |
| 16 | + :placeholder => "Your password" | |
| 17 | + }], | |
| 12 | 18 | [:project_id, { |
| 13 | 19 | :label => "Ticket Project", |
| 14 | 20 | :placeholder => "Redmine Project where tickets will be created" |
| ... | ... | @@ -22,15 +28,19 @@ if defined? RedmineClient |
| 22 | 28 | |
| 23 | 29 | def check_params |
| 24 | 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 | 32 | end |
| 27 | 33 | end |
| 28 | 34 | |
| 29 | 35 | def create_issue(problem, reported_by = nil) |
| 30 | 36 | token = api_token |
| 31 | 37 | acc = account |
| 38 | + user = username | |
| 39 | + passwd = password | |
| 32 | 40 | RedmineClient::Base.configure do |
| 33 | 41 | self.token = token |
| 42 | + self.user = user | |
| 43 | + self.password = passwd | |
| 34 | 44 | self.site = acc |
| 35 | 45 | self.format = :xml |
| 36 | 46 | end | ... | ... |