From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PtHo8-0005bk-3Z for garchives@archives.gentoo.org; Sat, 26 Feb 2011 10:55:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1F4CDE0467; Sat, 26 Feb 2011 10:55:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CFF27E0467 for ; Sat, 26 Feb 2011 10:55:19 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 41DE31B4086 for ; Sat, 26 Feb 2011 10:55:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9E81F8006A for ; Sat, 26 Feb 2011 10:55:18 +0000 (UTC) From: "Alex Legler" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alex Legler" Message-ID: <62941528b5651c7020117804b266af1cf6c25100.a3li@gentoo> Subject: [gentoo-commits] proj/glsamaker:master commit in: app/models/, app/views/glsa/, app/controllers/ X-VCS-Repository: proj/glsamaker X-VCS-Files: app/controllers/glsa_controller.rb app/models/glsa.rb app/views/glsa/new-request.html.erb X-VCS-Directories: app/models/ app/views/glsa/ app/controllers/ X-VCS-Committer: a3li X-VCS-Committer-Name: Alex Legler X-VCS-Revision: 62941528b5651c7020117804b266af1cf6c25100 Date: Sat, 26 Feb 2011 10:55:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 3541c80d5ba7183677883bad69097895 commit: 62941528b5651c7020117804b266af1cf6c25100 Author: Alex Legler a3li li> AuthorDate: Sat Feb 26 10:54:30 2011 +0000 Commit: Alex Legler gentoo org> CommitDate: Sat Feb 26 10:54:30 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/glsamaker.git= ;a=3Dcommit;h=3D62941528 Allow to import references at creation of the draft --- app/controllers/glsa_controller.rb | 2 +- app/models/glsa.rb | 11 ++++++++++- app/views/glsa/new-request.html.erb | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/controllers/glsa_controller.rb b/app/controllers/glsa_co= ntroller.rb index dcddebc..f5d3e11 100644 --- a/app/controllers/glsa_controller.rb +++ b/app/controllers/glsa_controller.rb @@ -52,7 +52,7 @@ class GlsaController < ApplicationController def create if params[:what] =3D=3D "request" begin - glsa =3D Glsa.new_request(params[:title], params[:bugs], params[= :comment], params[:access], current_user) + glsa =3D Glsa.new_request(params[:title], params[:bugs], params[= :comment], params[:access], (params[:import_references].to_i =3D=3D 1), c= urrent_user) =20 Glsamaker::Mail.request_notification(glsa, current_user) =20 diff --git a/app/models/glsa.rb b/app/models/glsa.rb index 814a1e3..764ef72 100644 --- a/app/models/glsa.rb +++ b/app/models/glsa.rb @@ -136,7 +136,7 @@ class Glsa < ActiveRecord::Base end =20 # Files a new GLSA request - def self.new_request(title, bugs, comment, access, user) + def self.new_request(title, bugs, comment, access, import_references, = user) glsa =3D Glsa.new glsa.requester =3D user glsa.glsa_id =3D Digest::MD5.hexdigest(title + Time.now.to_s)[0...9] @@ -184,6 +184,15 @@ class Glsa < ActiveRecord::Base end end =20 + if import_references + logger.debug { "importing references" } + refs =3D [] + glsa.related_cves.each do |cve| + refs << {:title =3D> cve.cve_id, :url =3D> cve.url} + end + glsa.add_references refs + end + glsa end =20 diff --git a/app/views/glsa/new-request.html.erb b/app/views/glsa/new-req= uest.html.erb index 4f1062f..bd6df24 100644 --- a/app/views/glsa/new-request.html.erb +++ b/app/views/glsa/new-request.html.erb @@ -31,6 +31,14 @@


+
+

3D"reference" References

+

+ + +

+
+
<%- if current_user.access >=3D 1 -%>

3D"permission" Permissions