Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
BRIC
dokuwiki
Commits
42f3fd0a
Commit
42f3fd0a
authored
10 years ago
by
Cyril Duchon-Doris
Browse files
Options
Downloads
Patches
Plain Diff
Reverting changes so as to use already existing function, and adding admin check
parent
1fa1d6bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/plugins/acl/admin.php
+0
-43
0 additions, 43 deletions
lib/plugins/acl/admin.php
lib/plugins/acl/remote.php
+7
-2
7 additions, 2 deletions
lib/plugins/acl/remote.php
with
7 additions
and
45 deletions
lib/plugins/acl/admin.php
+
0
−
43
View file @
42f3fd0a
...
...
@@ -674,49 +674,6 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
}
}
/**
* Returns an array of all ACLs
* (meant to be use by XMLRC API)
* Mostly a copy of _init_acl_config, consider refactoring ?
*
* @author Cyril Duchon-Doris <cyril.duchon-doris@telecom-paristech.org>
*/
function
_acl_list
(){
global
$AUTH_ACL
;
global
$conf
;
$acl_config
=
array
();
// get special users and groups
$this
->
specials
[]
=
'@ALL'
;
$this
->
specials
[]
=
'@'
.
$conf
[
'defaultgroup'
];
if
(
$conf
[
'manager'
]
!=
'!!not set!!'
){
$this
->
specials
=
array_merge
(
$this
->
specials
,
array_map
(
'trim'
,
explode
(
','
,
$conf
[
'manager'
])));
}
$this
->
specials
=
array_filter
(
$this
->
specials
);
$this
->
specials
=
array_unique
(
$this
->
specials
);
sort
(
$this
->
specials
);
foreach
(
$AUTH_ACL
as
$line
){
$line
=
trim
(
preg_replace
(
'/#.*$/'
,
''
,
$line
));
//ignore comments
if
(
!
$line
)
continue
;
$acl
=
preg_split
(
'/[ \t]+/'
,
$line
);
//0 is pagename, 1 is user, 2 is acl
$acl
[
1
]
=
rawurldecode
(
$acl
[
1
]);
$acl_config
[
$acl
[
0
]][
$acl
[
1
]]
=
$acl
[
2
];
// store non-special users and groups for later selection dialog
$ug
=
$acl
[
1
];
if
(
in_array
(
$ug
,
$this
->
specials
))
continue
;
}
ksort
(
$acl_config
);
return
$acl_config
;
}
/**
* adds new acl-entry to conf/acl.auth.php
*
...
...
This diff is collapsed.
Click to expand it.
lib/plugins/acl/remote.php
+
7
−
2
View file @
42f3fd0a
...
...
@@ -34,12 +34,17 @@ class remote_plugin_acl extends DokuWiki_Remote_Plugin {
/**
* List all ACL config entries
*
* @return array [{scope, user, permission}]
* @throws RemoteAccessDeniedException
* @return dictionary {Scope: ACL}, where ACL = dictionnary {user/group: permissions_int}
*/
public
function
listAcls
(){
if
(
!
auth_isadmin
())
{
throw
new
RemoteAccessDeniedException
(
'You are not allowed to access ACLs, superuser permission is required'
,
114
);
}
/** @var admin_plugin_acl $apa */
$apa
=
plugin_load
(
'admin'
,
'acl'
);
return
$apa
->
_acl_list
();
$apa
->
_init_acl_config
();
return
$apa
->
acl
;
}
/**
...
...
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