

kerio.waw.ui.userImportServer = {

x_m: function(x_n) {
var
x_r = kerio.waw.shared.x_3r,
x_1zk = (x_r.x_3s.x_3t === x_r.x_3s.x_3u),
x_2w = x_n + '_',
x_1b = kerio.lib,
x_x = x_1b.x_x,
x_1zl,
x_br,
x_1d,
x_1c,
x_10,
x_16,
x_1zm;
this.x_ga = x_n;
x_1zl = {
x_os: 0,
x_1x1: 1
};
x_r.x_1zl = x_1zl;
x_br = x_1b.x_a1(
{	x_a2: 200,
es: 220
});
x_1d = {
x_1e: [
{
x_1f: 'x_1g',
x_br: x_br,
x_1e: [
{ x_1j: 'x_vh',
x_23: x_x('Import users from:', 'userImportServer'),
x_1f: 'x_9u',
x_1m: x_1zk,
x_5z: [
{
x_1o: x_1zl.x_os,
x_23: x_x('Active Directory®', 'userImportServer')
},
{
x_1o: x_1zl.x_1x1,
x_23: x_x('Windows NT® domain', 'userImportServer')
}
],
x_a5: 'x_23',
x_a7: 'x_1o',
x_1o: x_1zl.x_os,

x_9t: function(x_1c, x_9u, x_1o){
if (!x_1c) {
return;
}
var x_1zf = (kerio.waw.shared.x_3r.x_1zl.x_os === x_1o);
x_1c.x_16.x_1zf = x_1zf;
x_1c.x_2k(x_9u.x_1zn, x_1zf);
x_1c.x_2k(x_9u.x_1zo, !x_1zf);
}}, { x_1j: 'x_1zp',
x_23: x_x('Active Directory® domain name:', 'userImportServer'),
x_93: 127,
x_5p: true, x_ge: true,
x_b6: {
x_b7: false
}
}, { x_a6: 'hostName',
x_1j:   'x_19e',
x_23: x_x('Import from server:', 'userImportServer'),
x_93: 127,
x_ge: true,
x_b6: {
x_b7: false
} }, { x_a6: 'userName',
x_1j:   'x_cx',
x_23: x_x('Username:', 'common'),
x_93: 127,
x_ge: true,
x_b6: {
x_b7: false
} }, { x_23: x_x('Password:', 'common'),
x_a6: 'password',
x_1j:   'x_ns',
x_1jz: true,
x_93: 24,
x_ge: true
}, { x_1j: 'x_1zq',
x_23: x_x('Windows NT® domain name:', 'userImportServer'),
x_93: 127,
x_ge: true,
x_1m: true,
x_b6: {
x_b7: false
}
}, { x_1f: 'x_1q',
x_1j: 'x_1zr',
x_1s: x_x('Secure connection (LDAPS)', 'userImportServer'),
x_23: '',
x_7d: true
} ]
} ]
};x_1c = new x_1b.x_1t(x_2w + 'x_1c', x_1d);
x_10 = {
x_1u: 500,
x_l0: 500,
x_1v: 250,
x_l1: 250,
x_1w: true,
x_1y: x_x('Import User Accounts', 'userImportServer'),
x_1x: x_1c,
x_1z: [
{
x_20: true,
x_1j: 'x_1y1',
x_23: x_x('OK', 'common'),

x_25: function(x_32) {
x_32.x_16.x_iy.call(x_32.x_16);
} },
{
x_21: true,
x_1j: 'x_1y2',
x_23: x_x('Cancel', 'common')
}
]
};
x_16 = new x_1b.x_26(this.x_ga, x_10);
x_16.x_1c = x_1c;
x_1c.x_16 = x_16;
x_1zm = x_1c.x_29('x_vh');
x_1zm.x_1zn = ['x_1zp', 'x_19e', 'x_cx', 'x_ns'];
x_1zm.x_1zo = ['x_1zq'];
x_1c.x_1zs           = x_1c.x_29('x_1zp');
x_1c.x_1zt               = x_1c.x_29('x_19e');
x_1c.x_1zu               = x_1c.x_29('x_cx');
x_1c.x_1zv               = x_1c.x_29('x_ns');
x_1c.x_1zw = x_1c.x_29('x_1zr');
x_1c.x_1zx        = x_1c.x_29('x_1zq');
this.x_2a(x_16);
x_16.x_j4 = {
x_6a: '/admin/stub/dataMiner.php',
x_6p: 'post',
x_28: {
object: 'UserManager'
},
x_2q: x_16,
x_2e: x_16.x_jk
};
return x_16;
},
x_2a: function(x_2b) {

x_2b.x_jo = function() {
this.x_1c.x_2h();
kerio.waw.shared.x_3e.x_3j(this);
}; 
x_2b.x_2c = function(x_28) {
var x_fi = kerio.waw.shared.x_3e;
this.x_7w = x_28.x_7w;
x_fi.x_3f(this, {
x_1n: kerio.lib.x_x('Testing connection to the primary domain…', 'userImportServer')
});
x_fi.x_db({
x_da: [	{
'object': 'DomainManager',
'method': 'get',
'params': {
query: {
start: 0,
limit: 1,
conditions: [{ firstOperand: {
'operandValue': true,
'isColumnName': false
},
comparator: kerio.waw.shared.x_3r.x_3s.x_8i,
secondOperand: {
'operandValue': 'primary',
'isColumnName': true
}
}] } } }, {
'object': 'AuthenticationManager',
'method': 'getJoinStatus'
}
], x_2e: this.x_1zy,
x_2q: this
}); }; 
x_2b.x_1zy = function(x_6v) {
var
x_x = kerio.lib.x_x,
x_s5 = kerio.waw.shared.x_3r.x_s9,
x_1c = this.x_1c,
x_op,
x_1zz,
x_200;
if (!x_6v.x_6x) {
kerio.lib.x_nq('Error in communication with server', 'userImportServer', 'x_1zy');
return;
}
x_op = x_6v.x_ac.batchResult[0];
x_op = x_op.domainList ? x_op.domainList[0] : {};
x_1zz = x_6v.x_ac.batchResult[1];
x_1zz = x_1zz ? x_1zz.status : x_s5.x_sc;
if (x_s5.x_sa === x_1zz) {
x_1c.x_7k({
x_1zp: x_op.name,
x_1zq: x_op.primaryDetails.ntAuthenticationDomain.value
});
this.x_1zh = x_op;
if (!x_op.primaryDetails.enabled) {
this.x_201(x_op.name);
return; }
}
else { x_200 = (x_s5.x_sb === x_1zz)
? x_x('Kerio WinRoute Firewall is not member of any domain.', 'userImportServer')
: x_x('There is a problem with connection to domain %1.', 'userImportServer', {x_49: [x_op.name]});
kerio.lib.x_48(
x_x('User Import', 'userImportServer'),
x_x('You cannot import users: %1', 'userImportServer', {x_49: [x_200]})
);
this.x_2r(); }
kerio.waw.shared.x_3e.x_3j(this);
x_1c.x_29('x_19e').x_1d3(); }; 
x_2b.x_201 = function(x_f3) {
var x_x = kerio.lib.x_x;
kerio.lib.x_4b(
x_x('User Import', 'userImportServer'),
x_x('Kerio WinRoute Firewall is not configured to authenticate users from your primary domain. It can be automatically configured based on values you use for user import.', 'userImportServer', {x_49: [x_f3]})
+ '<br><br><b>'
+ x_x('Do you want to continue with user import and automatic domain configuration?', 'userImportServer')
+ '</b>',
this.x_202,
this,
'yes'
);
}; 
x_2b.x_202 = function(x_sm) {
if ('yes' === x_sm) {
this.x_1zg  = true; kerio.waw.shared.x_3e.x_3j(this); }
else {
this.x_2r();
}
}; 
x_2b.x_iy = function() {
var
x_fi = kerio.waw.shared.x_3e,
x_1c = this.x_1c,
x_j4 = this.x_j4,
x_66 = x_j4.x_28,
x_7h = x_1c.x_7i(),
x_47 = {},
x_1zh = this.x_1zh,
x_203 = (false !== this.x_1zf); x_fi.x_3f(this, {
x_1n: kerio.lib.x_x('Importing users from domain %1…', 'userImportServer', {
x_49: [x_7h.x_1zp || x_7h.x_1zq] }) }); if (x_203) {
x_66.method = 'getAdUsers';
x_47.domainName  = x_7h.x_1zp;
x_47.server      = x_7h.x_19e;
x_47.credentials = {
userName: x_7h.x_cx,
password: x_7h.x_ns,
passwordChanged: true
};
}
else { x_66.method = 'getNtUsers';
x_47.domainName = x_7h.x_1zq;
}
this.x_66 = x_47;
x_fi.x_iq({
name: x_7h.x_1zp,
specificServer: {
enabled: x_203,
value: x_7h.x_19e
},
primaryDetails: {
ntAuthMode: !x_203,
ntAuthDomain: {
enabled: !x_203,
value: x_7h.x_1zq
},
enabled: true,
authenticationOnly: this.x_1zg || false
},
credentials: {
userName: x_7h.x_cx,
password: x_7h.x_ns,
passwordChanged: true
},
ldapSecure: x_7h.x_1zr
}, x_1zh); x_66.params = kerio.lib.x_6r(x_47); kerio.lib.x_6t.x_6u(x_j4);
};
x_2b.x_jk = function(x_6v) {
if (!x_6v.x_6x) {
this.x_2r(); return;
}
var
x_204 = x_6v.x_ac.users,
x_x;
if (!x_204 || (0 === x_204.length)) {
x_x = kerio.lib.x_x;
kerio.lib.x_48(
x_x('User Import', 'userImportServer'),
x_x('No user accounts can be imported from the server specified.', 'userImportServer')
); this.x_2r(); return;
}
kerio.lib.x_5l.x_5m({
x_5g: 'userImportList',
x_28: {
x_1zi:          this,
x_66:           this.x_66,
x_43:                x_204,
x_1zf: (false !== this.x_1zf), x_7w:              this.x_7w,
x_1zg:         this.x_1zg,
x_1zh:       this.x_1zh
}
});
};}}; 