

kerio.waw.ui.domainsAuthenticationList = {

x_m: function(x_n) {
var
x_2w = x_n + '_',
x_1b = kerio.lib,
x_x = x_1b.x_x,
x_r = kerio.waw.shared.x_3r,
x_3q = (x_r.x_3s.x_3t === x_r.x_3s.x_3u),
x_o,
x_qo,
x_32, x_4u,
x_qp, x_qq,
x_qr, x_qs,
x_p5, x_p4, x_qt,
x_p6,
x_q3;

x_qo = function(x_1c) {
if (kerio.waw.status.x_14.x_qu()) {
kerio.lib.x_48(
kerio.lib.x_x('Notice', 'common'), kerio.lib.x_x('You have changed data. Please click on the Apply button to save the changes first.', 'domainsAuthentcationList'));
kerio.waw.shared.x_3e.x_3j();
return;
}
kerio.lib.x_5l.x_5m(
{
x_5g: 'domainsJoinEditor',
x_n: (x_1c.x_qv)
? 'x_qw'
: 'x_qo',
x_28: {
x_9d: x_1c
}
}
); };x_o = (kerio.waw.status.x_p.x_q === x_r.x_s.x_t);

x_4u = {

x_33: function(x_32, x_4x) {
var x_p5 = x_32.x_3m;
if (x_p5.x_o4()) {
x_p5.x_qx(x_4x);
return true;
}
else {
kerio.waw.shared.x_3e.x_3j();
return false;
}
}, 
x_35: function(x_32, x_4x) {
kerio.waw.shared.x_3e.x_3f();
x_32.x_3m.x_qy(x_4x);
} }; if (!x_o) {
x_32 = new kerio.waw.shared.x_17.x_2u(x_2w + 'x_32', x_4u);
}

x_qq = {
x_9t: kerio.waw.status.x_14.x_15,
x_1e: [
{
x_1f: 'x_79',
x_23: x_x('Web Authentication', 'domainsAuthenticationList'),
x_1l: true,
x_1e: [
{
x_1j: 'x_qz',
x_1f: 'x_1q',
x_1s: x_x('Always require users to be authenticated when acccesing web pages', 'domainsAuthenticationList')
}, {
x_1j: 'x_r0',
x_1f: 'x_1q',
x_1s: x_x('Force non-transparent proxy server authentication', 'domainsAuthenticationList'),

x_9t: function(x_1c, x_ax, x_7d) {
x_1c.x_84(['x_r1'], !x_7d);
x_1c.x_84(['x_r2'], !x_7d || !x_1c.x_29('x_r3').x_7d());
} }, {
x_1j: 'x_r4',
x_1f: 'x_1i',
x_b2: 1,
x_1o: x_x('Each browser session will require user authentication. This is useful in Citrix or Terminal Service enviroments, where multiple users authenticate to the firewall from the same computer.', 'domainsAuthenticationList')
}, {
x_1f: 'x_5x',
x_b2: 1,
x_1j: 'x_r1',
x_31: true,
x_1e: [
{
x_1j: 'x_r3',
x_1f: 'x_1q',
x_1l: true,
x_1s: x_x('Apply only to these IP addresses:', 'domainsAuthenticationList'),

x_9t: function(x_1c, x_ax, x_7d) {
if (!x_ax.x_31()) {
x_1c.x_84(['x_r2'], !x_7d);
}
} },{
x_1j: 'x_r2',
x_1f: 'x_9u',
x_1l: true,
x_5z: [], x_a7: 'x_1j',
x_a5: 'x_a6'
}]
},{
x_1j: 'x_r5',
x_1f: 'x_1q',
x_1s: x_x('Enable user authentication performed automatically by web browsers', 'domainsAuthenticationList')
}]
}, {
x_1f: 'x_79',
x_23: x_x('Automatic Logout', 'domainsAuthenticationList'),
x_1l: true,
x_1e: [
{
x_1j: 'x_r6',
x_1f: 'x_1q',
x_1s: x_x('Automatically logout users if they are inactive', 'domainsAuthenticationList'),

x_9t: function(x_1c, x_ax, x_7d) {
x_1c.x_84(['x_r7'], !x_7d);
} },{
x_1j: 'x_r7',
x_1f: 'x_5x',
x_b2: 1,
x_31: true,
x_1e: [
{
x_1f: 'x_1i',
x_1o: x_x('Timeout:', 'domainsAuthenticationList')
}, {
x_1f: 'x_b4',
x_1j: 'x_r8',
x_1o: 120,
x_r9: 1,
x_b5: 9999,
x_93: 4,
x_1l: true,
x_1u: 50,
x_b6: {
x_b7: false
}
},{
x_1f: 'x_1i',
x_1o: x_x('minute(s)', 'domainsAuthenticationList')
}]
}]
} ] }; 
x_qs = {
x_1e: [
{
x_1f: 'x_79',
x_23: x_x('Domain membership', 'domainsAuthenticationList'),
x_1e: [
{	x_1f: 'x_b3',
x_1e: [
{	x_1f: 'x_pt',
x_1j: 'x_ra',
x_1l: true,
x_pv: '&nbsp; &nbsp; &nbsp; {x_ln}',
x_rb: {
x_ln: x_x('Not a member of any domain', 'domainsAuthenticationList')
},
x_1p: 'statusDomainJoin domainJoinDisconnected'
},
'->',
{ x_1f: 'x_rc',
x_1j: 'x_rd',
x_23: x_x('Join Domain…', 'domainsAuthenticationList'),
x_1m: !x_3q,
x_5p: x_o,
x_25: (x_3q) ? x_qo : kerio.waw.shared.x_3e.x_gu },
{
x_1f: 'x_rc',
x_1j: 'x_re',
x_23: x_x('Leave Domain…', 'domainsAuthenticationList'),
x_1m: true,
x_5p: x_o,
x_25: (x_3q) ? x_qo : kerio.waw.shared.x_3e.x_gu }
]
}]
},
{
x_1f: 'x_79',
x_1j: 'x_rf',
x_23: x_x('Domain integration', 'domainsAuthenticationList'),
x_1e: [
{
x_1f: 'x_1q',
x_1j: 'x_rg',
x_1l: true,
x_1s: x_x('Use domain user database', 'domainsAuthenticationList'),

x_9t: function(x_1c) {
x_1c.x_rh.apply(x_1c, arguments);
} },
{
x_1f: 'x_1g',
x_1j:   'x_ri',
x_31: true,
x_b2: 1,
x_1e: [
{
x_1f: 'x_1i',
x_1l: true,
x_1o: x_x('Account with right to read user database:', 'domainsAuthenticationList')
},
kerio.waw.shared.x_az.x_b0('x_nz', {
x_1j: 'x_cx',
x_b6: {
x_nv: 'x_o0'
},

x_9t: function(x_1c, x_ax, x_1o) {
x_1c.x_84(['x_rj'], !x_ax.x_o4());
kerio.waw.status.x_14.x_15(true);
} }), kerio.waw.shared.x_az.x_b0('x_o1', {
x_1j: 'x_ns',

x_9t: function(x_1c, x_ax, x_1o) {
var x_rk = kerio.waw.shared.x_az.x_b0('x_o1').x_9t;
x_rk.apply(this, arguments); kerio.waw.status.x_14.x_15(true); } }), {
x_1f: 'x_b3',
x_1e: [
{
x_1f: 'x_rc',
x_1j:   'x_rj',
x_31: true,
x_23: x_x('Test Connection', 'domainsAuthenticationList'),
x_24: {
x_1n: x_x('Testing connection to the primary domain…', 'domainsAuthenticationList')
},

x_25: function(x_1c) {
x_1c.x_o3();
} },
{
x_1f: 'x_1i',
x_1j: 'x_rl',
x_1l: true,
x_1m: true, x_1o: x_x('Note: Domain user database is used only for authentication of users from local user database.', 'domainsAuthenticationList')
},
'->',
{
x_1f: 'x_rc',
x_1j:   'x_rm',
x_23: x_x('Advanced…', 'domainsAuthenticationList'),
x_24: false,

x_25: function(x_1c) {
kerio.lib.x_5l.x_5m(
{
x_5g: 'domainsAdvancedEditor',
x_28: {
x_9d: x_1c,
x_47:   x_1c.x_o5
}
}
); } } ] }
] }
] }
] }; x_qp = new x_1b.x_1t(x_2w + 'x_qp', x_qq);
x_qr = new x_1b.x_1t(x_2w + 'x_qr', x_qs);
x_p4 = {
x_1p: 'mainList',
x_1e: [
{
x_23: x_x('Authentication Options', 'domainsAuthenticationList'),
x_1x: x_qp
},
{
x_23: x_x('Active Directory®', 'domainsAuthenticationList'),
x_1x: x_qr
}
] }; if (!x_o) {
x_p4.x_5v = {
x_5w: x_32
};
}
x_p5 = new x_1b.x_py(x_n, x_p4);
x_qt = x_p5.x_2o;

x_qt.on('beforetabchange', function( x_rn, x_ro, x_rp) {
x_rn.x_rq = true;
}, x_qt);

x_qt.on('tabchange', function( x_rn, x_ro) {
x_rn.x_rq = false;
}, x_qt);
if (!x_o) {
x_p5.x_32 = x_32;
}
x_p5.x_p6 = {
x_qp: x_qp,
x_qr: x_qr
};
x_p6 = [x_qp, x_qr];
x_q3 = new kerio.lib.x_q2(x_2w + 'x_q3', x_p6);
x_p5.x_27({
x_o: x_o,
x_q3: x_q3
});
x_qr.x_27({
x_3q: x_3q
});
this.x_2a(x_p5);
kerio.waw.shared.x_3e.x_rr(x_p5);
if (x_o) {
x_qp.x_7f();
x_qr.x_85([ 'x_rg',
'x_cx',
'x_ns'
]);
}
return x_p5;
}, 
x_2a: function(x_2b) {

x_2b.x_2c = function() {
kerio.waw.shared.x_3e.x_3f();
this.x_lf(0);
kerio.waw.status.x_14.x_ia(this.x_o ? undefined : this.x_32);
this.x_qy();
}; 

var x_p6 = x_2b.x_p6;
for (var x_41 in x_p6) {
x_p6[x_41].x_27({x_9d: x_2b });
}

x_p6.x_qp.x_rs = function(x_rt) {
var x_ru, x_rv;
if (false === x_rt) {
return []; }
x_rv = {
x_ic: 'x_id',
x_9u: this.x_29('x_r2'),
x_1c: this
};
x_ru = new kerio.waw.shared.x_3e.x_ib(x_rv);
this.x_ru = x_ru; return [
{
x_rw: 'AuthenticationManager',
x_6p: 'get',
x_rx: this.x_2c
},
{
x_rw: 'IpAddressGroupManager',
x_6p: 'getGroupList',
x_rx: x_ru.x_7k
}
];
}; 
x_p6.x_qp.x_ry = function() {
return [
{
x_rw: 'AuthenticationManager',
x_6p: 'set',
x_28: this.x_oa()
}
];
}; 
x_p6.x_qp.x_2c = function(x_28) {
var
x_2v = x_28.config,
x_rz = x_2v.httpProxyAuth,
x_s0 = x_rz.addressGroup,
x_s1 = x_2v.inactivityTimeout;
this.x_o5 = x_2v;
var x_47 = {
'x_qz': x_2v.authenticationRequired,
'x_r0': x_rz.enabled,
'x_r3': x_s0.enabled,
'x_r2': x_s0.name || '', 'x_r6': x_s1.enabled,
'x_r8': x_s1.value,
'x_r5': x_2v.ntlmEnabled
};
this.x_2h();
this.x_7k(x_47);
this.x_ru.x_gi({ x_1j: x_s0.id,
x_a6: x_s0.name
});
}; 
x_p6.x_qp.x_oa = function() {
var x_47 = this.x_7i(true);
if (this.x_ru.x_7c === x_47.x_r2) {
x_47.x_r2 = "";
x_47.x_r3 = false;
}
return {
config: {
authenticationRequired: x_47.x_qz,
httpProxyAuth: {
enabled: x_47.x_r0,
addressGroup: {
enabled: x_47.x_r3,
id: x_47.x_r2
}
},
inactivityTimeout: {
enabled: x_47.x_r6,
value: x_47.x_r8
},
ntlmEnabled: x_47.x_r5
}
};
}; 
x_p6.x_qr.x_rs = function(x_s2) {
return [
{
x_rw: 'DomainManager',
x_6p: 'reset'
},
{
x_rw: 'AuthenticationManager',
x_6p: 'getJoinStatus',
x_rx: (false !== x_s2 ? this.x_s3 : undefined) },
{
x_rw: 'DomainManager',
x_6p: 'get',
x_28: {
"query": {
"conditions": [{ "firstOperand": {
"operandValue": "local",
"isColumnName": false
},
"comparator": 1,
"secondOperand": {
"operandValue": "id",
"isColumnName": true
}
}],
"orderBy": [{
"columnName": "name",
"direction": 0
}],
"start": 0,
"limit": -1
}
},
x_rx: (false !== x_s2 ? this.x_2c : undefined) }
];
}; 
x_p6.x_qr.x_ry = function() {
var
x_pq = kerio.waw.shared.x_3r.x_mp.x_ms,
x_op = this.x_pd(),
x_qa = this.x_o5.x_qa,
x_pr = this.x_o5.x_pr,
x_s4 = [],
x_da,
x_a4,
x_41, x_42;
x_da = [{ x_rw: 'DomainManager',
x_6p: 'set',
x_28: {
domainIds: [x_op.id],
details: x_op
}
}];
if (x_pr && 0 < x_pr.length) {
x_da.push({
x_rw: 'DomainManager',
x_6p: 'remove',
x_28: {
domainIds: x_pr
}
});
}
for (x_41 = 0, x_42 = x_qa.length; x_41 < x_42; x_41++) {
x_a4 = x_qa[x_41];
if (x_pq === x_a4.status) {
x_s4.push(x_a4);
}
else {
x_da.push({
x_rw: 'DomainManager',
x_6p: 'set',
x_28: {
domainIds: [x_a4.id],
details: x_a4
}
});
}
}
if (0 < x_s4.length) {
x_da.push({
x_rw: 'DomainManager',
x_6p: 'create',
x_28: {
domains: x_s4
}
});
}
x_da.push({
x_rw: 'DomainManager',
x_6p: 'apply'
});
return x_da;
}; 
x_p6.x_qr.x_s3 = function(x_28) {
if (0 === x_28.result.length) {
kerio.lib.x_nq('No result status for domain.', 'domainsAuthenticationList', 'callbackGetJoinStatus');
return;
}
var
x_1p,
x_s5,
x_s6,
x_1n,
x_s7 = this.x_qv,
x_s8 = x_28.result;
x_s5 = kerio.waw.shared.x_3r.x_s9;
x_s6 = this.x_29('x_ra');
switch (x_28.status) {
case x_s5.x_sa:
x_1p = 'domainJoinConnected';
x_s7 = x_s8[0].errorMessage;
break;
case x_s5.x_sb:
x_1p = 'domainJoinDisconnected';
x_s7 = false;
break;
case x_s5.x_sc:
x_1p = 'domainJoinError';
x_s7 = false;
break;
}
if (this.x_3q) {
this.x_2k(['x_rd'], !x_s7);
this.x_2k(['x_re'], x_s7);
}
this.x_qv = x_s7;
x_1n = x_s8[0].errorMessage; x_1n.isSecure = false;
if (x_1n.positionalParameters[0]) {
x_1n.positionalParameters = ['<b>' + kerio.lib.x_qc(x_1n.positionalParameters[0]) + '</b>'];
x_1n.isSecure = true;
}
x_1n = kerio.waw.shared.x_3e.x_qm(x_s8[0].errorMessage);
x_s6.x_sd(['domainJoinConnected', 'domainJoinDisconnected', 'domainJoinError']);
x_s6.x_se(x_1p);
x_s6.x_2i({ x_ln: x_1n
});

}; 
x_p6.x_qr.x_2c = function(x_28) {
var
x_f2 = x_28.domainList,
x_qn = false, x_sf = -1,
x_a4,
x_41, x_42;
for (x_41 = 0, x_42 = x_f2.length; x_41 < x_42; x_41++) {
x_a4 = x_f2[x_41];
if (x_a4.primary) {
x_qn = x_a4;
x_sf = x_41;
break; }
}
if (-1 !== x_sf) {
x_f2.splice(x_sf, 1);
}
this.x_o5 = {
x_sg: (!x_qn || !x_qn.primaryDetails.enabled), x_op:     x_qn, x_qa: x_f2  };

this.x_sh = true; this.x_7k({
x_rg: x_qn.primaryDetails.enabled,
x_cx: x_qn.credentials.userName,
x_ns: ''
});
this.x_29('x_ns').x_og('NoPassword');
this.x_qd(x_qn);
delete this.x_sh;
}; 
x_p6.x_qr.x_pd = function() {
var
x_47 = this.x_7i(true),
x_qn = this.x_o5.x_op || {};
if (!this.x_o4(false)) { return null;
}
x_qn.credentials = {
userName: x_47.x_cx,
password: x_47.x_ns,
passwordChanged: this.x_o7()
}; x_qn.primaryDetails.enabled = x_47.x_rg;
return x_qn;
}; 
x_p6.x_qr.x_o7 = function() {
if (this.x_o5.x_sg) { return true;
}
return ('' === this.x_29('x_ns').x_ok()); }; 
x_p6.x_qr.x_rh = function(x_1c, x_1q, x_si) {
var
x_1b = kerio.lib,
x_x = x_1b.x_x,
x_1y,
x_sj,
x_sk;
if (x_si || x_1c.x_sh || (0 === x_1c.x_o5.x_qa.length)) {
x_1c.x_84(['x_ri'], !x_si);
kerio.waw.status.x_14.x_15(true);
return;
}
x_1c.x_7k({
x_rg: true });
x_1y =    x_x('Disable domain user database', 'domainsAuthenticationList');
x_sj =     x_x('Disabling domain user database will erase all your additionally mapped domains.', 'domainsAuthenticationList');
x_sk = x_x('Are you sure you want to disable domain user database?', 'domainsAuthenticationList');
x_1b.x_4b(
x_1y,
x_sj + '<br><br>' + '<b>' + x_sk + '</b>',
x_1c.x_sl,
x_1c
); }; 
x_p6.x_qr.x_sl = function(x_sm) {
if ('yes' === x_sm) {
this.x_sh = true; this.x_7k({
x_rg: false });
this.x_84(['x_ri'], true); kerio.waw.status.x_14.x_15(true);
delete this.x_sh;
} }; 
x_p6.x_qr.x_o3 = function() {
var x_47 = this.x_pd();
kerio.waw.shared.x_3e.x_4y('DomainManager', 'testConnection', { domain: x_47 }, this.x_o8, this);
}; 
x_p6.x_qr.x_o8 = function(x_28) {
var
x_qn = this.x_o5.x_op,
x_x = kerio.lib.x_x;
if (x_28.x_ac && x_28.x_ac.returnValue) {
kerio.lib.x_48(
x_x('Test Connection', 'domainsAuthenticationList'),
x_x('Test of connection to domain %1 finished successfuly.', 'domainsAuthenticationList', {x_49: [x_qn.name]})
);
}
kerio.waw.shared.x_3e.x_3j();
}; 
x_p6.x_qr.x_qd = function(x_om) {
var x_rl = x_om.primaryDetails.authenticationOnly;
this.x_84(['x_cx', 'x_ns'], x_rl);
this.x_2k(['x_rj'], !x_rl);
this.x_2k(['x_rl'], x_rl);
return x_rl;
};
} }; 