Changeset 110

Show
Ignore:
Timestamp:
02/17/06 16:42:38 (3 years ago)
Author:
ludo
Message:

sync with v1.4.7

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/webmin/lbs_common/debian/changelog

    r66 r110  
    1 webmin-lbs-common (1.4.0) stable; urgency=low 
     1webmin-lbs-common (1.4.7) stable; urgency=low 
    22 
    33  * New release. See SVN logs for details 
    44 
    5  -- Linbox <lbs@linbox.com>  Wed, 30 Jul 2004 14:32:26 +0200 
     5 -- Linbox <libre@linbox.com>  Wed, 30 Jul 2004 14:32:26 +0200 
    66 
  • trunk/webmin/lbs_common/debian/control

    r3 r110  
    33Priority: optional 
    44Build-Depends-Indep: debhelper (>= 4.0)  
    5 Maintainer: Linbox Team <info@linbox.com> 
     5Maintainer: Linbox Team <libre@linbox.com> 
    66Standards-Version: 3.6.1 
    77 
  • trunk/webmin/lbs_common/debian/copyright

    r3 r110  
    1 This package was debianized by Linbox Team <info@linbox.com>  
     1This package was debianized by Linbox Team <libre@linbox.com>  
    22on Tue, 17 Feb 2004 12:25:50 +0100 
    33 
  • trunk/webmin/lbs_common/debian/copyversion

    r3 r110  
    1 #!/bin/sh 
     1#!/bin/bash 
    22# 
    33# Check that debian/changelog and module.info versions are in sync 
  • trunk/webmin/lbs_common/emails.cgi

    r3 r110  
    4545        $conf{'ocsinventory'} = $1; 
    4646    } 
     47    if ($l =~ /^lsc: (.*)/) { 
     48        $conf{'lsc'} = $1; 
     49    } 
    4750} 
    4851 
  • trunk/webmin/lbs_common/emails.info

    r3 r110  
    44lrs=Email for system backup alerts,0 
    55ocsinventory=Email for inventory alerts,0 
     6lsc=Email for LSC alerts,0 
    67 
  • trunk/webmin/lbs_common/emails.info.fr

    r3 r110  
    44lrs=Email pour les alertes sauvegarde système,0 
    55ocsinventory=Email pour les alertes inventaire,0 
     6lsc=Email pour les alertes LSC,0 
    67 
  • trunk/webmin/lbs_common/emails_save.cgi

    r3 r110  
    2020local $lref = &read_file_lines("/etc/aliases"); 
    2121foreach $l (@$lref) { 
    22     foreach $name ("admin","lrs","ocsinventory","backuppc") {  
     22    foreach $name ("admin","lrs","ocsinventory","backuppc","lsc") {  
    2323        if ($l =~ /^$name: /i && defined ($conf{$name}) ) { 
    2424            if ($conf{$name} ne "") { 
     
    3232} 
    3333# add new aliases at the end of file 
    34 foreach $name ("admin","lrs","ocsinventory","backuppc") {  
     34foreach $name ("admin","lrs","ocsinventory","backuppc","lsc") {  
    3535    if (defined ($conf{$name}) && $conf{$name} ne "") { 
    3636        push @$lref, "$name: $conf{$name}"; 
  • trunk/webmin/lbs_common/index.cgi

    r3 r110  
    2525# get some common functions ... 
    2626require 'lbs_common.pl'; 
     27require 'lbs_common_priv.pl'; 
    2728 
    2829# ... and vars 
    2930ReadParse(); 
    3031use vars qw (%in %text $root_directory %gconfig $VERSION $LRS_HERE @LRS_MODULES %config); 
     32 
     33# cookies 
     34cookie_send_group(%in); 
    3135 
    3236# entete 
     
    3640print_html_tabs(['list_of_machines', 'clients_list']); 
    3741 
     42cookie_get_group(\%in); 
     43 
    3844# lbs daemon check 
    3945checkfordaemon(); 
     46 
     47# lbs daemon check 
     48checkforspace(); 
    4049 
    4150# machine list 
     
    5766                                }, 
    5867                                \@labelfunctions, 
    59                                 \@bodyfunctions 
     68                                \@bodyfunctions, %in 
    6069                        ); 
    6170 
  • trunk/webmin/lbs_common/lang/en

    r21 r110  
    158158err_cantlink=Unable to link <tt>$1</tt> with <tt>$2</tt> . 
    159159err_gcr_not_running=The 'getClientResponse' or 'lrsd' daemon is not running. You probably have a license problem. Check that your licenses are correct <a href="/lbs/license.cgi">here</a> or restart the LRS service by clicking <a href="/lbs/restart.cgi">here</a>. 
     160err_space_low=Warning ! Available space in the /var disk is low. You should free some space or some LRS services may fail. 
    160161 
    161162index_title=LRS : Control Center 
  • trunk/webmin/lbs_common/lang/fr

    r21 r110  
    156156err_cantlink=Impossible détablir un lien <tt>$1</tt> avec <tt>$2</tt> . 
    157157err_gcr_not_running=Le service 'getClientResponse' ou 'lrsd' ne tourne pas. Vous avez probablement un problème de licence. Vérifiez la validité de votre licence <a href="/lbs/license.cgi">ici</a> ou relancez le service LRS en cliquant <a href="/lbs/restart.cgi">ici</a>. 
     158err_space_low=Attention ! L'espace disponible dans /var est bas. Vous devriez libérer de l'espace ou certains services LRS pourraient mal fonctionner. 
    158159 
    159160index_title=LRS : Centre de Contrôle 
  • trunk/webmin/lbs_common/lbs_common.php

    r3 r110  
    44# 
    55 
    6 include_once('../lbs_common/web-lib.php'); 
    7 include_once('../lbs_common/template.php'); 
     6require_once(dirname(__FILE__) . "/web-lib.php"); 
     7require_once(dirname(__FILE__) . "/template.php"); 
    88 
    99# perl_exec function, to handle Perl/CGI scripts from PHP 
     
    1111function perl_exec($script, $args=array()) { 
    1212 
     13        global $webmin_path; 
     14         
    1315        $return=''; 
    14          
    15         $handle = popen("perl ../lbs_common/".$script. ' "'.join('" "', $args).'" 2>&1', "r"); 
     16        $error=0; 
     17         
     18        if ($webmin_path == "") { 
     19                $path = ".."; 
     20        } else { 
     21                $path = $webmin_path; 
     22        } 
     23         
     24        $handle = popen("cd ".$path."/lbs_common/;perl ".$script. ' "'.join('" "', $args).'" 2>&1', "r"); 
    1625         
    1726        if (!$handle) 
     
    2433        $output=explode("\n", $output);         # explode it 
    2534         
    26         foreach ($output as $line)            # we only keep pure HTML 
     35        foreach ($output as $line) {          # we only keep pure HTML 
    2736                if (!preg_match("/content-type/i", $line)) 
    2837                        $return .= "$line\n"; 
    29                          
     38                if (preg_match("/<\/html>/i", $line)) 
     39                        $error = 1; 
     40        }        
     41        # try to intercept ACL errors 
     42        if ($error == 1 && strpos($script, "lbs_header.cgi") !== false) { 
     43                print $return; 
     44                exit(1); 
     45        } 
    3046        return $return; 
    3147} 
     
    383399} 
    384400 
     401# 
     402# Return the client list, filtered by group and/or profile 
     403# 
     404function filter_machines_names($profile, $group, &$ether) 
     405{ 
     406        normalize_machine_names($ether); 
     407 
     408        $keys = array_keys($ether); 
     409 
     410        for ( $i=0 ; $i<count($keys) ; $i++ ) 
     411        { 
     412                $name = $ether[ $keys[$i] ]['name'] ; 
     413 
     414                if ( ! ( eregi("$profile:$group", $name) 
     415                         || ( empty($profile) && eregi("(:|/)$group/", $name) ) 
     416                         || ( empty($group) && eregi("^$profile:", $name) )  ) ) 
     417 
     418                        unset($ether[ $keys[$i] ]); 
     419 
     420        } 
     421} 
     422 
     423# 
     424# clean up the client list:  
     425# 
     426function normalize_machine_names(&$ether) 
     427{ 
     428        $keys = array_keys($ether); 
     429 
     430        for ( $i=0 ; $i<count($keys) ; $i++ ) 
     431        { 
     432                $name = & $ether[ $keys[$i] ]['name'] ; 
     433 
     434                $profilepos = strpos($name, ':'); 
     435 
     436                if ( strpos($name, ':')===false ) 
     437                { 
     438                        $profilepos = 0; 
     439                        $name = ':'. $name; 
     440                } 
     441 
     442                if ( strpos($name, '/', $profilepos+1)===false ) 
     443 
     444                        $name = substr($name,0,$profilepos+1) . '/' . substr($name,$profilepos+1); 
     445 
     446        } 
     447 
     448} 
     449 
    385450?> 
  • trunk/webmin/lbs_common/lbs_common.pl

    r66 r110  
    11# $Id$ 
    2  
    3 # Including the common functions 
    4 # FIXME: coder les noms des modules en pseudo-dur 
    5 # FIXME: what wabout WOL ? 
     2
     3# Common functions 
     4# 
     5 
    66use strict; 
    77 
     
    1616 
    1717        if (-r "/var/lib/lbs/webmin.log") { 
    18                 system("echo \"===`date`\" >> /var/lib/lbs/webmin.log");  
     18                my $time = localtime; 
     19                open FID, ">>/var/lib/lbs/webmin.log"; 
     20                print FID "=== $time \n";  
     21                close FID; 
    1922                open STDERR, ">> /var/lib/lbs/webmin.log"; 
    2023        } else { 
     
    8891our $LINBOX_URL = 'http://www.linbox.com'; 
    8992our $BIGLOGO_URL= '/lbs_common/images/logo-big.gif'; 
    90 our @LRS_MODULES= qw 'lbs_common lbs backuppc lbs-inventory lbs-cd  rsync lbs-vnc lrs-proxy lbs/at';      # every modules 
     93our @LRS_MODULES= qw 'lbs_common lbs backuppc lbs-inventory lrs-inventory lbs-cd  rsync lsc lbs-vnc lrs-proxy lbs/at ';      # every modules 
    9194#our @LRS_MODULES= qw 'lbs_common lbs';      # every modules 
    9295our $REALPATH   = 'readlink'; 
     
    221224ReadParse()             if !%in; 
    222225 
     226 
    223227$in{'host'}             = $params->{'host'}     if !$in{'host'}; 
    224228$in{'mac'}              = $params->{'mac'}      if !$in{'mac'}; 
     
    237241                my %einfo; 
    238242                my $etherfile = "$lbsconf{'basedir'}/etc/ether"; 
    239                 main::etherLoad( $etherfile, \%einfo); 
    240                 $in{'mac'} = main::etherGetMacByName(\%einfo, $host, 1); 
     243 
     244                # ouch ! problems with namespaces when called from php ! 
     245                if (*etherLoad{CODE}) { 
     246                        etherLoad( $etherfile, \%einfo) ; 
     247                        $in{'mac'} = etherGetMacByName(\%einfo, $host, 1); 
     248                } else { 
     249                        main::etherLoad( $etherfile, \%einfo) ; 
     250                        $in{'mac'} = main::etherGetMacByName(\%einfo, $host, 1); 
     251                } 
    241252        } 
    242253 
     
    248259                get_hash_from_menu("$ENV{'SERVER_ROOT'}/$module/menus", \%menu) if foreign_check($module); 
    249260        } 
    250          
    251261        foreach my $depth (0..3) {                                                                      # menu have a 3 level depth ? (FIXME) 
    252262                my $selected_onglet; 
     
    520530# param 1 : $paramsref: a ref on a hash containning a bunch of parameters 
    521531# return : nothing #FIXME 
    522 sub print_machines_list
    523         my ($paramsref, $headcallbacksref, $bodycallbacksref) = @_; 
     532sub print_machines_list($$$$)
     533        my ($paramsref, $headcallbacksref, $bodycallbacksref, %in) = @_; 
    524534 
    525535        my $home=$TFTPBOOT; 
     
    733743        %groups = get_all_groups(0, %ether); 
    734744        #if ($LRS_HERE) { %groups = get_all_groups(0, %ether); } 
    735          
     745 
    736746        $in{group}=""   if (!$in{group});                               # some init; 
    737747        $in{wol}=0      if (!$in{wol}); 
     
    879889                $template->parse('mainlist.normalrow'); 
    880890        } 
    881          
    882         if (lc($profile_key) ne "none" and lc($profile_key) ne "all") { 
     891 
     892        #if (lc($profile_key) ne "none" and lc($profile_key) ne "all") { 
    883893                $template->assign('ACTIONONCURRENTPROF', text('lab_thisprofile', $profile_name)); 
    884894                foreach my $bodycallback (@$bodycallbacksref) { 
     
    893903                } 
    894904                $template->parse('mainlist.endtable.moreactions'); 
    895        
     905        #
    896906         
    897907        $template->parse('mainlist.endtable'); 
     
    10351045my @lol=(); 
    10361046my @webminmodules=qw '  lbs             lbs-cd          lbs_common 
    1037                         lbs-inventory   lbs-vnc         backuppc'; 
     1047                        lbs-inventory   lrs-inventory  lbs-vnc         lsc             backuppc'; 
    10381048 
    10391049my @lrsmodules=qw '     backuppc        php4-cgi        lbs 
     
    11081118# Check if get client response runs, and output a message if not 
    11091119# 
    1110 sub checkfordaemon
     1120sub checkfordaemon ()
    11111121    if (! -r $config{'lbs_conf'}) { return; } 
    11121122         
     
    11171127            print "<font size='+2' color='red'><br>"; 
    11181128            print $text{'err_gcr_not_running'}; 
     1129            print "<br><br></font>"; 
     1130        } 
     1131} 
     1132 
     1133# 
     1134# Check if there's at least 100MB in /var 
     1135# 
     1136sub checkforspace () { 
     1137    my $run = `df -m /var|tail -1|awk '{print \$4}'`; 
     1138    if ($run < 100) 
     1139        { 
     1140            print "<font size='+2' color='red'><br>"; 
     1141            print $text{'err_space_low'}; 
    11191142            print "<br><br></font>"; 
    11201143        } 
  • trunk/webmin/lbs_common/lbs_perl_gw.pl

    r3 r110  
    2626 
    2727our $VERSION='$Rev$'; 
    28 $VERSION =~ s/\$Rev: (\d+) \$/$module_info{'version'} (r.$1)/; 
     28$VERSION =~ s/\$Rev: (\d+) \$/$module_info{'version'}/; 
    2929 
    3030foreign_require("lbs_common", "lbs_common.pl"); 
  • trunk/webmin/lbs_common/menus/list_of_machines/clients_list/description.ini

    r3 r110  
    33 
    44[DESCRIPTION] 
    5 screen_name_fr = "Liste des Machines" 
     5screen_name_fr = "Liste des clients" 
    66screen_name_en = "Clients List" 
    77require="lbs_common" 
  • trunk/webmin/lbs_common/menus/lrs-proxy/description.ini

    r3 r110  
    88 
    99[POSITION] 
    10 position_number = "8
     10position_number = "90
    1111 
    1212[LINK] 
  • trunk/webmin/lbs_common/menus/remote_control/description.ini

    r3 r110  
    88 
    99[POSITION] 
    10 position_number = "5
     10position_number = "80
    1111 
    1212[LINK] 
  • trunk/webmin/lbs_common/menus/rsync/description.ini

    r3 r110  
    88 
    99[POSITION] 
    10 position_number = "6
     10position_number = "20
    1111 
    1212[LINK] 
  • trunk/webmin/lbs_common/module.info

    r66 r110  
    1 -e -e # $Id: module.info,v 1.2 2004/05/12 14:43:55 nicolas Exp $ 
     1# $Id: module.info,v 1.2 2004/05/12 14:43:55 nicolas Exp $ 
    22desc=&nbsp;LRS : Control Center&nbsp; 
    33desc_fr=&nbsp;LRS : Centre de Contrôle&nbsp; 
     
    55name=lbs_common 
    66depends=0.94 
    7 version=1.4.0 
     7version=1.4.7 
  • trunk/webmin/lbs_common/web-lib.php

    r44 r110  
    2121$var_directory = getenv("WEBMIN_VAR"); 
    2222$module_name = getenv("SCRIPT_NAME"); 
     23list($nul,$module_directory,$_nul)=split("/",$module_name); 
    2324$base_remote_user = getenv("BASE_REMOTE_USER"); 
    2425$remote_user = getenv("REMOTE_USER"); 
     
    361362  if(is_dir($file)) 
    362363    return -1; 
     364  if (!file_exists($file)) 
     365          return -1; 
    363366  if(!$fp=fopen($file,"r"))  
    364367    return -1; 
     
    390393  global $config_directory; 
    391394  global $module_name; 
     395  global $module_directory; 
    392396  global $webmin_path; 
    393397  global $cb, $tb; 
     
    397401   
    398402  global $remote_user; 
    399  
    400403  $link_css = "./tmpl/presentation.css"; 
    401404 
     
    410413  $GLOBALS["config"]=lib_read_file($config_directory."/".$m."/config"); 
    411414   
    412   $GLOBALS["module_info"]=lib_read_file($webmin_path."/".$m."/module.info"); 
     415  $GLOBALS["module_info"]=lib_read_file($webmin_path."/".$module_directory."/module.info"); 
    413416  //Load language string into associative array named $text 
    414417  $GLOBALS["text"]=lib_load_language(); 
     
    417420 
    418421  if($theme){ 
    419     $tconfig = lib_read_file($module_name ? "../$theme/config" 
    420                                       :"../$theme/config"); 
     422    $tconfig = lib_read_file($module_name ? $webmin_path . "/" . $theme . "/config" 
     423                                      : $webmin_path . "../" . $theme . "/config"); 
    421424  } 
    422425 
     
    533536function lib_load_language(){ 
    534537        //Global variables used in this module   
    535         global $webmin_path, $gconfig, $module_name, $remote_user
     538        global $webmin_path, $gconfig, $module_name, $remote_user, $module_directory
    536539         
    537540        // should we backport webmin's @lang_order_list to phpwebmin ?? 
     
    552555        //secondly with module text codes: /path/to/webmin-0.91/current_module/lang/current_language 
    553556        if($module_name){ 
    554                 $text_mod=lib_read_file("lang/".$lang); 
     557                $text_mod=lib_read_file(realpath($webmin_path . "/" . $module_directory . "/lang/".$lang)); 
    555558         
    556559                //fill $text with the content of $text_mod