summaryrefslogtreecommitdiff
path: root/admin.php
blob: b20e98efdc1760cecabfb732209f73f6365ffccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?

// temporary permission solution:
if (!$user->id || ($user->permissions != 1 && $user->id > 1)) exit();

include "includes/admin.inc";
include "includes/cron.inc";

// display admin header:
admin_header();

// generate administrator menu:
$handle = opendir("modules");
while ($file = readdir($handle)) {
  if ($filename = substr($file, 0, strpos($file, ".module"))) {
    if ($filename == $mod) {
      $output .= "$filename | ";
    }
    else {
      include_once "modules/$filename.module";
      if ($module["cron"] && !cron_get($filename)) cron_set($filename, 172800); 
      if ($module["admin"]) $output .= "<A HREF=\"admin.php?mod=$filename\">$filename</A> | ";
    }
  }
}
closedir($handle);
  
print "<HR>$output <A HREF=\"\">home</A><HR>";

// display administrator body:
if ($mod) {
  include "modules/$mod.module";
  if ($function = $module["admin"]) $function();
}

// display admin footer:
admin_footer();

?>