778286d06c542d840c7e78cb8b10cc70ca169423
[atutor.git] / mods / wiki / plugins / admin / admintrigger.php
1 <?php
2
3 /*
4    All admin/ plugins depend upon $ewiki_ring==0 to be set, and else
5    refuse to work (so ordinary users cannot damage the database).
6    This is now an examplary trigger which sets that state variable,
7    it compares against the HTTP From: request header field, which is
8    a highly insecure approach for access protection and won't work
9    with current main stream browser (that do not support it). But
10    instead of SERVER_ADMIN you could use a complicated fake email
11    address for example.
12 */
13
14 $server_admin = "passwordlikestring@example.com";
15 $server_admin = $_SERVER["SERVER_ADMIN"];
16
17 if ($_SERVER["HTTP_FROM"] == $server_admin) {
18    $ewiki_ring = 0;
19 }
20
21 ?>