Please write down tips you've discovered making it easier for others to make plugins.
I actually had to sit down and fgrep myself to this info, and I hope that it will help others
$this->getConf('namespace');
conf/metadata.php file with field descriptions and a corresponding lang/en/settings.php file holding the language strings for the configuration manager. Refer to configuration metadata for more information.
global $auth;
$auth->retrieveUsers(0,0,$filter);
using '|' as a separator.
$filter['grps']="admin";
$array_of_matches = retrieveUsers(0,0,$filter);
DokuWiki provides a number of global variables that provide information about the current page, current user and the actions being performed. Details of these are provided with the template development information.
Be aware that the directoryname and the classname suffix is the same. So if your plugin is stored in
../plugins/test
Your classnames should be following:
action.php
class action_plugin_test extends DokuWiki_Action_Plugin {
syntax.php
class syntax_plugin_test extends DokuWiki_Syntax_Plugin {
If both strings do not match, the plugin informations will not be shown in the pluginmanager. Also, the plugin name should not contain an underscore! If it does, you have to overwrite the getPluginName method of your plugin.
If you use forms in your plugins, you should include a hidden form field with the session-based security token. In the current of DokuWiki you can generate this field by calling the function formSecurityToken(). Before you process the form input, call checkSecurityToken(). This function checks if the sent security token is correct.
If you wonder, why this will make your plugins more secure, consider the following scenario: You have written a plugin that displays a from to delete several pages at once. An attacker knows you regularly log in to your wiki and you use a site that is under his control. He places an images tag on his page that links to your doku.php and has all the form paramters for deleting pages in the URL. Each time you see the page form the attacker, your browser requests the image from your dokuwiki installation, thereby deleting pages. This attack is called CRoss Site Request forgery.
You can read more about it on http://christ1an.blogspot.com/2007/04/preventing-csrf-efficiently.html