changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / page / wikiuserlogin.php
1 <?php
2
3 /*
4    Allows people to "log in", so the personal WikiUserName gets saved
5    when an edited page gets saved (a bit like 'BogoLogin' in PhpWiki).
6    (no passwords, no real authentication, no _protected_mode)
7 */
8
9
10  $ewiki_plugins["page"]["WikiUserLogin"] = "ewiki_page_wikiuserlogin";
11
12
13  if ($uu = $_REQUEST["wikiauthor"]) {
14     $ewiki_author = $uu;
15  }
16
17
18  function ewiki_page_wikiuserlogin($id, $data, $action) {
19
20     $o .= "<h2>$id</h2>\n";
21
22     if (empty($_GET["wikiauthor"])) {
23        $o .= '
24        <form action="'.ewiki_script("login",$id).'" method="get">
25           your WikiName <input type="text" name="wikiauthor" size="20">
26           <br /><br />
27           <input type="submit" value="log in">
28           <input type="hidden" name="page" value="'.$id.'">
29           <br /><br />
30           <input type="checkbox" name="forever" value="1"> make cookie persistent forever
31        </form>
32        ';
33     }
34     else {
35        $o .= '
36        Your author name is now set to "'.$_GET["wikiauthor"].'". Please go ahead and
37        start editing pages.
38        ';
39        if ($_REQUEST["forever"]) {
40           setcookie("wikiauthor", $_GET["wikiauthor"]);
41        }
42        else {
43           setcookie("wikiauthor", $_GET["wikiauthor"], time()*1.2);
44        }
45     }
46
47     return($o);
48  }
49
50
51 ?>