—- plugin —- description: Creates users' private namespace and/or public page and redirects them to their own private namespace on login. The pages are base on customizable templates. The current version added the public page feature, a helper and many ACL settings to cover common or uncommon usage. author : Simon Delage email : simon.geekitude@gmail.com type : Action lastupdate : 2015-05-12 compatible : Ponder Stibbons,Hrun depends : conflicts : similar : tags : user, redirect, userpage, private, namespace, public, homepages
downloadurl: https://github.com/geekitude/dokuwiki-plugin-userhomepage/archive/master.zip bugtracker : https://github.com/geekitude/dokuwiki-plugin-userhomepage/issues sourcerepo : https://github.com/geekitude/dokuwiki-plugin-userhomepage/
screenshot_img : http://www.geekitude.fr/externe/dokuwiki/userhomepage/screenshot.jpg
Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.
Important: 2015-02-01's version introduced a crucial change in ACL process to reduce the amount of IO operations on acl.auth.php file and hopefully get rid of a bug that corrupted it from time to time. Please update !
Even if keeping backward compatibility has been a major concern while developing this new version, it is strongly recomended to backup your Dokuwiki (at least conf
folder and data related to users' public pages or private namespaces).
Some options were kept only for backward compatibility but pay extra care to all settings concerning private namespace to make sure you get the same file organisation than with previous version.
A new option [Create Private Namespace] wich is disabled by default will prevent any page creation just after the installation of the new version. Before enabling that option, backup your ACL file (conf/acl.auth.php)
and then remove ACL rules linked to the old version of the plugin.
Note that the old template file is no longer bundled so it can't be overwritten by the new package
If you prefer to stick to old 3.0.4 version, here's a package with only a few fixes to enable saving settings (wich didn't work in the most recent package available) and a minor change on ACL to actually protect the created user namespaces.
user:simon_delage
instead of user:simon
) [default: disabled]start
for the start page of private namespaces (otherwise the same string as the namespace name will be used) [default: enabled]users_namespace
showuseras
setting1)) [default : user]<dokuwiki_data>/pages
will make templates editable from within Dokuwiki, a path like lib/plugins/userhomepage
will prevent any access to them (wich can be seen as an advantage, depending on your vision) and might be usefull to centralize them in a Dokuwiki farm settinglib/plugins/userhomepage/_template.txt
or another path as set in previous version]<dokuwiki_data>/pages
[default : read]<dokuwiki_data>/pages
[default : read]
Right after saving settings, depending on selected options, you will get a success (or error ) message about the creation of the templates:
The plugin uses two templates (userhomepage_private.txt
and userhomepage_public.txt
) that will automatically be created when needed (ie: enabling create_private_ns
or create_public_page
) in the path set in templates_path
setting (from localized source files found in <dokuwiki_plugins>/userhomepage/lang/<language_code> folder). They contain basic informations usefull for users.
Don't edit the localized source files as they will be overwritten by plugin updates
Templates can use any standard template replacement pattern (@NAME@, @USER@, …) and the following specific ones:
Once the templates are set, here's what will happen when a user logs in:
{{pagequery>.*;filter=creator:@NAME@,!ns:user;sort=ns,title}}
will show user's creations{{pagequery>.*;filter=contrib:@NAME@,!ns:user;sort=ns,title}}
will show user's contributions
When possible, the plugin uses wildcards to keep ACL rules as compact as possible.
Here is how they look like for a very short number of users with all settings at their default values:
Note that rules for @user
group only apply if they're different from the equivalent setting for @ALL group.
There will be less ACL rules if the private namespaces are not stored in the same namespace as private page as this enables ACL wildcards on public pages:
But much more if you enable use_name_string
or group_by_name
options as they break ACL wildcards on private namespaces. Moreover, in that case, unlike for public pages, acl for each private namespace will only apply when the given user logs in (wich can be a problem if the pages allready exist).
When a user logs in and didn't requested a specific page (or requested the Wiki start page), he will be redirected to his private namespace start page if it exists (works if Wiki start page is localized).
In facts, a timestamp is stored in PHP $_SESSION variable on log in (under the name uhptimestamp
) and any request to get Wiki start page within 2 seconds after log in will be redirected (this is to ensures that the redirection works even if user logged in through “Remember Me” process). Let me know if the delay should be customizable in settings.
To use the helper, use the following code:
<?php $userhomepage = plugin_load('helper','userhomepage'); if ($userhomepage) echo $userhomepage-><helper_function_call>; ?>
Where you replace the string <helper_function_call>
by one of the following:
showuseras
interwiki link in case public pages are not stored in :user
namespace) (added on 2014/02/23)Please refer to the GitHub issue tracker for reporting issues.
Please use this forum thread or mails.