aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmkpeople15
-rw-r--r--tmpl/index.html13
2 files changed, 28 insertions, 0 deletions
diff --git a/mkpeople b/mkpeople
index 9e782b1..cd21239 100755
--- a/mkpeople
+++ b/mkpeople
@@ -98,6 +98,20 @@ sub output_groups {
$template->process("groupindex.$extension", $vars, "index.$extension");
}
+sub output_index {
+ my ($extension) = @_;
+ my $template = Template->new({
+ INCLUDE_PATH => $config->{tmpl_dir},
+ OUTPUT_PATH => "$config->{output_dir}",
+ });
+ my $vars = {
+ config => $config,
+ users => \%users,
+ groups => \%groups,
+ };
+ $template->process("index.$extension", $vars, "index.$extension");
+}
+
my $bindpw = read_file($config->{bindpwfile});
chomp $bindpw;
my $ldap = Net::LDAP->new($config->{ldapserver}) or die "$@";
@@ -109,3 +123,4 @@ die $m->error if $m->is_error;
loadgroups($ldap);
output_users('html');
output_groups('html');
+output_index('html');
diff --git a/tmpl/index.html b/tmpl/index.html
new file mode 100644
index 0000000..14d155d
--- /dev/null
+++ b/tmpl/index.html
@@ -0,0 +1,13 @@
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>[% config.sitename %]</title>
+ </head>
+ <body>
+ <h1>[% config.sitename %]</h1>
+
+ <h2><a href="g/">Groups</a></h2>
+
+ <h2><a href="u/">Users</a></h2>
+ </body>
+</html>