changed git call from https to git readonly
[atutor.git] / mods / wiki / doc / ReadOnlyWiki
1
2 If you want a read-only Wiki for the public, then there is an easy method
3 with which you can do that without having to use any ewiki ProtectedMode
4 plugins.
5
6 You just create two "wrappers". One which allows doesn't allow write
7 access, and a second which does (with prior HTTP login then of course).
8 There is also a section in the README which explains this.
9
10
11 a locked personal Wiki, without ProtectedMode
12 ---------------------------------------------
13
14 Using a Wiki to create a personal homepage is of course also possible. It is
15 just a convinience to use the easy Wiki technics as backend, instead of a
16 bloated and complicated CMS like PhpNuke or so.
17
18 It was also possible to add an overall Wiki lock, and then to afterwards
19 some pages as _WRITEABLE by the public. Though currently that code 
20 (see ==plugings/auth/perm_old.php==) is still to be overhauled.
21
22 -----
23
24 The ==ewiki.php== script basically is some sort of library, and it is
25 possible to build multiple frontends to your Wiki (like the scripts in our
26 examples/ directory). This not only allows to have multiple layouts
27 available, but also to have each with a different feature set.
28
29 A ''different feature set'' then could also mean, that you have one wrapper
30 for the public (which for example wouldn't allow editing), and a second for
31 yourself, which did (but then required a password; see also
32 [fragments/funcs/auth.php]). This is useful, if you want a PersonalWiki.
33
34
35 a sample public wrapper, that forbids editing
36 ---------------------------------------------
37
38 <code>
39 <?php
40    define("EWIKI_SCRIPT", "public.php?id=");
41    include("config.php");
42    // or   include("ewiki.php");
43
44    #-- disallow some stuff, you wouldn't want visitors to do
45    unset($ewiki_plugins["action"]["edit"]);
46    unset($ewiki_plugins["action"]["info"]);
47 ?>
48 ...
49 <body>
50   <?php
51        #-- output page content
52        echo ewiki_page();  
53   ?>
54 </body>
55 ...
56 </code>
57
58 Often you would want to call this (see EWIKI_SCRIPT) file then "index.php"
59 instead.
60
61
62
63 your unrestricted personal wrapper
64 ----------------------------------
65
66 The wrapper which allows editing of course should be protected with a login.
67
68 <code>
69 <?php
70    define("EWIKI_SCRIPT", "admin.php?id=");
71    include("config.php");  // or   include("ewiki.php");
72    #-- add some admin stuff
73    include("plugins/admin/page_searchandreplace.php");
74    #-- require a password
75    include("fragments/funcs/auth.php");
76 ?>
77 ...
78 <?php
79    echo ewiki_page();
80 ?>
81 ...
82 </code>
83
84 Please note, the different setting for EWIKI_SCRIPT here. It is not
85 necessary to keep the name "admin.php" script secret, because it is
86 already protected by HTTP auth (see the ==.../auth.php== script).
87