changed git call from https to git readonly
[atutor.git] / mods / wiki / tools / cron.d / index.php
1 <?php
2 /*
3    An info/admin page, which also allows you to start all the scripts
4    contained herein manually (if you have no real cron service available).
5 */
6   
7   #-- load lib
8   chdir("..");
9   include("t_config.php");
10   chdir(dirname(__FILE__));
11
12   #-- unlock stale lock file, if requested
13   $lock = EWIKI_TMP . "/ewiki-crond-runparts.$_SERVER[SERVER_NAME].lock";
14   if ($_REQUEST["unlock"]) {
15      unlink($lock);
16   }
17
18 ?>
19 <html>
20 <head>
21  <title>cron.d/ centre</title>
22  <link rel="stylesheet" type="text/css" href="../t_config.css">
23  <script type="text/javascript"><!--
24    function show_title(tag) {
25       document.getElementById("titlebox").setAttribute("class", "message");
26       document.getElementById("titlebox").firstChild.data = tag.getAttribute("title");
27    }
28    function hide_box() {
29       box = document.getElementById("titlebox");
30       box.removeAttribute("class");
31       box.firstChild.data = " ";
32    }
33  //--></script>
34 </head>
35 <body bgcolor="#ffffff" text="#000000">
36 <h1>manual cron.d/ run-parts activation</h1>
37
38 <table border="0" cellspacing="10">
39 <tr>
40 <td width="30%" valign="top">
41 <?php
42
43   #-- read in all files
44   $dh = opendir(".");
45   while ($fn = readdir($dh)) {
46      if (preg_match("/^[SKZ]/", $fn)) {
47         $list[$fn[0]][] = $fn;
48      }
49   }
50   closedir($dh);
51
52   #-- and print preview/info list
53   @asort($list["S"]);
54   @arsort($list["Z"]);
55   @arsort($list["K"]);
56   $list = array_merge($list["S"], (array)$list["Z"], (array)$list["K"]);
57   foreach($list as $fn) {
58      $desc = "???";
59      $uu = implode("", file($fn));
60      if (preg_match("#/\*(.+)\*/#s", $uu, $uu)) {
61         $desc = htmlentities($uu[1]);
62      }
63      $size = filesize($fn);
64      echo "<tt title=\"$desc\" onMouseOver=\"show_title(this)\" onMouseOut=\"hide_box()\">$fn</tt> [$size]<br>";
65   }
66
67 ?>
68 </td>
69 <td width="70%" valign="top">
70
71 If you seriously cannot afford a provider with cron support, then you
72 can as last resort start the scripts in the cron.d/ directory by hand.
73 <br>
74 <br>
75
76 <form action="run-parts.php" method="POST" enctype="multipart/form-data" style="display:inline">
77 <input type="submit" value="run-parts">
78 </form>
79
80 <form action="index.php" method="POST" enctype="multipart/form-data" style="display:inline">
81 <input type="submit" name="unlock" value="remove stale lock" style="font-size:10px;" <?php if (!file_exists($lock)) echo "disabled";?>>
82 </form>
83
84 <br>
85 <br>
86 <small>
87 It is safe to leave this open to get started by anyone, because it is already
88 secured against concurrent execution and interruption and after all does
89 nothing what is not configured/wanted anyhow. See also the <a href="HOWTO">
90 HOWTO </a> file for more notes on this.
91 </small>
92
93 <br>
94 <br>
95
96 <div id="titlebox" class="hidden" style="font-size:72%">&nbsp;</div>
97
98 <br>
99
100 </td>
101 </tr>
102 </table>
103
104 <br>
105 <br>
106 <br>
107 <br>
108 </body>
109 </html>