|
|
simple usage restrictions via wrappers (a locked PersonalWiki+)The easiest way to cripple a Wiki setup to be browseable-only for the larger public, and to allow only a small subset of users to edit pages is to write two wrapper scripts around the ewiki.php library. One of the wrapper scripts should include and use ewiki as described in the "Integration with yoursite.php" paragraph. You may want to move this wrapper script into a password protected subdirectory (say "/wikiadmin/index.php") or just include("fragments/funcs/auth.php"). Another wrapper script should then be provided for the users that are only allowed to view pages. To disallow editing you'll just have to enrich it with commands like: unset($ewiki_plugins["action"]["edit"]); # disables editing unset($ewiki_plugins["action"]["info"]); # no info/ action unset($ewiki_plugins["page"]["SearchPages"]); # no search function This code must occur after you have 'included("ewiki.php");' the library, but before you call the 'ewiki_page();' function, so the unwanted actions and pages really do not get activated. So far the basic approach. If you however have real user authentication code behind the scenes you probably don't want to maintain two different wrapper scripts. You'll then just put the functionality stripping code from above into an if-clause in "yoursite.php" like: if (! $user_is_logged_in) { unset($ewiki_plugins["action"]); # (you should do it less destructive ;) } Note: this is again an example. DO NOT copy&paste examples and assume they'll work for you!prev << "simple usage restrictions via wrappers (a locked PersonalWiki)" next >> "PhpWiki compatibility" You cannot modify the README file, but anyhow any ideas or suggestion should as usually get filed on BugReports, UserSuggestions or even better the README.Discussion. |