diff --git a/install/static/Makefile.am b/install/static/Makefile.am index 8071d25f1..ee8384c7b 100644 --- a/install/static/Makefile.am +++ b/install/static/Makefile.am @@ -20,6 +20,7 @@ app_DATA = \ jquery-ui.js \ jquery.ba-bbq.js \ jquery-ui.css \ + certificate.js \ group.js \ host.js \ hostgroup.js \ diff --git a/install/static/certificate.js b/install/static/certificate.js new file mode 100755 index 000000000..4302e2f81 --- /dev/null +++ b/install/static/certificate.js @@ -0,0 +1,381 @@ +/* Authors: + * Endi Sukma Dewata + * + * Copyright (C) 2010 Red Hat + * see file 'COPYING' for use and warranty information + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; version 2 only + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +var BEGIN_CERTIFICATE_REQUEST = '-----BEGIN CERTIFICATE REQUEST-----'; +var END_CERTIFICATE_REQUEST = '-----END CERTIFICATE REQUEST-----'; + +var CRL_REASON = [ + 'Unspecified', + 'Key Compromise', + 'CA Compromise', + 'Affiliation Changed', + 'Superseded', + 'Cessation of Operation', + 'Certificate Hold', + null, + 'Remove from CRL', + 'Privilege Withdrawn', + 'AA Compromise' +]; + +function certificate_parse_dn(dn) { + + var result = {}; + + // TODO: Use proper LDAP DN parser + var rdns = dn.split(','); + for (var i=0; i', { + 'title': spec.title + }); + + dialog.append(spec.message); + + that.open = function() { + dialog.dialog({ + modal: true, + width: 300, + height: 150, + buttons: { + 'Close': function() { + dialog.dialog('destroy'); + } + } + }); + }; + + return that; +} + +function certificate_get_dialog(spec) { + var that = {}; + spec = spec || {}; + + var dialog = $('
', { + 'title': spec.title + }); + + var textarea = $('