
kerio.waw.ui.domainsJoinEditor = {

x_m: function(x_n) {
var
x_2w = x_n + '_',
x_1b = kerio.lib,
x_x = x_1b.x_x,
x_sn = 'x_qo' === x_n,
x_so,
x_sp,
x_jb,
x_sq,
x_sr,
x_ss,
x_st,
x_su,
x_sv,
x_sw,
x_sx,
x_16,
x_10,
x_sy,
x_sz;
x_ss = {
x_1e: [
{ x_1f: 'x_79',
x_23: (x_sn)
? x_x('Domain account with rights to join the domain', 'domainsJoinEditor')
: x_x('Domain account with rights to remove this computer from the domain', 'domainsJoinEditor'),
x_1p: 'removeFieldsetMargin',
x_1e: [
kerio.waw.shared.x_az.x_b0('x_nz', {
x_1j: 'x_cx',
x_1u: 'auto',
x_b6: {
x_nv: 'x_o0'
}
}),kerio.waw.shared.x_az.x_b0('x_o1', {
x_1j: 'x_ns',
x_1u: 'auto'
})]
} ] }; x_sq = {
x_1e: [
{ 	x_1f: 'x_1i',
x_1j: 'x_t0',
x_1l: true,
x_1o: ''
}			]
};x_so = {	x_1j: 'x_ji',
x_21: true,
x_23: x_x('Cancel', 'common')
};x_sp = {	x_1j: 'x_jj',
x_21: true,
x_23: x_x('Close', 'common'),
x_1m: true,

x_25: function(x_32) {
x_32.x_16.x_2r();
x_32.x_16.x_9d.x_9d.x_qy();
}};
if (x_sn) {
x_jb = 300;
x_ss.x_1e.unshift({ x_1f: 'x_79',
x_23: x_x('Domain information', 'domainsJoinEditor'),
x_br: 200,
x_1e: [
{
x_1j: 'x_f3',
x_23: x_x('Active Directory® domain name:', 'domainsJoinEditor'),
x_1o: '',
x_93: 127,
x_ge: true,
x_b6: {
x_nv: 'x_nw',
x_b7: false
}
},{
x_1f: 'x_1i',
x_23: ' ', x_1o: x_x('e.g. example.com', 'domainsJoinEditor')
} ]
}); x_su = {
x_1e: [
{	x_1f: 'x_79',
x_23: x_x('Domain Controller IP Address', 'domainsJoinEditor'),
x_1e: [
{ 	x_1f: 'x_1i',
x_1l: true,
x_1o: x_x('WinRoute is unable to locate the domain controller for the specified domain. Please specify the IP address of the domain controller:', 'domainsJoinEditor')
},
{	x_23: x_x('IP address:', 'domainsJoinEditor'),
x_1j: 'x_t1',
x_1u: 120,
x_93: 15,
x_b6: {
x_b7: false,
x_nv: 'x_t2'
}
}
]
}
]
};x_sr = new x_1b.x_1t(x_2w + 'x_sr', x_ss);
x_st = new x_1b.x_1t(x_2w + 'x_st', x_su);
x_sv = new x_1b.x_1t(x_2w + 'x_sv', x_sq);
x_sx = {
x_t3: false,
x_1e: [
{
x_1x: x_sr,
x_1j: 'x_t4'
},
{
x_1x: x_st,
x_1j: 'x_t5'
},
{
x_1x: x_sv,
x_1j: 'x_t6'
}
]
};x_sz = {
x_t7: 0,
x_t8: 1,
x_t9: 2
};
x_sy = [
{ 	x_1j: 'x_ta',
x_23: x_x('< Back', 'common'),
x_1m: true,

x_25: function() {
var
x_16 = this.x_16,
x_tb = x_16.x_k4.x_tc(),
x_32 = x_16.x_32;
x_32.x_jp('x_ji');
x_32.x_jq('x_ta');
if (x_16.x_sz.x_t9 === x_tb) {
x_32.x_jq('x_jj');
x_32.x_jp('x_l4');
if (x_16.x_td) {
x_16.x_k4.x_lf('x_t5');
x_32.x_jp('x_ta');
return;
}
}
x_16.x_k4.x_lf('x_t4');
}},
{ 	x_20: false,
x_1j: 'x_l4',
x_23: x_x('Next >', 'common'),

x_25: function() {
var
x_16 = this.x_16,
x_tb = x_16.x_k4.x_tc();
switch (x_tb) {
case x_16.x_sz.x_t7:
if (x_16.x_sr.x_o4()) {
x_16.x_te.call(x_16);
return;
}
break;
case x_16.x_sz.x_t8:
if (x_16.x_st.x_o4()) {
x_16.x_qo.call(x_16);
return;
}
break;
}}},
x_sp,
x_so
];} else {

x_sr = new x_1b.x_1t(x_2w + 'x_sr', x_ss);
x_st = new x_1b.x_1t(x_2w + 'x_st', x_sq);
x_sx = {
x_t3: false,
x_1e: [
{
x_1x: x_sr,
x_1j: 'x_t4'
},
{
x_1x: x_st,
x_1j: 'x_t5'
}
]
};x_sz = {
x_t7: 0,
x_t9: 1
};
x_jb = 180;
x_sy = [
{ 	x_20: false,
x_1j: 'x_l4',
x_23: x_x('Next >', 'common'),

x_25: function() {
if (this.x_16.x_sr.x_o4()) {
this.x_16.x_qw();
return;
}
}},
x_sp,
x_so
];}
x_sw = new x_1b.x_kz(x_2w + 'x_k4', x_sx);
x_10 = {
x_1u: 500,
x_l0: 500,
x_1v: x_jb,
x_l1: x_jb,
x_1w: true,
x_1x: x_sw,
x_o9: 'x_f3',
x_1y: (x_sn)
? x_x('Join Domain', 'domainsJoinEditor')
: x_x('Leave Domain', 'domainsJoinEditor'),
x_1z: x_sy
}; x_16 = new kerio.lib.x_26(x_n, x_10);
x_16.x_27({
x_sn: x_sn,
x_tf: x_sr.x_29('x_cx'),
x_k4: x_sw,
x_sr: x_sr,
x_st: x_st,
x_sv: x_sv,
x_td: false,
x_9d: {},
x_sz: x_sz
});
this.x_2a(x_16);
return x_16;
},
x_2a: function(x_2b) {

x_2b.x_2c = function(x_28) {
this.x_9d = x_28.x_9d;
}; 
x_2b.x_te = function() {
var
x_47 = this.x_sr.x_7i();
this.x_ly(kerio.lib.x_x('Connecting to the domain…', 'domainsJoinEditor'));
kerio.waw.shared.x_3e.x_4y('AuthenticationManager',
'isJoinServerNeeded',
{domainName: x_47.x_f3},
this.x_tg,
this
);
};
x_2b.x_tg = function(x_6v) {
var
x_ac = x_6v.x_ac,
x_32 = this.x_32;
if (!x_ac.returnValue) {
return;
}
if (x_ac.needServer) {
this.x_k4.x_lf('x_t5');
x_32.x_3b('x_l4');
x_32.x_jp('x_ta');
kerio.waw.shared.x_3e.x_3j(this);
} else {
this.x_qo();
}
this.x_td = x_ac.needServer;
};
x_2b.x_qo = function() {
var
x_tb = this.x_k4.x_tc(),
x_th = this.x_sr.x_7i(),
x_ti = {	domainName: x_th.x_f3,
credentials: {
userName: x_th.x_cx,
password: x_th.x_ns,
isPasswordChanged: true
}
};
this.x_ly(kerio.lib.x_x('Connecting to the domain…', 'domainsJoinEditor'));
if (this.x_sz.x_t8 === x_tb) {
x_ti.server = this.x_st.x_29('x_t1').x_2t();
} else {
x_ti.server = null;
}
kerio.lib.x_6t.x_6u({
x_28: {
object: 'AuthenticationManager',
method: 'join',
params: kerio.lib.x_6r(x_ti)
},
x_2e: this.x_tj,
x_2q: this,
x_ma: true
});
};
x_2b.x_tj = function(x_6v) {
var
x_tk = this.x_sv.x_29('x_t0'),
x_32 = this.x_32,
x_1n;
x_32.x_jq('x_ta');
x_32.x_jq('x_l4');
x_32.x_jq('x_jj');
x_32.x_jq('x_ji');
if (x_6v.x_6x) {
x_32.x_jp('x_jj');
x_1n = '<b>' + kerio.lib.x_qc(x_6v.x_ac.result[0].errorMessage.positionalParameters[0]) + '</b>';
x_tk.x_2i(
kerio.lib.x_x('Success. The firewall is a member of the %1 domain now.',
'domainsJoinEditor',
{x_49: [x_1n], x_ke: true})
);
} else {
x_32.x_jp('x_ji');
x_32.x_jp('x_ta');
x_tk.x_9w(
kerio.waw.shared.x_3e.x_qm(x_6v.x_ac.result[0].errorMessage)
);
}
kerio.waw.shared.x_3e.x_3j(this);
this.x_k4.x_lf('x_t6');
};
x_2b.x_qw = function() {
var
x_th = this.x_sr.x_7i(),
x_tl = {credentials: {
userName: x_th.x_cx,
password: x_th.x_ns,
isPasswordChanged: true
}
};
this.x_ly(kerio.lib.x_x('Disconnecting from the domain…', 'domainsJoinEditor'));
kerio.lib.x_6t.x_6u({
x_28: {
object: 'AuthenticationManager',
method: 'leave',
params: kerio.lib.x_6r(x_tl)
},
x_2e: this.x_tm,
x_2q: this,
x_ma: true
});
};
x_2b.x_tm = function(x_6v) {
var
x_tk = this.x_st.x_29('x_t0'),
x_32 = this.x_32,
x_tn,
x_1n;
x_32.x_jq('x_l4');
x_32.x_jq('x_ji');
x_32.x_jp('x_jj');
x_1n = kerio.lib.x_qc(x_6v.x_ac.result[0].errorMessage.positionalParameters[0]);
if (x_6v.x_6x) {
x_tk.x_2i(
kerio.lib.x_x(	'Success. The firewall is not member of any domain now.',
'domainsJoinEditor',
{x_49: [x_1n], x_ke: true})
);
} else {
x_1n = '<b>' + x_1n + '</b>';
x_tk.x_2i(
kerio.lib.x_x(	'Success. But note the fact that the firewall has been disconnected only locally due to the following error: %1',
'domainsJoinEditor',
{x_49: [x_1n], x_ke: true})
);
}
kerio.waw.shared.x_3e.x_3j(this);
this.x_k4.x_lf('x_t5');
};
x_2b.x_jo = function() {
var
x_32 = this.x_32;
this.x_sr.x_2h();
this.x_k4.x_2h();
x_32.x_jq('x_jj');
x_32.x_jp('x_l4');
x_32.x_jp('x_ji');
if (this.x_sn) {
x_32.x_jq('x_ta');
this.x_st.x_2h();
this.x_sv.x_2h();
this.x_td = false;
}
};}};