--- umc/js/setup/ApplianceWizard.js (Revision 67254)
+++ umc/js/setup/ApplianceWizard.js (Arbeitskopie)
@@ -717,6 +717,7 @@
name: 'start/join',
label: _('Start join at the end of the installation'),
value: true,
+ disabled: !!this.ucr['umc/web/appliance/name'],
onChange: lang.hitch(this, function(value) {
this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').set('disabled', !value);
this.getWidget('credentials-nonmaster', '_ucs_address').set('disabled', !value || this.getWidget('credentials-nonmaster', '_ucs_autosearch_master').get('value'));
@@ -2172,11 +2173,18 @@
_checkCredentials: function() {
var params = {role: this._getRoleForDomainChecks(true)};
lang.mixin(params, this._getCredentials());
- return this.standbyDuring(this.umcpCommand('setup/check/credentials', params).then(function(data) {
+ return this.umcpCommand('setup/check/credentials', params).then(function(data) {
return data.result;
- }));
+ });
},
+ _domainHasActivatedLicense: function () {
+ var credentials = this._getCredentials();
+ return this.umcpCommand('setup/check/license', credentials).then(function(data) {
+ return data.result;
+ });
+ },
+
_getCredentials: function() {
var address, username, password, dns;
var isAdMember = this._isAdMember();
@@ -2391,11 +2399,21 @@
}
if (pageName == 'credentials-ad' || pageName == 'credentials-nonmaster') {
- return this._checkCredentials().then(lang.hitch(this, function(domain) {
+ return this.standbyDuring(this._checkCredentials().then(lang.hitch(this, function(domain) {
var msg = '';
this._domainName = null;
if (typeof domain == 'string') {
this._domainName = domain;
+ if (this.ucr['umc/web/appliance/name'] && pageName == 'credentials-nonmaster') {
+ return this._domainHasActivatedLicense().then(lang.hitch(this, function(data) {
+ if (!data) {
+ msg = _('App Appliance could not be joined because the license on the DC Master is not activated.');
+ nextPage = pageName;
+ dialog.alert(msg);
+ }
+ return this._forcePageTemporarily(nextPage);
+ }));
+ }
} else if (domain === false) {
msg = _('Connection refused. Please recheck the password');
nextPage = pageName;
@@ -2414,7 +2432,7 @@
}
return this._forcePageTemporarily(nextPage);
- }));
+ })));
}
if (nextPage == 'software') {
--- umc/setup.xml (Revision 67254)
+++ umc/setup.xml (Arbeitskopie)
@@ -48,5 +48,6 @@
+
--- umc/python/setup/__init__.py (Revision 67254)
+++ umc/python/setup/__init__.py (Arbeitskopie)
@@ -41,7 +41,7 @@
import subprocess
import json
import locale as _locale
-import lxml.etree
+import lxml.etree
import notifier
import notifier.threads
@@ -237,8 +237,15 @@
oldrole = orgValues.get('server/role', '')
newrole = values.get('server/role', oldrole)
if orgValues.get('joined'):
- raise Exception(_('Already joined systems cannot be joined.'))
+ raise UMC_Error(_('Already joined systems cannot be joined.'))
+ is_appliance = ucr.get('umc/web/appliance/name') != ''
+ is_nonmaster = newrole != "domaincontroller_master"
+ if is_appliance and is_nonmaster:
+ activated = self._domain_has_activated_license(values.get('nameserver1'), username, password)
+ if not activated:
+ raise UMC_Error(_('App Appliance could not be joined because the license on the DC Master is not activated.'))
+
def _thread(obj, username, password):
# acquire the lock until the scripts have been executed
self._finishedResult = False
@@ -749,6 +756,10 @@
return result
@simple_response
+ def domain_has_activated_license(self, nameserver, username, password):
+ return util.domain_has_activated_license(nameserver, username, password)
+
+ @simple_response
def check_credentials(self, role, dns, nameserver, address, username, password):
if role == 'ad':
try:
--- umc/python/setup/util.py (Revision 67254)
+++ umc/python/setup/util.py (Arbeitskopie)
@@ -54,6 +54,7 @@
from univention.management.console.log import MODULE
from univention.management.console.modules import UMC_CommandError
from univention.lib.admember import lookup_adds_dc, failedADConnect
+from univention.lib.umc_connection import UMCConnection
try:
# execute imports in try/except block as during build test scripts are
@@ -999,3 +1000,15 @@
ipv4_nameserver=random.choice(ipv4_servers),
ipv6_nameserver=random.choice(ipv6_servers),
)
+
+def domain_has_activated_license(nameserver, username, password):
+ fqdn_master = get_fqdn(nameserver)
+ if not fqdn_master:
+ return False
+ connection = UMCConnection(fqdn_master)
+ connection.auth(username, password)
+ result = connection.request('udm/license/info')
+ if result.get('keyID'):
+ return True
+ else:
+ return False