turnermm / newpagetemplate Goto Github PK
View Code? Open in Web Editor NEWUpdated version of newpagetemplate for handling new template Events
Home Page: http://www.dokuwiki.org/plugin:newpagetemplate
Updated version of newpagetemplate for handling new template Events
Home Page: http://www.dokuwiki.org/plugin:newpagetemplate
See http://php-grinder.com/vulns/view/1193317
$_REQUEST['newpagetemplate'] is output without escaping.
Would you be able to adopt this plugin? After many years with DW I am no longer playing an active role, and I am looking for users to take over my plugins. You can check on GitHub at turnermm.
https://forum.dokuwiki.org/d/21534-retiring
Originally posted by @turnermm in #11 (comment)
Update: Version 2023-10-14
Downloading and updating directly in the wiki does not work.
Looking at the source code, I was a bit confused because the default master branch did not reflect the latest changes.
To avoid that, I would suggest to merge the cli branch into master, or to change the default branch to cli.
Thanks
Messages in DokuWiki deprecated log:
require(action.php) is deprecated. It was called from require() in /var/www/dokuwiki/lib/plugins/newpagetemplate/action.php:20 Autoloading should be used instead!
The plugin eliminates a lot of routine. I really, really hope it's still maintained.
Hello
When I used this plugin at first, I saw the error "You do not have access to the template โฆ" (while logging out from the superuser account)
Then I found that this is because the ACL of the template was 'read' (I don't want to allow users to change the template) and the required permission was 'create' (Line 151 of action.php)
I think that the permission check might be enough with 'AUTH_READ.'
Could you cope with it? (Tell me if there is a security risk I'm overlooking.)
Running Update at the Extension Manager (Dokuwiki Hrun) doesn't update the plugin
Is it a problem of the Dokuwiki? A problem of GitHub? The plugin? Something else?
https://www.dokuwiki.org/plugin:newpagetemplate
Hi!
According to https://www.dokuwiki.org/plugin:addnewpage#new-page_templates the addnewpage plugin enables possibility of inlcuding custom templates via newpagetemplate. Therefore, following syntax results in expected behaviour, because newpagetemplate explicitly does not support @CURNS@
substitution by default as documented:
===== @CURNS@ does not work =====
{{NEWPAGE>:custom:namespace#:custom:template}}
===== @CURNS@ works with default __template.txt =====
{{NEWPAGE>:custom:namespace}}
As described here I manually adapted newpagetemplate to process @CURNS@
replacement according to default namespace templates which is handled inside inc/common.php
.
The adaption inside lib/plugin/newpagetemplate/action.php
: I added the 4 lines between @NS@
and @FILE@
and also 4 lines in array below respectively, currently at line 94. Please note that the $ID
is written in capitals here what is different from default inc/common.php
:
$tpl = str_replace(array(
'@ID@',
'@NS@',
'@CURNS@',
'@!CURNS@',
'@!!CURNS@',
'@!CURNS!@',
'@FILE@',
'@!FILE@',
'@!FILE!@',
'@PAGE@',
'@!PAGE@',
'@!!PAGE@',
'@!PAGE!@',
'@USER@',
'@NAME@',
'@MAIL@',
'@DATE@',
'@EVENT@'
),
array(
$ID,
getNS($ID),
curNS($ID),
\dokuwiki\Utf8\PhpString::ucfirst(curNS($ID)),
\dokuwiki\Utf8\PhpString::ucwords(curNS($ID)),
\dokuwiki\Utf8\PhpString::strtoupper(curNS($ID)),
$file,
utf8_ucfirst($file),
utf8_strtoupper($file),
$page,
utf8_ucfirst($title),
utf8_ucwords($title),
utf8_strtoupper($title),
$_SERVER['REMOTE_USER'],
$INFO['userinfo']['name'],
$INFO['userinfo']['mail'],
$conf['dformat'],
$event->name ,
), $tpl);
So far, this little adaption seems to work as expected. It is of great worth in our school environment as part of our customized dokuwiki.
I am not a php coder (yet) nor this is a real issue. Maybe this quick hack to enable the @CURNS@
functionality could be implemented inside this plugin quite easily.
Anyways, thank you for beautiful software!
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.