Commit 661783ef authored by Alain Takoudjou's avatar Alain Takoudjou

slapos_web: update certificate generation form

parent 2344625d
"""
If certificate_request is None will only create the computer without
generate a certificate.
"""
portal = context.getPortalObject()
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()
......@@ -10,7 +15,8 @@ else:
request_kw = dict(computer_title=title)
person.requestComputer(**request_kw)
computer = context.restrictedTraverse(context.REQUEST.get('computer'))
computer.generateCertificate()
if certificate_request is not None:
computer.generateCertificate(certificate_request=certificate_request)
message = "Registering Computer"
context.REQUEST.set("portal_status_message", message)
return computer.Computer_viewConnectionInformationAsWeb()
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>title</string> </value>
<value> <string>title, certificate_request=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
computer = context
request = context.REQUEST
try:
computer.generateCertificate(csr=certificate_signature_request)
computer.generateCertificate(certificate_request=certificate_signature_request)
request.set('portal_status_message', context.Base_translateString('Certificate created.'))
except ValueError:
request.set('portal_status_message', context.Base_translateString('Certificate is still active, please revoke existing one.'))
......
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>height</string> </key>
<value> <int>10</int> </value>
<value> <int>15</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>width</string> </key>
<value> <int>80</int> </value>
<value> <int>65</int> </value>
</item>
</dictionary>
</value>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StringField" module="Products.Formulator.StandardFields"/>
<global name="LinkField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
......@@ -18,6 +18,10 @@
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>not_link</string> </key>
<value> <string>The specified link is broken.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
......@@ -37,6 +41,14 @@
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_link</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_timeout</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
......@@ -81,6 +93,10 @@
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>link_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......@@ -116,6 +132,14 @@
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_link</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_timeout</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
......@@ -160,6 +184,10 @@
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>link_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......@@ -195,9 +223,17 @@
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>check_link</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>check_timeout</string> </key>
<value> <float>7.0</float> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
<value> <string>nolabel</string> </value>
</item>
<item>
<key> <string>default</string> </key>
......@@ -213,11 +249,11 @@
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>40</int> </value>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -239,6 +275,10 @@
<key> <string>input_type</string> </key>
<value> <string>text</string> </value>
</item>
<item>
<key> <string>link_type</string> </key>
<value> <string>external</string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
......
......@@ -88,7 +88,6 @@
<list>
<string>your_description</string>
<string>my_certificate_signature_request</string>
<string>your_common_name</string>
</list>
</value>
</item>
......
......@@ -88,7 +88,6 @@
<list>
<string>your_description</string>
<string>my_certificate_signature_request</string>
<string>your_common_name</string>
</list>
</value>
</item>
......
......@@ -97,7 +97,6 @@
<string>my_reference</string>
<string>your_computer_url</string>
<string>your_certificate</string>
<string>your_key</string>
</list>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment