Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
a639a6dc
Commit
a639a6dc
authored
12 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Respect webctrl.ini on a per-file basis when loading pages or sidebar items.
parent
cf87c170
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/root/ecwebv3/index.xjs
+29
-2
29 additions, 2 deletions
web/root/ecwebv3/index.xjs
with
29 additions
and
2 deletions
web/root/ecwebv3/index.xjs
+
29
−
2
View file @
a639a6dc
<?xjs load('webInit.ssjs'); ?>
<?xjs
load('webInit.ssjs');
function checkWebCtrl(path, fileName) {
if(!file_exists(path + "webctrl.ini"))
return true; // Directory is not controlled, allow access
var f = new File(path + "webctrl.ini");
f.open("r");
if(f.is_open) {
var webctrl = f.iniGetAllObjects();
f.close();
} else {
return false; // Directory is controlled but webctrl not openable
}
for(var w = 0; w < webctrl.length; w++) {
if(webctrl[w].name != fileName)
continue;
if(webctrl[w].hasOwnProperty('AccessRequirements') && !user.compare_ars(webctrl[w].AccessRequirements))
return false;
}
return true;
}
?>
<html>
<head>
...
...
@@ -23,6 +45,9 @@
for(var f = 0; f < d.length; f++) {
if(file_isdir(d[f]))
continue;
var fn = file_getname(d[f]);
if(!checkWebCtrl(webIni.RootDirectory + '/sidebar/', fn))
continue;
var ext = d[f].toUpperCase().split(".").slice(1).join(".");
if(ext == "XJS.SSJS")
continue;
...
...
@@ -65,7 +90,9 @@
else
ext = ext.toUpperCase();
var f = file_exists(webIni.RootDirectory + "/pages/" + page);
if(f && ext == ".SSJS") {
if(!f || !checkWebCtrl(webIni.RootDirectory + "/pages/", page)) {
print("Page not available.");
} else if(ext == ".SSJS") {
load(webIni.RootDirectory + "/pages/" + page);
} else if(f && ext == ".HTML") {
var f = new File(webIni.RootDirectory + "/pages/" + page);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment