Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 4cf07e5d authored by echicken's avatar echicken 🐔

Fix much of what was broken a few days ago.

Execute most any top-level SSJS in an IIFE to work around whatever
context reuse thing is happening.
I'm aboot done with this shit for now I tell you what.
parent f944e40a
......@@ -190,7 +190,3 @@ function is_user() {
}
}
})();
const WEBV4_AUTH = true;
this;
const forum_lib = load({}, settings.web_lib + 'forum.js');
load(settings.web_lib + 'forum.js');
var last_subs;
var last_groups;
......@@ -24,7 +24,7 @@ function forum_emit(evt, data) {
}
function scan_groups() {
const scan = forum_lib.getGroupUnreadCounts();
const scan = getGroupUnreadCounts();
if (!last_groups) {
forum_emit('groups_unread', scan);
} else {
......@@ -35,7 +35,7 @@ function scan_groups() {
}
function scan_subs(group) {
const scan = forum_lib.getSubUnreadCounts(group);
const scan = getSubUnreadCounts(group);
if (!last_subs) {
forum_emit('subs_unread', scan);
} else {
......@@ -46,7 +46,7 @@ function scan_subs(group) {
}
function scan_threads(sub, offset, page_size) {
const scan = forum_lib.getThreadStats(sub, offset, page_size);
const scan = getThreadStats(sub, offset, page_size);
if (!last_threads) {
forum_emit('threads', scan);
} else {
......@@ -66,12 +66,12 @@ function scan_threads(sub, offset, page_size) {
}
function cycle() {
if (!auth_lib.is_user()) return;
if (!is_user()) return;
if (time() - last_run <= frequency) return;
last_run = time();
if (Req.has_param('groups_unread')) scan_groups();
if (Req.has_param('subs_unread')) scan_subs(Req.get_param('subs_unread'));
if (Req.has_param('threads')) scan_threads(Req.get_param('threads'), Req.get_param('offset'), Req.get_param('page_size'));
if (Request.has_param('groups_unread')) scan_groups();
if (Request.has_param('subs_unread')) scan_subs(Request.get_param('subs_unread'));
if (Request.has_param('threads')) scan_threads(Request.get_param('threads'), Request.get_param('offset'), Request.get_param('page_size'));
}
this;
......@@ -50,7 +50,7 @@ function scan_web() {
change = true;
}
} else {
const action = auth_lib.getSessionValue(un, 'action');
const action = getSessionValue(un, 'action');
if (web_state[base] != action) {
web_state[base] = action;
change = true;
......
......@@ -31,5 +31,3 @@ function listFiles(dir) {
return df;
});
}
this;
\ No newline at end of file
......@@ -930,7 +930,7 @@ function getMessageThreads(sub, max) {
if (header.when_written_time > threads.thread[thread_id].newest) {
threads.thread[thread_id].newest = header.when_written_time;
}
if (auth_lib.is_user() && header.number > msg_area.sub[sub].scan_ptr) {
if (is_user() && header.number > msg_area.sub[sub].scan_ptr) {
threads.thread[thread_id].unread++;
}
threads.thread[thread_id].messages[header.number] = {
......@@ -1122,16 +1122,14 @@ function getMessageThreads(sub, max) {
}
function isValidRequest() {
if (Req.has_param('group')) {
const grp = Req.get_param('group');
if (Request.has_param('group')) {
const grp = Request.get_param('group');
if (typeof msg_area.grp_list[grp] == 'undefined') return false;
if (!user.compare_ars(msg_area.grp_list[grp].ars)) return false;
}
if (Req.has_param('sub')) {
const sub = Req.get_param('sub');
if (Request.has_param('sub')) {
const sub = Request.get_param('sub');
if (typeof msg_area.sub[sub] == 'undefined') return false;
}
return true;
}
this;
......@@ -48,5 +48,3 @@ function get_url() {
}
return get_cached_url(f);
}
this;
require('sbbsdefs.js', 'SYS_CLOSED');
if (!settings) var settings = load('modopts.js', 'web');
// Paths
settings.web_directory = fullpath(
backslash(
......@@ -69,30 +67,3 @@ Object.keys(defaults).forEach(function (e) {
defaults = undefined;
require(settings.web_lib + 'locale.js', 'locale');
if (typeof alert === 'undefined') {
function alert(msg) {
log(LOG_ERR, msg);
}
}
// Helpers for http_request
const Req = {
// Query parameter p exists and first instance is of optional type t
has_param: function (p) {
return (Array.isArray(http_request.query[p]) && http_request.query[p].length);
},
// First instance of query parameter p, or undefined
get_param: function (p) {
if (Array.isArray(http_request.query[p]) && http_request.query[p].length) {
return http_request.query[p][0];
}
},
write_param: function (p) {
if (Array.isArray(http_request.query[p]) && http_request.query[p].length) {
write(http_request.query[p][0]);
}
}
};
const WEBV4_INIT = true;
\ No newline at end of file
......@@ -145,7 +145,7 @@ function getPage(page) {
if (user.alias != settings.guest) {
var ctrl = getCtrlLine(page);
if (typeof ctrl !== 'undefined' && !ctrl.options.hidden) {
auth_lib.setSessionValue(user.number, 'action', ctrl.title);
setSessionValue(user.number, 'action', ctrl.title);
}
}
......@@ -153,12 +153,12 @@ function getPage(page) {
case '.SSJS':
if (ext === '.SSJS' && page.search(/\.xjs\.ssjs$/i) >= 0) break;
(function () {
load({}, page, true);
load(page, true);
})();
break;
case '.XJS':
(function () {
load({}, xjs_compile(page), true);
load(xjs_compile(page), true);
})();
break;
case '.HTML':
......@@ -191,5 +191,3 @@ function writePage(page) {
write(getPage(page));
}
}
this;
\ No newline at end of file
......@@ -24,12 +24,12 @@ function getSidebarModule(module) {
case '.SSJS':
if (ext === '.SSJS' && module.search(/\.xjs\.ssjs$/i) >= 0) break;
(function () {
load({}, module, true);
load(module, true);
})();
break;
case '.XJS':
(function () {
load({}, xjs_compile(module), true);
load(xjs_compile(module), true);
})();
break;
case '.HTML':
......@@ -60,5 +60,3 @@ function writeSidebarModules() {
);
write('</ul>');
}
this;
\ No newline at end of file
......@@ -3,7 +3,7 @@
<!-- fTelnet -->
<?xjs
if (settings.ftelnet) {
const ftelnet_lib = load({}, settings.web_lib + 'ftelnet.js');
load(settings.web_lib + 'ftelnet.js');
load('ftelnethelper.js');
?>
<div id="fTelnetContainer" class="fTelnetContainer"></div>
......@@ -18,13 +18,14 @@
</div>
<?xjs } ?>
<script id="fTelnetScript" src="<?xjs write(ftelnet_lib.get_url()); ?>"></script>
<script id="fTelnetScript" src="<?xjs write(get_url()); ?>"></script>
<script>
var wsp = <?xjs write(settings.wsp || GetWebSocketServicePort()); ?>;
var wssp = <?xjs write(settings.wssp || GetWebSocketServicePort(true)); ?>;
var Options = new fTelnetOptions();
Options.BareLFtoCRLF = false;
Options.BitsPerSecond = 57600;
Options.BitsPerSecond = 57600;
Options.ButtonBarVisible = true;
Options.ConnectionType = 'telnet';
Options.Emulation = 'ansi-bbs';
Options.Enter = '\r';
......@@ -35,8 +36,9 @@
Options.Port = location.protocol == 'https:' ? wssp : wsp;
Options.ScreenColumns = 80;
Options.ScreenRows = 25;
Options.SplashScreen = '<?xjs write(ftelnet_lib.get_splash()); ?>';
var fTelnet = new fTelnetClient('fTelnetContainer', Options);
Options.SplashScreen = '<?xjs write(get_splash()); ?>';
var fTelnet = new fTelnetClient('fTelnetContainer', Options);
fTelnet.ButtonBarVisible = true;
if ($('#ftelnet-connect').length) {
$('#ftelnet-connect').click(function() {
fTelnet.Connect();
......
......@@ -3,42 +3,43 @@
<script type="text/javascript" src="./js/forum.js"></script>
<?xjs
const forum_lib = load({}, settings.web_lib + 'forum.js');
load(settings.web_lib + 'request.js');
load(settings.web_lib + 'forum.js');
locale.section = 'page_forum';
?>
<!-- To do: Search (forum, group, sub, or thread) -->
<!-- To do: Search (forum, group, sub, or thread), Sortation and data-attributes -->
<?xjs if (Req.has_param('sub') && Req.has_param('thread')) { ?>
<?xjs if (Request.has_param('sub') && Request.has_param('thread')) { ?>
<?xjs
var offset = Request.has_param('offset') ? parseInt(Request.get_param('offset')) : 0;
const thread = getMessageThreads(Request.get_param('sub'), settings.max_messages).thread[Request.get_param('thread')];
?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Req.write_param('page'); ?>">
<a href="./?page=<? Request.write_param('page'); ?>">
<? locale.write('title'); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&group=<? Req.write_param('group'); ?>">
<? write(msg_area.grp_list[msg_area.sub[Req.get_param('sub')].grp_index].name); ?>
<a href="./?page=<? Request.write_param('page'); ?>&group=<? Request.write_param('group'); ?>">
<? write(msg_area.grp_list[msg_area.sub[Request.get_param('sub')].grp_index].name); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&sub=<? Req.write_param('sub'); ?>">
<? write(msg_area.sub[Req.get_param('sub')].name); ?>
<a href="./?page=<? Request.write_param('page'); ?>&sub=<? Request.write_param('sub'); ?>">
<? write(msg_area.sub[Request.get_param('sub')].name); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&sub=<? Req.write_param('sub'); ?>&thread=<? Req.write_param('thread'); ?>">
Thread <? Req.write_param('thread'); ?>
<a href="./?page=<? Request.write_param('page'); ?>&sub=<? Request.write_param('sub'); ?>&thread=<? Request.write_param('thread'); ?>">
<? write(thread.subject); ?>
</a>
</li>
</ol>
<?xjs
var offset = Req.has_param('offset') ? parseInt(Req.get_param('offset')) : 0;
const thread = forum_lib.getMessageThreads(Req.get_param('sub'), settings.max_messages);
?>
<div id="jump-unread-container" style="margin-bottom:1em;">
<a class="btn btn-default" id="jump-unread" title="Jump to first unread message" href="#">
<span class="glyphicon glyphicon-star"></span>
......@@ -49,30 +50,30 @@
</div>
<?xjs } else if (Req.has_param('sub') && typeof msg_area.sub[Req.get_param('sub')] != 'undefined') { ?>
<?xjs } else if (Request.has_param('sub') && typeof msg_area.sub[Request.get_param('sub')] != 'undefined') { ?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Req.write_param('page'); ?>">
<a href="./?page=<? Request.write_param('page'); ?>">
<? locale.write('title'); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&group=<? write(msg_area.grp_list[msg_area.sub[Req.get_param('sub')].grp_index].number); ?>">
<? write(msg_area.grp_list[msg_area.sub[Req.get_param('sub')].grp_index].name); ?>
<a href="./?page=<? Request.write_param('page'); ?>&group=<? write(msg_area.grp_list[msg_area.sub[Request.get_param('sub')].grp_index].number); ?>">
<? write(msg_area.grp_list[msg_area.sub[Request.get_param('sub')].grp_index].name); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&sub=<? Req.write_param('sub'); ?>">
<? write(msg_area.sub[Req.get_param('sub')].name); ?>
<a href="./?page=<? Request.write_param('page'); ?>&sub=<? Request.write_param('sub'); ?>">
<? write(msg_area.sub[Request.get_param('sub')].name); ?>
</a>
</li>
</ol>
<?xjs
var offset = Req.has_param('offset') ? parseInt(Req.get_param('offset')) : 0;
const threads = forum_lib.listThreads(Req.get_param('sub'), offset, settings.page_size);
const sub = msg_area.sub[Req.get_param('sub')];
var offset = Request.has_param('offset') ? parseInt(Request.get_param('offset')) : 0;
const threads = listThreads(Request.get_param('sub'), offset, settings.page_size, true) || { total: 0, threads: [] };
const sub = msg_area.sub[Request.get_param('sub')];
?>
<button class="btn btn-default icon" aria-label="<? locale.write('button_post_message'); ?>" title="<? locale.write('button_post_message'); ?>" onclick="addNew('<? write(sub.code); ?>')">
......@@ -94,48 +95,41 @@
</button>
</div>
<div id="forum-thread-replies-template" hidden>
<p>
<strong data-message-count></strong>
<span data-suffix-reply hidden><? locale.write('suffix_reply_count'); ?>.</span>
<span data-suffix-replies hidden><? locale.write('suffix_replies_count'); ?>.</span>
<? locale.write('label_thread_latest_reply'); ?>
<strong data-last-from></strong>
<span data-last-time></span>
</p>
</div>
<div id="forum-thread-stats-template" hidden>
<?xjs if (is_user()) { ?>
<span data-unread-messages title="<? locale.write('badge_unread_messages'); ?>" class="badge <? write(sub.scan_cfg&SCAN_CFG_NEW || sub.scan_cfg&SCAN_CFG_YONLY ? 'scanned' : ''); ?>" hidden></span>
<?xjs } ?>
<span data-upvotes-badge title="<? locale.write('badge_upvotes'); ?>" class="badge upvote-bg" style="display:none;">
<span class="glyphicon glyphicon-arrow-up"></span>
<span data-upvotes></span>
</span>
<span data-downvotes-badge title="<? locale.write('badge_downvotes'); ?>" class="badge downvote-bg" style="display:none;">
<span class="glyphicon glyphicon-arrow-down"></span>
<span data-downvotes></span>
</span>
</div>
<div id="forum-list-container" class="list-group">
<?xjs threads.threads.forEach(function (e) { ?>
<a href="./?page=<? Req.write_param('page'); ?>&sub=<? Req.write_param('sub'); ?>&thread=<? write(e.id); ?>" class="list-group-item striped">
<a href="./?page=<? Request.write_param('page'); ?>&sub=<? Request.write_param('sub'); ?>&thread=<? write(e.id); ?>" class="list-group-item striped">
<div class="row">
<div class="col-sm-9">
<div id="left-<? write(e.id); ?>" class="col-sm-9">
<strong><? write(e.subject); ?></strong>
<p><strong><? write(e.first.from); ?></strong>, <? write(system.timestr(e.first.when_written_time)); ?></p>
<?xjs if (e.messages > 1) { ?>
<p>
<strong><? write(e.messages - 1); ?></strong>
<?xjs
if (e.messages == 2) {
locale.write('suffix_reply_count');
} else {
locale.write('suffix_replies_count');
}
?>,
<? locale.write('label_thread_latest_reply'); ?>
<strong><? write(e.last.from); ?></strong>,
<? write(system.timestr(e.last.when_written_time)); ?>
</p>
<?xjs } ?>
</div>
<div class="col-sm-3">
<div class="pull-right">
<?xjs if (auth_lib.is_user() && e.unread) { ?>
<span title="<? locale.write('badge_unread_messages'); ?>" class="badge <? write(sub.scan_cfg&SCAN_CFG_NEW || sub.scan_cfg&SCAN_CFG_YONLY ? 'scanned' : ''); ?>" id="badge-<? write(e.id); ?>">
<? write(e.unread); ?>
</span>
<?xjs } ?>
<?xjs if (e.votes.up || e.votes.down) { ?>
<span id="uv-<? write(e.id); ?>" title="<? locale.write('badge_upvotes'); ?>" class="badge upvote-bg">
<span class="glyphicon glyphicon-arrow-up"></span>
<span id="uv-count-<? write(e.id); ?>"><? write(e.first.upvotes + ' / ' + e.votes.up); ?></span>
</span>
&nbsp;
<span id="dv-<? write(e.id); ?>" title="<? locale.write('badge_downvotes'); ?>" class="badge downvote-bg">
<span class="glyphicon glyphicon-arrow-down"></span>
<span id="dv-count-<? write(e.id); ?>"><? write(e.first.downvotes + ' / ' + e.votes.down); ?></span>
</span>
<?xjs } ?>
</div>
<div id="right-<? write(e.id); ?>" class="pull-right"></div>
</div>
</div>
</a>
......@@ -176,29 +170,37 @@
</div class="btn-group">
<?xjs } ?>
<?xjs if (auth_lib.is_user()) { ?>
<!-- To do: Subscribe to vote, unread events -->
<?xjs } ?>
<script type="text/javascript">
registerEventListener('forum', function (e) {
const data = JSON.parse(e.data);
if (data.type != 'threads') return;
onThreadStats(data.data);
}, {
threads: '<? Request.write_param("sub"); ?>',
offset: '<? write(offset); ?>',
page_size: '<? write(settings.page_size); ?>'
});
</script>
<?xjs } else if (Req.has_param('group') && typeof msg_area.grp_list[Req.get_param('group')] != 'undefined') { ?>
<?xjs } else if (Request.has_param('group') && typeof msg_area.grp_list[Request.get_param('group')] != 'undefined') { ?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Req.write_param('page'); ?>">
<a href="./?page=<? Request.write_param('page'); ?>">
<? locale.write('title'); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&group=<? Req.write_param('group'); ?>">
<? write(msg_area.grp_list[Req.get_param('group')].name); ?>
<a href="./?page=<? Request.write_param('page'); ?>&group=<? Request.write_param('group'); ?>">
<? write(msg_area.grp_list[Request.get_param('group')].name); ?>
</a>
</li>
</ol>
<div id="forum-list-container" class="list-group">
<?xjs const subs = forum_lib.listSubs(Req.get_param('group')); ?>
<?xjs const subs = listSubs(Request.get_param('group')); ?>
<?xjs subs.forEach(function (e) { ?>
<a href="./?page=<? Req.write_param('page'); ?>&sub=<? write(e.code); ?>" class="list-group-item striped">
<a href="./?page=<? Request.write_param('page'); ?>&sub=<? write(e.code); ?>" class="list-group-item striped">
<h4><strong><? write(e.name); ?></strong></h4>
<span title="<? locale.write('badge_unread_messages'); ?>" class="badge <? write(e.scan_cfg&SCAN_CFG_NEW || e.scan_cfg&SCAN_CFG_YONLY ? 'scanned' : 'total'); ?>" id="badge-<? write(e.code); ?>"></span>
<p><? write(e.description); ?></p>
......@@ -206,13 +208,13 @@
<?xjs }); ?>
</div>
<?xjs if (auth_lib.is_user()) { ?>
<?xjs if (is_user()) { ?>
<script type="text/javascript">
registerEventListener('forum', function (e) {
const data = JSON.parse(e.data);
if (data.type != 'subs_unread') return;
onSubUnreadCount(data.data);
}, { subs_unread: '<? Req.write_param('group'); ?>' });
}, { subs_unread: '<? Request.write_param("group"); ?>' });
</script>
<?xjs } ?>
......@@ -220,14 +222,14 @@
<ol class="breadcrumb">
<li>
<a href="./?page=<? Req.write_param('page'); ?>"><? locale.write('title'); ?></a>
<a href="./?page=<? Request.write_param('page'); ?>"><? locale.write('title'); ?></a>
</li>
</ol>
<div id="forum-list-container" class="list-group">
<?xjs const groups = forum_lib.listGroups(); ?>
<?xjs const groups = listGroups(); ?>
<?xjs groups.forEach(function (e) { ?>
<a href="./?page=<? Req.write_param('page'); ?>&group=<? write(e.index); ?>" class="list-group-item striped">
<a href="./?page=<? Request.write_param('page'); ?>&group=<? write(e.index); ?>" class="list-group-item striped">
<h3><strong><? write(e.name); ?></strong></h3>
<span title="<? locale.write('badge_unread_messages'); ?>" class="badge ignored" id="badge-ignored-<? write(e.index); ?>"></span>
<span title="<? locale.write('badge_unread_messages'); ?>" class="badge scanned" id="badge-scanned-<? write(e.index); ?>"></span>
......@@ -236,7 +238,7 @@
<?xjs }); ?>
</div>
<?xjs if (auth_lib.is_user()) { ?>
<?xjs if (is_user()) { ?>
<script type="text/javascript">
registerEventListener('forum', function (e) {
const data = JSON.parse(e.data);
......
<!--Files-->
<?xjs
load(settings.web_lib + 'request.js');
load(settings.web_lib + 'files.js');
locale.section = 'page_files';
if (Req.has_param('dir')) {
if (Request.has_param('dir')) {
?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Req.write_param('page'); ?>">
<a href="./?page=<? Request.write_param('page'); ?>">
<? locale.write('title'); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&amp;library=<? write(file_area.dir[Req.get_param('dir')].lib_index); ?>">
<? write(file_area.dir[Req.get_param('dir')].lib_name); ?>
<a href="./?page=<? Request.write_param('page'); ?>&amp;library=<? write(file_area.dir[Request.get_param('dir')].lib_index); ?>">
<? write(file_area.dir[Request.get_param('dir')].lib_name); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&amp;dir=<? Req.write_param('dir'); ?>">
<? Req.write_param('dir'); ?>
<a href="./?page=<? Request.write_param('page'); ?>&amp;dir=<? Request.write_param('dir'); ?>">
<? Request.write_param('dir'); ?>
</a>
</li>
</ol>
<?xjs function writeFileDetails(file) { ?>
<a href="./api/files.ssjs?call=download-file&amp;dir=<? Req.write_param('dir'); ?>&amp;file=<? write(file.name); ?>" target="_blank" class="list-group-item striped" data-file-list-element data-size="<? write(file._size); ?>" data-uploaded="<? write(file.uldate); ?>" data-name="<? write(file.name); ?>">
<a href="./api/files.ssjs?call=download-file&amp;dir=<? Request.write_param('dir'); ?>&amp;file=<? write(file.name); ?>" target="_blank" class="list-group-item striped" data-file-list-element data-size="<? write(file._size); ?>" data-uploaded="<? write(file.uldate); ?>" data-name="<? write(file.name); ?>">
<strong><? write(file.name); ?></strong> (<? write(file.size); ?>)
<p><em>Uploaded <? write(system.timestr(file.uldate)); ?></em></p>
<?xjs if (typeof file.extdesc === 'undefined') { ?>
......@@ -53,27 +54,27 @@
</div>
</div>
<div id="file-list-container" class="list-group">
<?xjs listFiles(Req.get_param('dir')).forEach(writeFileDetails); ?>
<?xjs listFiles(Request.get_param('dir')).forEach(writeFileDetails); ?>
</div>
<?xjs } else if (Req.has_param('library')) { ?>
<?xjs } else if (Request.has_param('library')) { ?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Req.write_param('page'); ?>">
<a href="./?page=<? Request.write_param('page'); ?>">
<? locale.write('title'); ?>
</a>
</li>
<li>
<a href="./?page=<? Req.write_param('page'); ?>&amp;library=<? Req.write_param('library'); ?>">
<? write(file_area.lib_list[Req.get_param('library')].name); ?>
<a href="./?page=<? Request.write_param('page'); ?>&amp;library=<? Request.write_param('library'); ?>">
<? write(file_area.lib_list[Request.get_param('library')].name); ?>
</a>
</li>
</ol>
<?xjs function writeDirectory(dir) { ?>
<a href="./?page=<? Req.write_param('page'); ?>&amp;dir=<? write(dir.dir.code); ?>" class="list-group-item striped">
<a href="./?page=<? Request.write_param('page'); ?>&amp;dir=<? write(dir.dir.code); ?>" class="list-group-item striped">
<h4><strong><? write(dir.dir.name); ?></strong></h4>
<p>
<? write(dir.dir.description); ?>:
......@@ -84,19 +85,19 @@
<?xjs } ?>
<div id="file-list-container" class="list-group">
<?xjs listDirectories(Req.get_param('library')).forEach(writeDirectory); ?>
<?xjs listDirectories(Request.get_param('library')).forEach(writeDirectory); ?>
</div>
<?xjs } else { ?>
<ol class="breadcrumb">
<li>
<a href="./?page=<? Req.write_param('page'); ?>"><? locale.write('title'); ?></a>
<a href="./?page=<? Request.write_param('page'); ?>"><? locale.write('title'); ?></a>
</li>
</ol>
<?xjs function writeLibrary(library) { ?>
<a href="./?page=<? Req.write_param('page'); ?>&amp;library=<? write(library.index); ?>" class="list-group-item striped">
<a href="./?page=<? Request.write_param('page'); ?>&amp;library=<? write(library.index); ?>" class="list-group-item striped">
<h3><strong><? write(library.name); ?></strong></h3>
<p>
<? write(library.description); ?>:
......
......@@ -2,7 +2,7 @@
<?xjs
load("ftelnethelper.js");
const ftelnet_lib = load({}, settings.web_lib + 'ftelnet.js');
load(settings.web_lib + 'ftelnet.js');
if (typeof settings.xtrn_blacklist === 'string') {
settings.xtrn_blacklist = settings.xtrn_blacklist.toLowerCase().split(',');
......@@ -60,7 +60,7 @@
Options.RLoginServerUsername = '<?xjs write(user.alias); ?>';
Options.ScreenColumns = 80;
Options.ScreenRows = 25;
Options.SplashScreen = Options.SplashScreen = '<?xjs write(ftelnet_lib.get_splash()); ?>';
Options.SplashScreen = Options.SplashScreen = '<?xjs write(get_splash()); ?>';
Options.WebSocketUrlPath = '?Port=<?xjs write(GetRLoginPort()); ?>';
var fTelnet = new fTelnetClient('fTelnetContainer', Options);
fTelnet.OnConnectionClose = function () {
......
require('sbbsdefs.js', 'SYS_CLOSED');
var settings = load('modopts.js', 'web');
const settings = load('modopts.js', 'web');
require(settings.web_directory + '/lib/init.js', 'WEBV4_INIT');
require(settings.web_lib + 'auth.js', 'WEBV4_AUTH');
load(settings.web_directory + '/lib/init.js');
load(settings.web_lib + 'auth.js');
load(se