aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-02-23 16:52:34 +0000
committerNicolas Vigier <boklm@mageia.org>2013-02-23 16:52:34 +0000
commit859eb6c2ea7b2f1236067e619659bd2857ad2c00 (patch)
tree4545398bb7face910142fea6057483bf07db710f
parent0a0b2dfdb2c70ea255585e506b7ffd92e114a8c5 (diff)
downloadmgapeople-859eb6c2ea7b2f1236067e619659bd2857ad2c00.tar
mgapeople-859eb6c2ea7b2f1236067e619659bd2857ad2c00.tar.gz
mgapeople-859eb6c2ea7b2f1236067e619659bd2857ad2c00.tar.bz2
mgapeople-859eb6c2ea7b2f1236067e619659bd2857ad2c00.tar.xz
mgapeople-859eb6c2ea7b2f1236067e619659bd2857ad2c00.zip
Add index page
-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>