mittelab / ifauthex-dokuwiki-plugin Goto Github PK
View Code? Open in Web Editor NEWToggle DokuWiki page content based on users and groups with arbitrary boolean expressions.
License: GNU General Public License v2.0
Toggle DokuWiki page content based on users and groups with arbitrary boolean expressions.
License: GNU General Public License v2.0
If the first headline on a page is hidden, the page layout breaks.
The following page:
<ifauth @restricted_group>
====== Hidden ======
Hidden content.
</ifauth>
====== Public ======
Not hidden content.
displays like this for users not in restricted_group:
Release 2020-07-29 "Hogfather"
Default dokuwiki
template
We are using ADFS SAML authentication, and there are users with groups containing spaces and multibyte characters.
I attempted to use this group with the ifauthex plugin, but I can not display it well.
Hello,
Really like ifauthex - it has allowed me to do what I need and build some navigation etc. based on groups.
I would like to use it to show or hide items in a top slot navigation menu (bootstrap/combostrap template), but
ifauthex seems to wrap output in <p> </p>
tags, which breaks the layout of the top navigation bar.
Is it possible to have an option to suppress this?
Thanks.!
Hi Pietro,
the following error occured after updating.
Catchable fatal error: Argument 1 passed to AST\tokenize() must be an instance of AST\string, string given, called in C:\inetpub\wwwroot\dokuwiki\lib\plugins\ifauthex\lib\grammar.php on line 202 and defined in C:\inetpub\wwwroot\dokuwiki\lib\plugins\ifauthex\lib\tokenizer.php on line 134
I changed the following to get it running again. Perhaps you could check an patch it.
OLD
function auth_expr_parse($expr) {
return \AST\parse(\AST\tokenize($expr, auth_expr_all_tokens(), auth_expr_ignore_tokens()), auth_expr_all_elements());
}
NEW
function auth_expr_parse(AST\string $expr) {
return \AST\parse(\AST\tokenize($expr, auth_expr_all_tokens(), auth_expr_ignore_tokens()), auth_expr_all_elements());
}
Ifauthex does not change the table of contents. The chapters that ar hidden by ifauthex should not be visible for users in the table of contents.
Greeting
Christian
This Plugin does not work with PHP 5 on Debian 9.12
From the error log:
[Wed Sep 30 22:59:00.211143 2020] [:error] [pid 20924] [client <IP>] PHP Catchable fatal error:
Argument 1 passed to AST\\tokenize() must be an instance of AST\\string, string given, called in
<WIKIDIR>/lib/plugins/ifauthex/lib/grammar.php on line 202 and defined in <WIKIDIR>/lib/plugins
/ifauthex/lib/tokenizer.php on line 134
Unfortunately, I had no time yet to look further into this. But I would love if this plugin could be made to work with PHP 5, as well and can probably help to get more insight into this in the next days.
Please add support for odt Plugin.
https://www.dokuwiki.org/plugin:odt
https://www.dokuwiki.org/plugin:odt:implementodtsupport
Hi,
Is this plugin compatible with the latest Dokuwiki release?
Hi,
I've just started playing around with your plugin, and wanted to ask a clarifying questions about this comment on the module documentation page.
The content is not truly hidden, it is just not rendered (it is still visibile on the source). To truly hide use the [nodisp](https://www.dokuwiki.org/plugin:nodisp) plugin.
I'm using FireFox, and when I view the page source for a page that restricts some content using this syntax:
<ifauth @trusted_group>
sensitive stuff
</ifauth>
... I don't see the sensitive stuff
in the HTML. So when you say that the hidden content is still visible in the source, I was wondering what you meant? Did you mean the page contents sent to the end user's browser, or did you instead mean the DokuWiki source that is made available through the ?do=edit action?
Sorry if, I'm being a bit dense.
Thanks
Alex
I've been looking for a plugin to show/hide content based on authorisation, not just authentication, and it looks as though combining this into the ifauthex plugin might be one way to go. Essentially, I'd like to see a syntax to check whether a user has any particular permissions on a target. Examples, in a made up syntax:
<ifauth >AUTH_READ> # satisfied if the current user has a permission greater than read for the current page
<ifauth @mygroup<=AUTH_EDIT?ns> # satisfied if mygroup has less than or equal to edit permission in namespace ns
<ifuath myuser=AUTH_CREATE?.:relative:page> # satisfied if myuser has exactly create permission on .:relative:page
User/group would default to the current user if not given, and target would default to the current page if not given. These specifications could combined with the existing user/group rules to allow fine-grained showing/hiding of content based on both who they are and whether they have permission.
Being able to check the permissions on a page/namespace other than the current one would be useful to be able to show a form to create a page based on whether the user could complete the action, for instance.
Hi, Ive just started using ifauthex. I was wondering if there might be a way to include an optional style name in the syntax so we can reflect that when required in the rendered page.
For example, the following:
<ifauth @staff style-name>This is secret stuff, only for staff</ifauth>
could be used to enclose the hidden text with a styled DIV.
Just a thought.
Thanks
Hi guys,
I've just switched from ifauth to ifauthex and noticed that the new plugin is not working when trying to hide content added to the page using include plugin (https://www.dokuwiki.org/plugin:include). This is a very popular plugin - could you please fix the integration of ifatuhex with it?
I also attach an example:
<ifauth !@admin>
not see this // --> this content is correctly hidden from admins
{{section>:another_ns:page#section}} // --> this content is not hidden from admins
</ ifauth>
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.