#!/usr/bin/perl # index.cgi # Display all mailing lists and majordomo options require './majordomo-lib.pl'; %access = &get_module_acl(); $conf = &get_config(); eval { require "$config{'program_dir'}/majordomo_version.pl"; }; &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0, &mdom_help(), undef, undef, &text('index_version', $majordomo_version)); &check_mdom_config($conf); # Check for the majordomo aliases $aliases_files = &get_aliases_file(); $email = &find_value("whoami", $conf); $email =~ s/\@.*$//g; $owner = &find_value("whoami_owner", $conf); $owner =~ s/\@.*$//g; @aliases = &foreign_call($aliases_module, "list_aliases", $aliases_files); foreach $a (@aliases) { if ($a->{'enabled'} && lc($a->{'name'}) eq lc($email)) { $majordomo_alias = 1; } if ($a->{'enabled'} && lc($a->{'name'}) eq lc($owner)) { $majordomo_owner = 1; } } # Offer to setup aliases if (!$majordomo_alias) { print ui_alert_box($text{'index_setupdesc'}, "warn"); print ui_form_start("alias_setup.cgi", "post"); if (!$majordomo_owner) { print "$text{'index_owner'}\n"; print ui_textbox("owner", "", 25); print ui_hidden("owner_a", $owner); } print ui_hidden("email_a", $email); print ui_submit($text{'index_setup'}); print ui_form_end(); print &ui_hr(); } # Display active lists @lists = &list_lists($conf); @lists = sort { $a cmp $b } @lists if ($config{'sort_mode'}); map { $lcan{$_}++ } split(/\s+/, $access{'lists'}); # top links local $otherbut, $bcss=' style="display: box; float: left; padding: 10px;"'; if ($access{'create'}) { print "
\n"; } &ui_print_footer("/", $text{'index'});