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

Collapse All | Expand All

(-)umc/js/setup/ApplianceWizard.js (-4 / +22 lines)
 Lines 717-722    Link Here 
717
					name: 'start/join',
717
					name: 'start/join',
718
					label: _('Start join at the end of the installation'),
718
					label: _('Start join at the end of the installation'),
719
					value: true,
719
					value: true,
720
					disabled: !!this.ucr['umc/web/appliance/name'],
720
					onChange: lang.hitch(this, function(value) {
721
					onChange: lang.hitch(this, function(value) {
721
						this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').set('disabled', !value);
722
						this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').set('disabled', !value);
722
						this.getWidget('credentials-nonmaster', '_ucs_address').set('disabled', !value || this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').get('value'));
723
						this.getWidget('credentials-nonmaster', '_ucs_address').set('disabled', !value || this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').get('value'));
 Lines 2172-2182    Link Here 
2172
		_checkCredentials: function() {
2173
		_checkCredentials: function() {
2173
			var params = {role: this._getRoleForDomainChecks(true)};
2174
			var params = {role: this._getRoleForDomainChecks(true)};
2174
			lang.mixin(params, this._getCredentials());
2175
			lang.mixin(params, this._getCredentials());
2175
			return this.standbyDuring(this.umcpCommand('setup/check/credentials', params).then(function(data) {
2176
			return this.umcpCommand('setup/check/credentials', params).then(function(data) {
2176
				return data.result;
2177
				return data.result;
2177
			}));
2178
			});
2178
		},
2179
		},
2179
2180
2181
		_domainHasActivatedLicense: function () {
2182
			var credentials = this._getCredentials();
2183
			return this.umcpCommand('setup/check/license', credentials).then(function(data) {
2184
				return data.result;
2185
			});
2186
		},
2187
2180
		_getCredentials: function() {
2188
		_getCredentials: function() {
2181
			var address, username, password, dns;
2189
			var address, username, password, dns;
2182
			var isAdMember = this._isAdMember();
2190
			var isAdMember = this._isAdMember();
 Lines 2391-2401    Link Here 
2391
			}
2399
			}
2392
2400
2393
			if (pageName == 'credentials-ad' || pageName == 'credentials-nonmaster') {
2401
			if (pageName == 'credentials-ad' || pageName == 'credentials-nonmaster') {
2394
				return this._checkCredentials().then(lang.hitch(this, function(domain) {
2402
				return this.standbyDuring(this._checkCredentials().then(lang.hitch(this, function(domain) {
2395
					var msg = '';
2403
					var msg = '';
2396
					this._domainName = null;
2404
					this._domainName = null;
2397
					if (typeof domain == 'string') {
2405
					if (typeof domain == 'string') {
2398
						this._domainName = domain;
2406
						this._domainName = domain;
2407
						if (this.ucr['umc/web/appliance/name'] && pageName == 'credentials-nonmaster') {
2408
							return this._domainHasActivatedLicense().then(lang.hitch(this, function(data) {
2409
								if (!data) {
2410
									msg = _('App Appliance could not be joined because the license on the DC Master is not activated.');
2411
									nextPage = pageName;
2412
									dialog.alert(msg);
2413
								}
2414
								return this._forcePageTemporarily(nextPage);
2415
							}));
2416
						}
2399
					} else if (domain === false) {
2417
					} else if (domain === false) {
2400
						msg = _('Connection refused. Please recheck the password');
2418
						msg = _('Connection refused. Please recheck the password');
2401
						nextPage = pageName;
2419
						nextPage = pageName;
 Lines 2414-2420    Link Here 
2414
					}
2432
					}
2415
2433
2416
					return this._forcePageTemporarily(nextPage);
2434
					return this._forcePageTemporarily(nextPage);
2417
				}));
2435
				})));
2418
			}
2436
			}
2419
2437
2420
			if (nextPage == 'software') {
2438
			if (nextPage == 'software') {
(-)umc/setup.xml (+1 lines)
 Lines 48-52    Link Here 
48
		<command name="setup/check/credentials" function="check_credentials"/>
48
		<command name="setup/check/credentials" function="check_credentials"/>
49
		<command name="setup/set_locale" function="set_locale"/>
49
		<command name="setup/set_locale" function="set_locale"/>
50
		<command name="setup/net/progress" function="progress"/>
50
		<command name="setup/net/progress" function="progress"/>
51
		<command name="setup/check/license" function="domain_has_activated_license"/>
51
	</module>
52
	</module>
52
</umc>
53
</umc>
(-)umc/python/setup/__init__.py (-2 / +13 lines)
 Lines 41-47    Link Here 
41
import subprocess
41
import subprocess
42
import json
42
import json
43
import locale as _locale
43
import locale as _locale
44
import lxml.etree 
44
import lxml.etree
45
45
46
import notifier
46
import notifier
47
import notifier.threads
47
import notifier.threads
 Lines 237-244    Link Here 
237
		oldrole = orgValues.get('server/role', '')
237
		oldrole = orgValues.get('server/role', '')
238
		newrole = values.get('server/role', oldrole)
238
		newrole = values.get('server/role', oldrole)
239
		if orgValues.get('joined'):
239
		if orgValues.get('joined'):
240
			raise Exception(_('Already joined systems cannot be joined.'))
240
			raise UMC_Error(_('Already joined systems cannot be joined.'))
241
241
242
		is_appliance = ucr.get('umc/web/appliance/name') != ''
243
		is_nonmaster = newrole != "domaincontroller_master"
244
		if is_appliance and is_nonmaster:
245
			activated = self._domain_has_activated_license(values.get('nameserver1'), username, password)
246
			if not activated:
247
				raise UMC_Error(_('App Appliance could not be joined because the license on the DC Master is not activated.'))
248
242
		def _thread(obj, username, password):
249
		def _thread(obj, username, password):
243
			# acquire the lock until the scripts have been executed
250
			# acquire the lock until the scripts have been executed
244
			self._finishedResult = False
251
			self._finishedResult = False
 Lines 749-754    Link Here 
749
		return result
756
		return result
750
757
751
	@simple_response
758
	@simple_response
759
	def domain_has_activated_license(self, nameserver, username, password):
760
		return util.domain_has_activated_license(nameserver, username, password)
761
762
	@simple_response
752
	def check_credentials(self, role, dns, nameserver, address, username, password):
763
	def check_credentials(self, role, dns, nameserver, address, username, password):
753
		if role == 'ad':
764
		if role == 'ad':
754
			try:
765
			try:
(-)umc/python/setup/util.py (+13 lines)
 Lines 54-59    Link Here 
54
from univention.management.console.log import MODULE
54
from univention.management.console.log import MODULE
55
from univention.management.console.modules import UMC_CommandError
55
from univention.management.console.modules import UMC_CommandError
56
from univention.lib.admember import lookup_adds_dc, failedADConnect
56
from univention.lib.admember import lookup_adds_dc, failedADConnect
57
from univention.lib.umc_connection import UMCConnection
57
58
58
try:
59
try:
59
	# execute imports in try/except block as during build test scripts are
60
	# execute imports in try/except block as during build test scripts are
 Lines 999-1001    Link Here 
999
		ipv4_nameserver=random.choice(ipv4_servers),
1000
		ipv4_nameserver=random.choice(ipv4_servers),
1000
		ipv6_nameserver=random.choice(ipv6_servers),
1001
		ipv6_nameserver=random.choice(ipv6_servers),
1001
	)
1002
	)
1003
1004
def domain_has_activated_license(nameserver, username, password):
1005
	fqdn_master = get_fqdn(nameserver)
1006
	if not fqdn_master:
1007
		return False
1008
	connection = UMCConnection(fqdn_master)
1009
	connection.auth(username, password)
1010
	result = connection.request('udm/license/info')
1011
	if result.get('keyID'):
1012
		return True
1013
	else:
1014
		return False

Return to bug 39700