View | Details | Raw Unified | Return to bug 46790 | Differences between
and this patch

Collapse All | Expand All

(-)a/base/univention-system-activation/src/wsgi.py (-2 / +11 lines)
 Lines 2-7    Link Here 
2
2
3
import cgi
3
import cgi
4
import subprocess
4
import subprocess
5
import traceback
5
import json
6
import json
6
import re
7
import re
7
from ldif import LDIFParser
8
from ldif import LDIFParser
 Lines 69-75   def clean_license_output(out): Link Here 
69
70
70
71
71
def application(environ, start_response):
72
def application(environ, start_response):
72
	"""WSGI entry point"""
73
	def _error(message, trace=None):
74
		return {
75
			'status': 500,
76
			'message': message,
77
			'traceback': trace,
78
			'location': '',
79
		}
73
80
74
	def _log(msg):
81
	def _log(msg):
75
		print >> environ['wsgi.errors'], msg
82
		print >> environ['wsgi.errors'], msg
 Lines 91-97   def application(environ, start_response): Link Here 
91
			return _finish(data=out)
98
			return _finish(data=out)
92
		except subprocess.CalledProcessError as exc:
99
		except subprocess.CalledProcessError as exc:
93
			_log('Failed to read license data from LDAP:\n%s' % exc)
100
			_log('Failed to read license data from LDAP:\n%s' % exc)
94
			return _finish('400 Bad Request', 'Failed to read license data from LDAP:\n%s' % exc)
101
			return _finish('500 Internal Server Error', _error('Failed to read license data from LDAP:\n%s' % exc))
102
		except Exception as exc:
103
			return _finish(data=_error(str(exc), traceback.format_exc()))
95
104
96
	# block uploads that are larger than 1MB
105
	# block uploads that are larger than 1MB
97
	try:
106
	try:
(-)a/base/univention-system-activation/www/ActivationWizard.js (-12 / +15 lines)
 Lines 44-52   define([ Link Here 
44
	"umc/widgets/Text",
44
	"umc/widgets/Text",
45
	"umc/widgets/TextBox",
45
	"umc/widgets/TextBox",
46
	"put-selector/put",
46
	"put-selector/put",
47
	"umc/json!/license",
48
	"umc/i18n!systemactivation"
47
	"umc/i18n!systemactivation"
49
], function(declare, lang, array, Deferred, ioQuery, domQuery, request, xhr, script, Uploader, dialog, Wizard, Text, TextBox, put, license, _) {
48
], function(declare, lang, array, Deferred, ioQuery, domQuery, request, xhr, script, Uploader, dialog, Wizard, Text, TextBox, put, _) {
50
	return declare("ActivationWizard", [ Wizard ], {
49
	return declare("ActivationWizard", [ Wizard ], {
51
		autoFocus: true,
50
		autoFocus: true,
52
		entries: null,
51
		entries: null,
 Lines 201-216   define([ Link Here 
201
			emailNode.innerHTML = email_address;
200
			emailNode.innerHTML = email_address;
202
201
203
			// send the email
202
			// send the email
204
			var data = {
203
			xhr.get('/license', { handleAs: 'json' }).then(function(license) {
205
				email: email_address,
204
				var data = {
206
				licence: license
205
					email: email_address,
207
			};
206
					licence: license
208
			return xhr.post('https://license.univention.de/keyid/conversion/submit', {
207
				};
209
				data: data,
208
				return xhr.post('https://license.univention.de/keyid/conversion/submit', {
210
				handleAs: 'text',
209
					data: data,
211
				headers: {
210
					handleAs: 'text',
212
					'X-Requested-With': null
211
					headers: {
213
				}
212
						'X-Requested-With': null
213
					}
214
				});
215
			}, function(error) {
216
				tools.handleErrorStatus(error);
214
			});
217
			});
215
		},
218
		},
216
219

Return to bug 46790