
kerio.waw.ui.interfaceVpnTunnelEditor = {
x_m: function(x_n) {
this.x_ga = x_n; var x_2w = this.x_ga + '_';
var x_1b = kerio.lib;
var x_x = x_1b.x_x;
var x_o = (kerio.waw.status.x_p.x_q === x_r.x_s.x_t);
var x_18c = ('interfaceVpnTunnelEdit' === x_n || x_o );
var x_18d = x_x('Select this if you can specify the hostname or IP address of the remote endpoint and the remote endpoint can accept incoming connections.', 'interfaceVpnTunnelEditor');
var x_18e = x_x('Select this if the remote endpoint uses a dynamic IP address or is unable to accept incoming connections.', 'interfaceVpnTunnelEditor');
var x_br = kerio.lib.x_a1(
{	x_a2: 300,
pl: 330,
pt: 330,
ru: 330,
zh: 150
});
var x_11u = {
x_1e: [
new x_fa.x_11k.x_11v(x_r.x_kh.x_15a, false), {
x_1f: 'x_79',
x_23: x_x('Configuration', 'interfaceVpnTunnelEditor'),
x_br: x_br,
x_1e: [
{
x_1f: 'x_1q',
x_1j: 'x_12i',
x_1l: true,
x_1s: x_x('Enabled', 'common'),

x_9t: function(x_1c, x_1q, x_7d) {
x_1c.x_84(x_1c.x_18f, !x_7d);
x_1c.x_84(x_1c.x_18g,
!x_7d || !x_1c.x_18h());
x_1c.x_16.x_p5.x_16z([1], !x_7d);
x_1c.x_29('x_1f').x_9w({
x_171: (x_7d ? '' : 'dead')
});
} },
{
x_1f: 'x_7a',
x_7b: 'x_18i',
x_1l: true,
x_b2: 1,
x_1s: '<span ext:qtip="' + x_18d + '">' + x_x('Active - it connects to the remote endpoint', 'interfaceVpnTunnelEditor')
+ '<span class="tooltip" ext:qtip="' + x_18d + '">&nbsp; &nbsp; &nbsp;</span></span>',
x_1o: true,

x_9t: function(x_1c, x_7a) {
x_1c.x_84(x_1c.x_18g,
x_7a.x_31() || !x_1c.x_18h());
}},
{
x_1j: 'x_18j',
x_23: x_x('Remote endpoint hostname or IP address:', 'interfaceVpnTunnelEditor'),
x_b2: 2,
x_b6: {
x_b7: false
}
},
{
x_1f: 'x_7a',
x_7b: 'x_18i',
x_1l: true,
x_b2: 1,
x_1s: '<span ext:qtip="' + x_18e + '">' + x_x('Passive - it only accepts incoming connections', 'interfaceVpnTunnelEditor')
+ '<span class="tooltip" ext:qtip="' + x_18e + '">&nbsp; &nbsp; &nbsp;</span></span>',
x_1o: false
}
]
},
{
x_1f: 'x_79',
x_1j: 'x_18k',
x_23: x_x('Settings for remote endpoint', 'interfaceVpnTunnelEditor'),
x_br: kerio.lib.x_a1(
{	x_a2: 300,
zh: 190
}),
x_1e: [
{
x_1j: 'x_18l',
x_23: x_x('Local endpoint\'s SSL certificate fingerprint:', 'interfaceVpnTunnelEditor'),
x_5p: true },
{
x_1j: 'x_18m',
x_23: x_x('Remote endpoint\'s SSL certificate fingerprint:', 'interfaceVpnTunnelEditor'),
x_93: 47,
x_b6: {
x_b7: false,
x_nv: 'x_18n'
}
},
{
x_1f: 'x_1i',
x_1j: 'x_18o',
x_1l: true,
x_1o: x_x('The authenticity of the remote endpoint during the creation of a tunnel session is verified by checking its public SSL certificate - the fingerprint of the certificate received from the remote endpoint must match the fingerprint entered here.', 'interfaceVpnTunnelEditor')
},
{
x_1f: 'x_b3',
x_1e: [
'->',
{
x_1f: 'x_rc',
x_1j: 'x_18p',
x_23: x_x('Detect remote certificate…', 'interfaceVpnTunnelEditor'),
x_25: function(x_1c) {
x_1c.x_16.x_18q();
} }
]
}
]
}
] };var x_17v = {
x_2w: x_2w,
x_o: x_o
};var x_17w = new kerio.waw.shared.x_17.x_e2(x_17v);
var x_18r = x_r.x_18s;
var x_18t = {
x_1e: [
{
x_1j: 'x_18u',
x_1f: 'x_79',
x_23: x_x('Routing', 'interfaceVpnTunnelEditor'),
x_1e: [
{
x_1f: 'x_1i',
x_1l: true,
x_1o: x_x('Here you may define the remote networks that will be accessible from the local network through the VPN tunnel.', 'interfaceVpnTunnelEditor')
},
{
x_1f: 'x_7a',
x_7b: 'x_18v',
x_1o: x_18r.x_18w,
x_1s: x_x('Use routes provided automatically by the remote endpoint', 'interfaceVpnTunnelEditor'),
x_1l: true,

x_9t: function(x_1c, x_ax, x_1o) {
x_1c.x_16.x_17w.x_84(x_r.x_18s.x_18w === x_1o);
} },
{
x_1f: 'x_7a',
x_7b: 'x_18v',
x_1o: x_18r.x_18x,
x_1s: x_x('Use both automatically provided and custom routes', 'interfaceVpnTunnelEditor'),
x_1l: true
},
{
x_1f: 'x_7a',
x_7b: 'x_18v',
x_1o: x_18r.x_18y,
x_1s: x_x('Use custom routes only', 'interfaceVpnTunnelEditor'),
x_1l: true
}
] },
{	x_1f: 'x_79',
x_23: x_x('Custom Routes', 'interfaceEditor'),
x_1e: [
{	x_1f: 'x_1g',
x_1v: 240,
x_1x: x_17w
}
]
}
] }; var x_11z = new x_1b.x_1t(x_2w + 'x_11z', x_11u);
var x_18z = new x_1b.x_1t(x_2w + 'x_18z', x_18t);
var x_p4 = {
x_1e: [
{
x_1x: x_11z,
x_23: x_x('General', 'common')
},
{
x_1x: x_18z,
x_23: x_x('Advanced', 'common')
}
]
};
var x_p5 = new x_1b.x_py(x_2w + 'x_p5', x_p4);
var x_10 = {
x_1v: 550,
x_1u: 680,
x_1x: x_p5,
x_1y: (x_18c
? (x_o
? x_x('View VPN Tunnel', 'interfaceVpnTunnelEditor')
: x_x('Edit VPN Tunnel', 'interfaceVpnTunnelEditor'))
: x_x('Add VPN Tunnel', 'interfaceVpnTunnelEditor')),

x_mc: function(x_32){
var
x_16 = x_32.x_16,
x_1b = kerio.lib,
x_x = x_1b.x_x,
x_190 = false;
if (x_16.x_191.x_31()) {
x_190 = x_1b.x_10o.x_192(
x_16.x_191.x_2t(),
x_r.x_193,
x_fa.x_194.x_195);
if (!x_190) {
x_fi.x_j2(x_x('Remote endpoint\'s SSL certificate fingerprint has to be specified correctly even if VPN tunnel is disabled', 'interfaceVpnTunnelEditor'));
x_16.x_24(false);
return;
}
}
if (false === x_16.x_196()) {
x_1b.x_4b(x_x('Confirm Action', 'common'),
x_x('The VPN tunnel is configured to use custom routes only, but no custom routes are defined. Do you want to continue?', 'vpnRouteManager'),
x_16.x_197,
x_16);
} else {
x_16.x_iy();
}
},
x_188: function() {
if (this.x_16.x_17w.x_ef) {
x_fi.x_ej(	x_r.x_e8.x_189);
}
this.x_16.x_2r();
}};
var x_16 = new x_1b.x_26(this.x_ga, new x_fa.x_11k.x_11l(x_10));
var x_q3 = new x_1b.x_q2(x_2w + 'x_q3', [x_11z, x_18z]);
if (x_o) {
x_11z.x_7f();
x_18z.x_85(['x_18u']);
}
x_16.x_27(
{	x_n: x_n,
x_o: x_o,
x_p5: x_p5,
x_q3: x_q3,
x_11z: x_11z,
x_18z: x_18z,
x_18c: x_18c,
x_17w: x_17w,
x_18v: x_18z.x_29('x_18v'),
x_198: x_11z.x_29('x_18j'),
x_191: x_11z.x_29('x_18m')
}
);x_11z.x_27(
{
x_16: x_16,
x_12i: x_11z.x_29('x_12i'),
x_18i: x_11z.x_29('x_18i'),
x_18f: [
'x_18i',
'x_199',
'x_19a',
'x_18k'
],
x_18g: [
'x_19b',
'x_18j',
'x_18p' ]
}
);x_18z.x_27(
{
x_16: x_16,
x_ns: x_18z.x_29('x_ns')
}
);x_q3.x_16w = true; this.x_2a(x_16);
return x_16;
},
x_2a: function(x_2b) {

x_2b.x_2c = function(x_28) {
var x_o5 = x_28.x_47 || {}; this.x_o5 = x_o5; var x_19c = x_o5.tunnel;
var x_17w = this.x_17w;
x_17w.x_ef = false;
x_17w.x_eh(this.x_18c ? x_o5.id : '');
var x_47 = {
x_a6: x_o5.name || '',
x_12i: (undefined === x_o5.enabled ? true : x_o5.enabled),
x_18l: x_28.x_5d.x_150.fingerprint,
x_18i: x_19c ? x_19c.peer.enabled : false,
x_18j: x_19c ? x_19c.peer.value : '',
x_18m: x_19c ? x_19c.remoteFingerprint : '',
x_18v: x_19c ? x_19c.acceptRoutes : 0
};
this.x_q3.x_7k(x_47);
this.x_5d = x_28.x_5d;
};
x_2b.x_197 = function(x_6v) {
if ('no' === x_6v) {
this.x_24(false);
this.x_p5.x_lf(1); return;
}
this.x_iy();
}; 
x_2b.x_196 = function() {
if (this.x_11z.x_12i.x_2t() && x_r.x_18s.x_18y === this.x_18v.x_2t()
&& this.x_17w.x_ep()) {
return false;
}
return true;
};
x_2b.x_iy = function() {
var x_47 = this.x_q3.x_7i(true);
var x_o5 = this.x_o5;
var x_da = [];
if (this.x_17w.x_ef) {
this.x_5d.x_14z = true;
x_da.push({
object: 'VpnRouteManager',
method: 'applySnapshot'
});
}
var x_19d = {
name: x_47.x_a6,
enabled: x_47.x_12i,
tunnel: {
peer: {
enabled: x_47.x_18i,
value: x_47.x_18j
},
remoteFingerprint: x_47.x_18m,
acceptRoutes: x_47.x_18v
}
};
if (!this.x_18c) {
x_o5 = { type: x_r.x_kh.x_15a,
group: x_r.x_133.x_14d
};
}
x_fi.x_iq(x_19d, x_o5);
if (this.x_18c) {
x_da.push({
object: 'InterfaceManager',
method: 'set',
params: kerio.lib.x_6r({
ids: [x_o5.id],
details: x_o5
})
});
}
else { x_da.push({
object: 'InterfaceManager',
method: 'create',
params: kerio.lib.x_6r({
interfaces: [x_o5]
})
});
}
x_fi.x_db.call(this, x_da, this.x_jk);
};
x_2b.x_jk = function(x_6v) {
this.x_24(false);
if (!x_6v.x_6x) {
return;
}
this.x_5d.x_6y();
kerio.waw.status.x_14.x_15(true);
this.x_2r();
};
x_2b.x_jo = function() {
this.x_q3.x_2h();
this.x_p5.x_lf(0);
};
x_2b.x_11z.x_18h = function() {
return this.x_18i.x_2t();
}; 
x_2b.x_18q = function(){
var
x_19e = this.x_198.x_2t();
if ('' === x_19e) {
x_fi.x_j2(kerio.lib.x_x('Please specify remote endpoint', 'vpnRouteManager'));
return; }
this.x_24(true, kerio.lib.x_x('Trying to detect the remote endpoint\'s SSL certificate…', 'vpnRouteManager'), 0); x_fi.x_4y(
'CertificateManager',
'detect', { host: x_19e }, this.x_19f,
this );
}; 
x_2b.x_19f = function(x_6v) {
this.x_24(false);
if (!x_6v.x_6x) {
return;
}
kerio.lib.x_5l.x_5m({
x_5g: 'sslCertificateDetails',
x_n: 'x_19g',
x_28: {
x_9d: this,
x_19h: this.x_19i,
x_19j: this.x_19k,
x_47: {
x_150: x_6v.x_ac.certificate,
x_19l: kerio.lib.x_x('SSL Certificate has been detected successfully.', 'sslCertificate')
}
}
});
};
x_2b.x_19i = function(x_150) {
this.x_oo.x_191.x_9w(x_150.fingerprint);
this.x_2r();
};
x_2b.x_19k = function() {
this.x_2r();
};}}; 