changed git call from https to git readonly
[atutor.git] / mods / wiki / plugins / spam / watchonly.php
1 <?php
2 /*
3    If spammers and bots only target a few of your pages, you can use
4    this extension to disable most of the antispam plugins for anything
5    but a few pages.
6    
7    List attacked pages on "WatchSpam" or add them to the config array
8    here. Can be combined with other trigger or anti-trigger plugins.
9 */
10
11
12 #-- config
13 //$ewiki_config["watchspam"][] = "AttackedPage";
14 //$ewiki_config["watchspam"][] = "YouSillyBotPleaseEditMe";
15 //...
16
17 $ewiki_plugins["handler"] = "ewiki_trigger_spam_watchonly";
18 function ewiki_trigger_spam_watchonly($id, &$data, &$action, $pf_i) {
19
20    #-- fetch list of tracked pages
21    if ($d = ewiki_db::GET("WatchSpam")) {
22       (array)$ewiki_config["watchspam"] += explode("\n", trim($d["refs"]));
23    }
24    
25    #-- disable all bot-blocking plugins?
26    if (!ewiki_in_array($id, $ewiki_config["watchspam"])) {
27       $GLOBALS["ewiki_no_bot"] = 1;
28    }
29    elseif ($action == "edit") {
30       ewiki_log("someone is {$action}ing specifically watched page '$id'", 2);
31    }
32 }
33
34
35 ?>