changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / auth / auth_perm_old.php
1 <?php
2
3 /*
4    This auth/permission plugin wraps the two older configuration constants
5    into the newer auth pluginterface. You should however prefer to drop
6    this!
7
8  EWIKI_EDIT_AUTHENTICATE
9      You can cripple ewiki to require authentication per default by
10      setting this constant to 1.
11      This will need a wrapper script (see fragments/homepage.src) which
12      sets $ewiki_author if it detects a registered/logged-in user.
13
14  EWIKI_ALLOW_OVERWRITE
15      You can however pre-define this constant for registered users
16      of yoursite.php. The newly created page will again have the
17      READONLY flag set, so unregistered users won't be able to
18      change the new version as well.
19 */
20
21 //-- overwriting of read-only pages
22 define("EWIKI_ALLOW_OVERWRITE", 0);
23
24 //-- allow to edit a page (if all were locked)
25 define("EWIKI_EDIT_AUTHENTICATE", 0);
26
27
28 $ewiki_plugins["auth_perm"][0] = "ewiki_auth_perm_old";
29
30 function ewiki_auth_perm_old($id, &$data, $action, &$ring) {
31
32    global $ewiki_author;
33
34    if (true) {
35       $ring = 3;
36    }
37
38    if (EWIKI_EDIT_AUTHENTICATE) {
39       if (empty($ewiki_author)) {
40          $ring = 3;
41       }
42       else {
43          $ring = 2;
44       }
45    }
46
47    if (EWIKI_ALLOW_OVERWRITE) {
48       $ring = 1;
49    }
50
51 }
52
53 ?>