
kerio.waw.ui.domainsAdvancedEditor = {

x_m: function(x_n) {
var
x_1b = kerio.lib,
x_x = x_1b.x_x,
x_r = kerio.waw.shared.x_3r,
x_o = (kerio.waw.status.x_p.x_q === x_r.x_s.x_t),
x_or = {x_os: false, x_ot: true},
x_ou = (x_r.x_3s.x_3t === x_r.x_3s.x_3u),
x_2w,
x_ov,
x_ow,
x_ox,
x_oy,
x_oz,
x_p0,
x_p1,
x_p2,
x_p3,
x_p4,
x_p5,
x_p6,
x_10,
x_16;
this.x_ga = x_n;
x_2w = this.x_ga + '_';
x_ov = {
x_5p: x_o,
x_1e: [
{	x_1f: 'x_79',
x_23: x_x('Method of domain cooperation', 'domainsAdvancedEditor'),
x_1e: [
{	x_1f: 'x_7a',
x_7b: 'x_p7',
x_1l: true,
x_1s: x_x('Map users from Active Directory® and authenticate users in local database', 'domainsAdvancedEditor'),
x_1o: x_or.x_os,
x_7d: true,

x_9t: function(x_1c, x_ax, x_1o) {
x_1c.x_84(['x_p8'], !x_1o);
}},
{	x_1f: 'x_7a',
x_7b: 'x_p7',
x_1l: true,
x_1s: x_x('Only authenticate users in local database against Active Directory®', 'domainsAdvancedEditor'),
x_1o: x_or.x_ot
},
{	x_1f: 'x_1g',
x_1j: 'x_p8',
x_b2: 1,
x_1l: true,
x_31: true,
x_1e: [
{	x_1f: 'x_1q',
x_1j: 'x_p9',
x_1m: x_ou,
x_1s: x_x('Enable pre-Windows 2000 authentication compatibility', 'domainsAdvancedEditor')
},
{	x_1f: 'x_1q',
x_1j: 'x_pa',
x_1s: x_x('Enable automatic import', 'domainsAdvancedEditor')
}
]}]},kerio.waw.shared.x_az.x_b0('x_o2', {

x_o3: function(x_1c) {
var
x_fi = kerio.waw.shared.x_3e,
x_16 = x_1c.x_16,
x_pb = x_16.x_pb,
x_7h = x_1c.x_7i(true),
x_x = kerio.lib.x_x,
x_om,
x_pc;
if (!x_1c.x_o4()) {
return; }
x_fi.x_3f(x_16, { x_1n: kerio.lib.x_x('Testing connection to the primary domain…', 'domainsAdvancedEditor') });
x_om = x_pb.x_pd();
if (!x_om || '' === x_om.credentials.userName) { kerio.lib.x_48(
x_x('Validation Warning', 'common'),
x_x('Correct credentials are required for connection test.', 'domainsAdvancedEditor')
);
x_fi.x_3j(x_16);
return;
}
x_om = kerio.lib.x_9m(x_om); x_om.primaryDetails.authenticationOnly = x_7h.x_p7;
x_om.primaryDetails.ntAuthMode = x_7h.x_p9;
x_om.primaryDetails.adAutoImport = x_7h.x_pa;
x_om.specificServer = {
enabled: x_7h.x_nt,
value: x_7h.x_nu
};
x_om.ldapSecure = x_7h.x_oe;
x_pc = x_fi.x_4y('DomainManager',
'testConnection',
{ domain: x_om },
x_16.x_o8,
x_16);
if (this.x_pe) {
this.x_pe.push(x_pc);   }
} }) ]};x_ow = new x_1b.x_1t(x_2w + 'x_pf', x_ov);

x_ox = function(x_1o) {
var x_gc = '';
if (x_1o.enabled) {
x_gc = x_1o.value;
}
return {
x_47: x_gc
};
};
x_oy = function(x_1o, x_47) {
var
x_cy = 'statusDomainJoin',
x_pg = this.x_ph[x_47.name],
x_pi;
if (x_pg) {
if (this.x_pj === x_pg.x_1o) {
x_pi = this.x_pk;
}
else {
x_pi = this.x_pl + ' (' + x_pg.x_1n + ')';
x_cy += ' domainJoinError';
}
}
else {
x_pi = this.x_pm;
x_cy += ' domainJoinTesting';
}
return {
x_cy: x_cy,
x_pi: x_pi,
x_47: ''
};
};
x_oz = function(x_1o) {
if (true === x_1o) {
return {
x_47: kerio.lib.x_x('Yes', 'common')
};
}
return {
x_47: kerio.lib.x_x('No', 'common')
};
};x_p0 = {
x_o: x_o,
x_5q: false,
x_5x: {
x_1e: [
{x_7s: 'name',             x_23:    x_x('Name', 'common')                       , x_1u: 150,
x_7u:   kerio.waw.shared.x_3e.x_8q.x_pn},
{x_7s: 'description',      x_23:    x_x('Description', 'common')                , x_1u: 200},
{x_7s: 'specificServer',   x_23:    x_x('Controller', 'domainsAdvancedEditor')  , x_1u: 130   , x_7u: x_ox  , x_cs: false},
{x_7s: 'ldapSecure',
x_23:    x_x('Encrypted Connection', 'domainsAdvancedEditor'),
x_1u: 150, x_7u: x_oz  , x_cs: false, x_1m: true},
{x_7s: 'domainStatus',     x_23:    x_x('Status', 'domainsAdvancedEditor')                       , x_7u: x_oy      , x_cs: false},
{x_7s: 'id'                       , x_7t: true},
{x_7s: 'primary'                  , x_7t: true},
{x_7s: 'primaryDetails'           , x_7t: true},
{x_7s: 'credentials'              , x_7t: true},
{x_7s: 'templateData'             , x_7t: true},
{x_7s: 'status'                   , x_7t: true}
]
}, x_6h: {
x_5g: 'domainsAdDomainEditor',
x_n: {
x_55: 'x_po',
x_57: 'x_nn',
x_54: 'x_pp'
}
},

x_fe: function (x_3l, x_40) {
var
x_pq = kerio.waw.shared.x_3r.x_mp.x_ms,
x_pr = x_3l.x_pr,
x_3v = x_3l.x_3v,
x_ps = x_3v.x_40,
x_47,
x_41, x_42;
for (x_41 = 0, x_42 = x_3v.x_46; x_41 < x_42; x_41++) {
x_47 = x_ps[x_41].x_47;
if (x_pq !== x_47.status) {
x_pr.push(x_47.id);
}
delete x_3l.x_ph[x_47.name];
}
x_3l.x_70();
},x_5z: [],

x_2d: function() {
kerio.waw.shared.x_3e.x_3j();
} };
if (x_o) {
x_p0.x_5v = {
x_5w: {
x_1f: 'x_cr'
}
};
}
x_p1 = new kerio.adm.x_17.x_3c(x_2w + 'x_p1', x_p0);
x_p2 = {
x_1e: [
{	x_1f: 'x_pt',
x_1j: 'x_pu',
x_1l: true,
x_pv: x_x('Your primary domain is %1', 'domainsAdvancedEditor', {x_49: ['{x_op}']})
},
{
x_1f: 'x_1i',
x_1l: true,
x_1o: x_x('Here you may define additional AD domains to map user accounts from:', 'domainsAdvancedEditor')
},
{
x_1f: 'x_1g',
x_1x: x_p1
}
]
};
x_p3 = new x_1b.x_1t(x_2w + 'x_p3', x_p2);
x_p4 = {
x_1e: [
{
x_1x: x_ow,
x_23: x_x('Settings', 'domainsAdvancedEditor'),
x_1j: 'x_pw'
},
{
x_1x: x_p3,
x_23: x_x('Additional Mapping', 'domainsAdvancedEditor'),
x_1j: 'x_px'
}
]
};
x_p5 = new x_1b.x_py(x_2w + 'x_pz', x_p4);
x_10 = {
x_1u: 655,
x_1v: 430,
x_1y: x_x('Advanced Settings', 'domainsAdvancedEditor'),
x_1x: x_p5,

x_mc: function(x_32) {
this.x_16.x_oa();
} };x_10 = new kerio.waw.shared.x_az.x_md(x_10);
x_16 = new x_1b.x_26(this.x_ga, x_10);
x_p6 = kerio.waw.shared.x_3e.x_q0(x_p4.x_1e, 'x_1x', 'x_q1');
x_16.x_p6 = new kerio.lib.x_q2(x_2w + 'x_q3', x_p6);
x_16.x_q4 = kerio.waw.shared.x_3e.x_q0(x_p4.x_1e, 'x_1j', 'string');
if (x_o) {
x_16.x_p6.x_7f();
}
x_16.x_27(
{	x_ow: x_ow,
x_p3:  x_p3,
x_p1:  x_p1,
x_p5: x_p5,
x_pu: x_p3.x_29('x_pu'),
x_ou: x_ou,
x_o5: {},
x_pb: {},
x_pe: []    }
);
x_ow.x_27(
{	x_16: x_16,
x_o: x_o,
x_q5: x_ow.x_29(['x_nu']),
x_q6: x_ow.x_29(['x_q6'])
}
);
x_p1.x_27({
x_16: x_16,
x_pj: 0,
x_q7: 1,
x_q8: 2,
x_pk: kerio.lib.x_x('Domain controller is accessible.', 'domainsAdvancedEditor'),
x_pl:   kerio.lib.x_x('Connection to domain controller has failed.', 'domainsAdvancedEditor'),
x_pm: kerio.lib.x_x('Trying to connect to the domain controller…', 'domainsAdvancedEditor'),
x_ph: []
});
this.x_2a(x_16);
return x_16;
},
x_2a: function(x_2b) {

x_2b.x_2c = function(x_28) {
var
x_47 = x_28.x_47,
x_q9 = x_47.x_op,
x_qa = x_47.x_qa,
x_qb = x_q9.primaryDetails,
x_ow = this.x_ow,
x_p1 = this.x_p1,
x_7h;
x_7h = {
x_p7: x_qb.authenticationOnly,
x_p9: x_qb.ntAuthMode,
x_pa: x_qb.adAutoImport,
x_nt: x_q9.specificServer.enabled,
x_nu: x_q9.specificServer.value,
x_oe: x_q9.ldapSecure
};
this.x_pu.x_2i(
{x_op: '<b>' + kerio.lib.x_qc(x_q9.name) + '</b>'}
);
x_ow.x_7k(x_7h);
x_p1.x_7k(x_qa);
x_p1.x_pr = [];
x_p1.x_dy();this.x_pe = [];   this.x_oj();
this.x_o5 = x_28.x_9d.x_o5;
this.x_pb = x_28.x_9d;
}; 
x_2b.x_oa = function() {
var
x_o5 = this.x_o5,
x_qb = x_o5.x_op.primaryDetails,
x_7h;
x_7h = this.x_ow.x_7i(true);
x_qb.authenticationOnly = x_7h.x_p7;
x_qb.ntAuthMode = (this.x_ou ? false : x_7h.x_p9);
x_qb.adAutoImport = x_7h.x_pa;
x_o5.x_op.specificServer = {
enabled: x_7h.x_nt,
value: x_7h.x_nu
};
x_o5.x_op.ldapSecure = x_7h.x_oe;
x_o5.x_qa = this.x_p1.x_7i();
x_o5.x_pr = this.x_p1.x_pr;
this.x_pb.x_qd(x_o5.x_op); kerio.waw.status.x_14.x_15(true);
this.x_2r();
}; 
x_2b.x_jo = function() {
var
x_pe = this.x_pe,
x_qe = kerio.lib.x_6t.x_qf,
x_41, x_42;
for (x_41 = 0, x_42 = x_pe.length; x_41 < x_42; x_41++) {
x_qe(x_pe[x_41]);
}
if (this.x_qg) {
delete this.x_qg;
}
this.x_ow.x_2h();
this.x_p5.x_lf('x_pw');
kerio.waw.shared.x_3e.x_3j(this);
};
x_2b.x_oj = function(x_qa) {
if (undefined === x_qa) {
x_qa = this.x_p1.x_7i();
if (this.x_qg) {
kerio.lib.x_6t.x_qf(this.x_qg);
delete this.x_qg;
}
}
if (0 === x_qa.length) {
return;
}
var
x_da = [],
x_qh = [],
x_41, x_42,
x_a4;
for (x_41 = 0, x_42 = x_qa.length; x_41 < x_42; x_41++) {
x_a4 = x_qa[x_41];
x_da.push({object: 'DomainManager', method: 'testConnection', params: { domain: x_a4 }});
x_qh.push(x_a4.name);
}
this.x_qg = kerio.waw.shared.x_3e.x_db({
x_da: x_da,
x_2e: this.x_qi,
x_2s: {x_qh: x_qh},
x_2q: this,
x_qj: true,
x_qk: true
});
this.x_pe.push(this.x_qg);
}; 
x_2b.x_qi = function(x_6u, x_6w, x_28) {
var
x_p1 = this.x_p1,
x_ql = x_6u.x_ac.batchResult,
x_qh = x_28.x_qh,
x_ph = x_p1.x_ph,
x_1o,
x_1n,
x_41, x_42;
delete this.x_qg;
for (x_41 = 0, x_42 = x_ql.length; x_41 < x_42; x_41++) {
if (x_ql[x_41].returnValue) {
x_1o = x_p1.x_pj;
x_1n = '';
}
else {
x_1o = x_p1.x_q8;
x_1n = kerio.waw.shared.x_3e.x_qm(x_ql[x_41].result[0].errorMessage);
}
x_ph[x_qh[x_41]] = {
x_1o: x_1o,
x_1n: x_1n
};
}
if (x_p1.x_2o.rendered) {
x_p1.x_hg();
}
}; 
x_2b.x_o8 = function(x_28) {
var
x_qn = this.x_pb.x_pd(),
x_x = kerio.lib.x_x;
if (x_28.x_ac.returnValue) {
kerio.lib.x_48(
x_x('Test Connection', 'domainsAdvancedEditor'),
x_x('Test of connection to domain %1 finished successfuly.', 'domainsAdvancedEditor', {x_49: [x_qn.name]})
);
}
kerio.waw.shared.x_3e.x_3j(this);
}; } }; 