aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2011-08-20 12:35:54 +0200
committerAlex Legler <alex@a3li.li>2011-08-20 12:35:54 +0200
commit19ad0379bce7740facbf4d9ed7afb1fc4b3c60f3 (patch)
treedff00133b45b1eb4c3f09f20e3244ee14966ee5f
parentRemove addbug{,save} from GLSAController (diff)
downloadglsamaker-19ad0379bce7740facbf4d9ed7afb1fc4b3c60f3.tar.gz
glsamaker-19ad0379bce7740facbf4d9ed7afb1fc4b3c60f3.tar.bz2
glsamaker-19ad0379bce7740facbf4d9ed7afb1fc4b3c60f3.zip
ToolsController: file_req_ajax_info is now bugs_ajax_info; Remove old methods
-rw-r--r--app/controllers/tools_controller.rb58
-rw-r--r--app/views/bugs/new.html.erb2
-rw-r--r--app/views/glsa/new-request.html.erb2
3 files changed, 3 insertions, 59 deletions
diff --git a/app/controllers/tools_controller.rb b/app/controllers/tools_controller.rb
index d257428..c83930e 100644
--- a/app/controllers/tools_controller.rb
+++ b/app/controllers/tools_controller.rb
@@ -14,7 +14,7 @@ class ToolsController < ApplicationController
layout false
# Provides information for the 'file new request' page
- def file_req_ajax_info
+ def bugs_ajax_info
if params[:bugs] == nil
render :text => "No bug given", :status => 500
return
@@ -65,62 +65,6 @@ class ToolsController < ApplicationController
render :json => {"buginfo" => buginfo, "title" => suggestion}
end
-
- def ajaxbugs
- bug_ids = Bugzilla::Bug.str2bugIDs(params[:bugs])
-
- @bugs = []
- bug_ids.each do |bug_id|
- begin
- @bugs << Bugzilla::Bug.load_from_id(bug_id.to_i)
- rescue Exception => e
- @bugs << "Ignoring #{CGI.escapeHTML(bug_id)} (#{CGI.escapeHTML(e.message)})"
- end
- end
-
- render :layout => false
- end
-
- def ajaxdescr
- bug_ids = Bugzilla::Bug.str2bugIDs(params[:bugs])
-
- @bugs = []
- bug_ids.each do |bug_id|
- begin
- @bugs << Bugzilla::Bug.load_from_id(bug_id.to_i)
- rescue Exception => e
- end
- end
-
- if @bugs.length == 1
- @text = @bugs[0].summary
- render :layout => false
- return
- end
-
- # Process 2 or more bugs
- @atoms = []
- @bugs.each do |bug|
- matchdata = /([\w-]+)\/([\w-]+)(-([\w.]+))?/.match(bug.summary)
-
- unless matchdata.nil?
- category = matchdata[1]
- package = matchdata[2].gsub(/-+?$/, '')
-
- @atoms << "#{category}/#{package}"
- end
- end
-
- @atoms.uniq!
-
- if @atoms.length > 0
- @text = @atoms.join(', ') + ": Multiple vulnerabilities"
- render :layout => false
- return
- end
-
- render :text => "(no suggestion available)", :layout => false
- end
def background
render :layout => false
diff --git a/app/views/bugs/new.html.erb b/app/views/bugs/new.html.erb
index bf04b22..63ca3c8 100644
--- a/app/views/bugs/new.html.erb
+++ b/app/views/bugs/new.html.erb
@@ -18,7 +18,7 @@
<p><input type="text" name="addbugs" id="addbugs" class="hugetext nice"/></p>
<script language="javascript">
new Form.Element.Observer('addbugs', 4, function(element, value) {
- new Ajax.Request("<%= url_for :controller => 'tools', :action => 'file_req_ajax_info' %>", {
+ new Ajax.Request("<%= url_for :controller => 'tools', :action => 'bugs_ajax_info' %>", {
method: 'get',
parameters: { bugs: $('addbugs').getValue() },
onComplete : function(transport) {
diff --git a/app/views/glsa/new-request.html.erb b/app/views/glsa/new-request.html.erb
index 67fcf62..0d0ef57 100644
--- a/app/views/glsa/new-request.html.erb
+++ b/app/views/glsa/new-request.html.erb
@@ -9,7 +9,7 @@
<p><input type="text" name="bugs" id="bugs" class="hugetext nice" value="<%= params[:bugs] %>"/></p>
<script language="javascript">
$("bugs").observe('change', function(event) {
- new Ajax.Request("<%= url_for :controller => 'tools', :action => 'file_req_ajax_info' %>", {
+ new Ajax.Request("<%= url_for :controller => 'tools', :action => 'bugs_ajax_info' %>", {
method: 'get',
parameters: { bugs: $('bugs').getValue() },
onSuccess : function(transport) {