split tellyscript template
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -109,7 +109,7 @@ if (session_data.data_store.wtvsec_login) {
|
|||||||
case "bf0app":
|
case "bf0app":
|
||||||
prereg_contype = "text/tellyscript";
|
prereg_contype = "text/tellyscript";
|
||||||
// if wtv-open-access: true then client expects OpenISP
|
// if wtv-open-access: true then client expects OpenISP
|
||||||
if (session_data.get("wtv-open-access")) template_path = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.openisp.template.txt", true);
|
if (session_data.get("wtv-open-access")) template = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.base.template.txt") + wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app.openisp.template.txt");
|
||||||
else file_path = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok", true);
|
else file_path = wtvshared.getServiceDep("/wtv-1800/tellyscripts/bf0app/bf0app_WTV_18006138199.tok", true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -197,21 +197,14 @@ if (session_data.data_store.wtvsec_login) {
|
|||||||
}
|
}
|
||||||
sendToClient(socket, headers, file_read_data);
|
sendToClient(socket, headers, file_read_data);
|
||||||
});
|
});
|
||||||
} else if (template_path) {
|
} else if (template) {
|
||||||
request_is_async = true;
|
request_is_async = true;
|
||||||
fs.readFile(template_path, null, function (err, file_read_data) {
|
telly = new WTVTellyScript(template, 2); // 2 = Untokenized
|
||||||
if (err) {
|
telly.setTemplateVars(minisrv_config.config.service_name, minisrv_config.services[service_name].dialin_number, minisrv_config.services[service_name].dns1ip, minisrv_config.services[service_name].dns2ip);
|
||||||
var errmsg = wtvshared.doErrorPage(400);
|
telly.minify();
|
||||||
headers = errmsg[0];
|
telly.tokenize();
|
||||||
file_read_data = errmsg[1] + "\n" + err.toString();
|
telly.pack();
|
||||||
}
|
sendToClient(socket, headers, telly.packed_data);
|
||||||
telly = new WTVTellyScript(file_read_data, 2); // 2 = Untokenized
|
|
||||||
telly.setTemplateVars(minisrv_config.config.service_name, minisrv_config.services[service_name].dialin_number, minisrv_config.services[service_name].dns1ip, minisrv_config.services[service_name].dns2ip);
|
|
||||||
telly.minify();
|
|
||||||
telly.tokenize();
|
|
||||||
telly.pack();
|
|
||||||
sendToClient(socket, headers, telly.packed_data);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var errpage = wtvshared.doErrorPage(400);
|
var errpage = wtvshared.doErrorPage(400);
|
||||||
|
|||||||
Reference in New Issue
Block a user