| 1 | package Lemonldap::Cluster::StatusMP; | ||
| 2 | #Copyright (C) 2005 by Eric German, <germanlinux@yahoo.fr> | ||
| 3 | # FILE StatusMP.pm | ||
| 4 | # Lemonldap originaly written by Eric German who decided to publish him in | ||
| 5 | # 2003 under the terms of the GNU General Public License version 2. | ||
| 6 | ######## | ||
| 7 | |||
| 8 | |||
| 9 | use Lemonldap::Cluster::Status; | ||
| 10 | use Apache::Constants qw (:common) ; | ||
| 11 | |||
| 12 | sub handler { | ||
| 13 | my $r = shift; | ||
| 14 | my $p; | ||
| 15 | my %param; | ||
| 16 | $p=$r->args if $r->args ; | ||
| 17 | if ($p) { | ||
| 18 | my @parax = split "&" , $p ; | ||
| 19 | my @pr; | ||
| 20 | foreach (@parax) { | ||
| 21 | (my $cle,my $val) = split "=" , $_; | ||
| 22 | push @pr ,$cle; | ||
| 23 | push @pr, $val; | ||
| 24 | } | ||
| 25 | %param = @pr ; | ||
| 26 | |||
| 27 | } | ||
| 28 | my $conf =$r->dir_config ; | ||
| 29 | my %machine= %{$conf} ; | ||
| 30 | my $re = Lemonldap::Cluster::Status->new ( %machine); | ||
| 31 | $re->analyze; | ||
| 32 | my $a=$re->PrintHtml; | ||
| 33 | if ($param{refresh}) { | ||
| 34 | my $t =$param{refresh}; | ||
| 35 | $r->header_out('refresh',$t); | ||
| 36 | |||
| 37 | } | ||
| 38 | $r->content_type('text/html'); | ||
| 39 | $r->send_http_header; | ||
| 40 | $r->print($a); | ||
| 41 | return OK; | ||
| 42 | |||
| 43 | } | ||
| 44 | 1; | ||
| 45 | |||
| 46 |