Changeset 110
- Timestamp:
- 02/17/06 16:42:38 (3 years ago)
- Files:
-
- trunk/webmin/lbs_common/debian/changelog (modified) (1 diff)
- trunk/webmin/lbs_common/debian/control (modified) (1 diff)
- trunk/webmin/lbs_common/debian/copyright (modified) (1 diff)
- trunk/webmin/lbs_common/debian/copyversion (modified) (1 diff)
- trunk/webmin/lbs_common/emails.cgi (modified) (1 diff)
- trunk/webmin/lbs_common/emails.info (modified) (1 diff)
- trunk/webmin/lbs_common/emails.info.fr (modified) (1 diff)
- trunk/webmin/lbs_common/emails_save.cgi (modified) (2 diffs)
- trunk/webmin/lbs_common/index.cgi (modified) (3 diffs)
- trunk/webmin/lbs_common/lang/en (modified) (1 diff)
- trunk/webmin/lbs_common/lang/fr (modified) (1 diff)
- trunk/webmin/lbs_common/lbs_common.php (modified) (4 diffs)
- trunk/webmin/lbs_common/lbs_common.pl (modified) (13 diffs)
- trunk/webmin/lbs_common/lbs_common_priv.pl (added)
- trunk/webmin/lbs_common/lbs_perl_gw.pl (modified) (1 diff)
- trunk/webmin/lbs_common/menus/list_of_machines/clients_list/description.ini (modified) (1 diff)
- trunk/webmin/lbs_common/menus/list_of_machines/files_backup (deleted)
- trunk/webmin/lbs_common/menus/list_of_machines/status/files_backup (added)
- trunk/webmin/lbs_common/menus/list_of_machines/status/files_backup/description.ini (added)
- trunk/webmin/lbs_common/menus/list_of_machines/status/inventory (added)
- trunk/webmin/lbs_common/menus/list_of_machines/status/inventory/description.ini (added)
- trunk/webmin/lbs_common/menus/list_of_machines/status/logs (added)
- trunk/webmin/lbs_common/menus/list_of_machines/status/logs/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/custom (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/custom/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/disk (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/disk/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/general (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/general/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/hardware (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/hardware/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/network (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/network/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/peripherals (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/peripherals/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/software (added)
- trunk/webmin/lbs_common/menus/lrs-inventory/software/description.ini (added)
- trunk/webmin/lbs_common/menus/lrs-proxy/description.ini (modified) (1 diff)
- trunk/webmin/lbs_common/menus/lsc (added)
- trunk/webmin/lbs_common/menus/lsc/all_commands (added)
- trunk/webmin/lbs_common/menus/lsc/all_commands/description.ini (added)
- trunk/webmin/lbs_common/menus/lsc/commands_states (added)
- trunk/webmin/lbs_common/menus/lsc/commands_states/description.ini (added)
- trunk/webmin/lbs_common/menus/lsc/description.ini (added)
- trunk/webmin/lbs_common/menus/lsc/exec (added)
- trunk/webmin/lbs_common/menus/lsc/exec/description.ini (added)
- trunk/webmin/lbs_common/menus/lsc/explorer (added)
- trunk/webmin/lbs_common/menus/lsc/explorer/description.ini (added)
- trunk/webmin/lbs_common/menus/lsc/home (added)
- trunk/webmin/lbs_common/menus/lsc/home/description.ini (added)
- trunk/webmin/lbs_common/menus/lsc/repository (added)
- trunk/webmin/lbs_common/menus/lsc/repository/description.ini (added)
- trunk/webmin/lbs_common/menus/remote_control/description.ini (modified) (1 diff)
- trunk/webmin/lbs_common/menus/remote_control/logs (added)
- trunk/webmin/lbs_common/menus/remote_control/logs/description.ini (added)
- trunk/webmin/lbs_common/menus/rsync/description.ini (modified) (1 diff)
- trunk/webmin/lbs_common/module.info (modified) (2 diffs)
- trunk/webmin/lbs_common/php (added)
- trunk/webmin/lbs_common/php/phplib (added)
- trunk/webmin/lbs_common/php/phplib/VERSION (added)
- trunk/webmin/lbs_common/php/phplib/db_msql.inc (added)
- trunk/webmin/lbs_common/php/phplib/db_mysql.inc (added)
- trunk/webmin/lbs_common/php/phplib/db_oci8.inc (added)
- trunk/webmin/lbs_common/php/phplib/db_pgsql.inc (added)
- trunk/webmin/lbs_common/php/phplib/db_usql.inc (added)
- trunk/webmin/lbs_common/php/phplib/sqlquery-eric.inc (added)
- trunk/webmin/lbs_common/php/phplib/sqlquery.inc (added)
- trunk/webmin/lbs_common/php/sshtest.php (added)
- trunk/webmin/lbs_common/web-lib.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/webmin/lbs_common/debian/changelog
r66 r110 1 webmin-lbs-common (1.4. 0) stable; urgency=low1 webmin-lbs-common (1.4.7) stable; urgency=low 2 2 3 3 * New release. See SVN logs for details 4 4 5 -- Linbox <l bs@linbox.com> Wed, 30 Jul 2004 14:32:26 +02005 -- Linbox <libre@linbox.com> Wed, 30 Jul 2004 14:32:26 +0200 6 6 trunk/webmin/lbs_common/debian/control
r3 r110 3 3 Priority: optional 4 4 Build-Depends-Indep: debhelper (>= 4.0) 5 Maintainer: Linbox Team < info@linbox.com>5 Maintainer: Linbox Team <libre@linbox.com> 6 6 Standards-Version: 3.6.1 7 7 trunk/webmin/lbs_common/debian/copyright
r3 r110 1 This package was debianized by Linbox Team < info@linbox.com>1 This package was debianized by Linbox Team <libre@linbox.com> 2 2 on Tue, 17 Feb 2004 12:25:50 +0100 3 3 trunk/webmin/lbs_common/debian/copyversion
r3 r110 1 #!/bin/ sh1 #!/bin/bash 2 2 # 3 3 # Check that debian/changelog and module.info versions are in sync trunk/webmin/lbs_common/emails.cgi
r3 r110 45 45 $conf{'ocsinventory'} = $1; 46 46 } 47 if ($l =~ /^lsc: (.*)/) { 48 $conf{'lsc'} = $1; 49 } 47 50 } 48 51 trunk/webmin/lbs_common/emails.info
r3 r110 4 4 lrs=Email for system backup alerts,0 5 5 ocsinventory=Email for inventory alerts,0 6 lsc=Email for LSC alerts,0 6 7 trunk/webmin/lbs_common/emails.info.fr
r3 r110 4 4 lrs=Email pour les alertes sauvegarde système,0 5 5 ocsinventory=Email pour les alertes inventaire,0 6 lsc=Email pour les alertes LSC,0 6 7 trunk/webmin/lbs_common/emails_save.cgi
r3 r110 20 20 local $lref = &read_file_lines("/etc/aliases"); 21 21 foreach $l (@$lref) { 22 foreach $name ("admin","lrs","ocsinventory","backuppc" ) {22 foreach $name ("admin","lrs","ocsinventory","backuppc","lsc") { 23 23 if ($l =~ /^$name: /i && defined ($conf{$name}) ) { 24 24 if ($conf{$name} ne "") { … … 32 32 } 33 33 # add new aliases at the end of file 34 foreach $name ("admin","lrs","ocsinventory","backuppc" ) {34 foreach $name ("admin","lrs","ocsinventory","backuppc","lsc") { 35 35 if (defined ($conf{$name}) && $conf{$name} ne "") { 36 36 push @$lref, "$name: $conf{$name}"; trunk/webmin/lbs_common/index.cgi
r3 r110 25 25 # get some common functions ... 26 26 require 'lbs_common.pl'; 27 require 'lbs_common_priv.pl'; 27 28 28 29 # ... and vars 29 30 ReadParse(); 30 31 use vars qw (%in %text $root_directory %gconfig $VERSION $LRS_HERE @LRS_MODULES %config); 32 33 # cookies 34 cookie_send_group(%in); 31 35 32 36 # entete … … 36 40 print_html_tabs(['list_of_machines', 'clients_list']); 37 41 42 cookie_get_group(\%in); 43 38 44 # lbs daemon check 39 45 checkfordaemon(); 46 47 # lbs daemon check 48 checkforspace(); 40 49 41 50 # machine list … … 57 66 }, 58 67 \@labelfunctions, 59 \@bodyfunctions 68 \@bodyfunctions, %in 60 69 ); 61 70 trunk/webmin/lbs_common/lang/en
r21 r110 158 158 err_cantlink=Unable to link <tt>$1</tt> with <tt>$2</tt> . 159 159 err_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>. 160 err_space_low=Warning ! Available space in the /var disk is low. You should free some space or some LRS services may fail. 160 161 161 162 index_title=LRS : Control Center trunk/webmin/lbs_common/lang/fr
r21 r110 156 156 err_cantlink=Impossible détablir un lien <tt>$1</tt> avec <tt>$2</tt> . 157 157 err_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>. 158 err_space_low=Attention ! L'espace disponible dans /var est bas. Vous devriez libérer de l'espace ou certains services LRS pourraient mal fonctionner. 158 159 159 160 index_title=LRS : Centre de Contrôle trunk/webmin/lbs_common/lbs_common.php
r3 r110 4 4 # 5 5 6 include_once('../lbs_common/web-lib.php');7 include_once('../lbs_common/template.php');6 require_once(dirname(__FILE__) . "/web-lib.php"); 7 require_once(dirname(__FILE__) . "/template.php"); 8 8 9 9 # perl_exec function, to handle Perl/CGI scripts from PHP … … 11 11 function perl_exec($script, $args=array()) { 12 12 13 global $webmin_path; 14 13 15 $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"); 16 25 17 26 if (!$handle) … … 24 33 $output=explode("\n", $output); # explode it 25 34 26 foreach ($output as $line) # we only keep pure HTML35 foreach ($output as $line) { # we only keep pure HTML 27 36 if (!preg_match("/content-type/i", $line)) 28 37 $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 } 30 46 return $return; 31 47 } … … 383 399 } 384 400 401 # 402 # Return the client list, filtered by group and/or profile 403 # 404 function 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 # 426 function 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 385 450 ?> trunk/webmin/lbs_common/lbs_common.pl
r66 r110 1 1 # $Id$ 2 3 # Including the common functions4 # FIXME: coder les noms des modules en pseudo-dur5 # FIXME: what wabout WOL ? 2 # 3 # Common functions 4 # 5 6 6 use strict; 7 7 … … 16 16 17 17 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; 19 22 open STDERR, ">> /var/lib/lbs/webmin.log"; 20 23 } else { … … 88 91 our $LINBOX_URL = 'http://www.linbox.com'; 89 92 our $BIGLOGO_URL= '/lbs_common/images/logo-big.gif'; 90 our @LRS_MODULES= qw 'lbs_common lbs backuppc lbs-inventory l bs-cd rsync lbs-vnc lrs-proxy lbs/at'; # every modules93 our @LRS_MODULES= qw 'lbs_common lbs backuppc lbs-inventory lrs-inventory lbs-cd rsync lsc lbs-vnc lrs-proxy lbs/at '; # every modules 91 94 #our @LRS_MODULES= qw 'lbs_common lbs'; # every modules 92 95 our $REALPATH = 'readlink'; … … 221 224 ReadParse() if !%in; 222 225 226 223 227 $in{'host'} = $params->{'host'} if !$in{'host'}; 224 228 $in{'mac'} = $params->{'mac'} if !$in{'mac'}; … … 237 241 my %einfo; 238 242 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 } 241 252 } 242 253 … … 248 259 get_hash_from_menu("$ENV{'SERVER_ROOT'}/$module/menus", \%menu) if foreign_check($module); 249 260 } 250 251 261 foreach my $depth (0..3) { # menu have a 3 level depth ? (FIXME) 252 262 my $selected_onglet; … … 520 530 # param 1 : $paramsref: a ref on a hash containning a bunch of parameters 521 531 # return : nothing #FIXME 522 sub print_machines_list {523 my ($paramsref, $headcallbacksref, $bodycallbacksref ) = @_;532 sub print_machines_list($$$$) { 533 my ($paramsref, $headcallbacksref, $bodycallbacksref, %in) = @_; 524 534 525 535 my $home=$TFTPBOOT; … … 733 743 %groups = get_all_groups(0, %ether); 734 744 #if ($LRS_HERE) { %groups = get_all_groups(0, %ether); } 735 745 736 746 $in{group}="" if (!$in{group}); # some init; 737 747 $in{wol}=0 if (!$in{wol}); … … 879 889 $template->parse('mainlist.normalrow'); 880 890 } 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") { 883 893 $template->assign('ACTIONONCURRENTPROF', text('lab_thisprofile', $profile_name)); 884 894 foreach my $bodycallback (@$bodycallbacksref) { … … 893 903 } 894 904 $template->parse('mainlist.endtable.moreactions'); 895 }905 #} 896 906 897 907 $template->parse('mainlist.endtable'); … … 1035 1045 my @lol=(); 1036 1046 my @webminmodules=qw ' lbs lbs-cd lbs_common 1037 lbs-inventory l bs-vncbackuppc';1047 lbs-inventory lrs-inventory lbs-vnc lsc backuppc'; 1038 1048 1039 1049 my @lrsmodules=qw ' backuppc php4-cgi lbs … … 1108 1118 # Check if get client response runs, and output a message if not 1109 1119 # 1110 sub checkfordaemon {1120 sub checkfordaemon () { 1111 1121 if (! -r $config{'lbs_conf'}) { return; } 1112 1122 … … 1117 1127 print "<font size='+2' color='red'><br>"; 1118 1128 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 # 1136 sub 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'}; 1119 1142 print "<br><br></font>"; 1120 1143 } trunk/webmin/lbs_common/lbs_perl_gw.pl
r3 r110 26 26 27 27 our $VERSION='$Rev$'; 28 $VERSION =~ s/\$Rev: (\d+) \$/$module_info{'version'} (r.$1)/;28 $VERSION =~ s/\$Rev: (\d+) \$/$module_info{'version'}/; 29 29 30 30 foreign_require("lbs_common", "lbs_common.pl"); trunk/webmin/lbs_common/menus/list_of_machines/clients_list/description.ini
r3 r110 3 3 4 4 [DESCRIPTION] 5 screen_name_fr = "Liste des Machines"5 screen_name_fr = "Liste des clients" 6 6 screen_name_en = "Clients List" 7 7 require="lbs_common" trunk/webmin/lbs_common/menus/lrs-proxy/description.ini
r3 r110 8 8 9 9 [POSITION] 10 position_number = " 8"10 position_number = "90" 11 11 12 12 [LINK] trunk/webmin/lbs_common/menus/remote_control/description.ini
r3 r110 8 8 9 9 [POSITION] 10 position_number = " 5"10 position_number = "80" 11 11 12 12 [LINK] trunk/webmin/lbs_common/menus/rsync/description.ini
r3 r110 8 8 9 9 [POSITION] 10 position_number = " 6"10 position_number = "20" 11 11 12 12 [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 $ 2 2 desc= LRS : Control Center 3 3 desc_fr= LRS : Centre de Contrôle … … 5 5 name=lbs_common 6 6 depends=0.94 7 version=1.4. 07 version=1.4.7 trunk/webmin/lbs_common/web-lib.php
r44 r110 21 21 $var_directory = getenv("WEBMIN_VAR"); 22 22 $module_name = getenv("SCRIPT_NAME"); 23 list($nul,$module_directory,$_nul)=split("/",$module_name); 23 24 $base_remote_user = getenv("BASE_REMOTE_USER"); 24 25 $remote_user = getenv("REMOTE_USER"); … … 361 362 if(is_dir($file)) 362 363 return -1; 364 if (!file_exists($file)) 365 return -1; 363 366 if(!$fp=fopen($file,"r")) 364 367 return -1; … … 390 393 global $config_directory; 391 394 global $module_name; 395 global $module_directory; 392 396 global $webmin_path; 393 397 global $cb, $tb; … … 397 401 398 402 global $remote_user; 399 400 403 $link_css = "./tmpl/presentation.css"; 401 404 … … 410 413 $GLOBALS["config"]=lib_read_file($config_directory."/".$m."/config"); 411 414 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"); 413 416 //Load language string into associative array named $text 414 417 $GLOBALS["text"]=lib_load_language(); … … 417 420 418 421 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"); 421 424 } 422 425 … … 533 536 function lib_load_language(){ 534 537 //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; 536 539 537 540 // should we backport webmin's @lang_order_list to phpwebmin ?? … … 552 555 //secondly with module text codes: /path/to/webmin-0.91/current_module/lang/current_language 553 556 if($module_name){ 554 $text_mod=lib_read_file( "lang/".$lang);557 $text_mod=lib_read_file(realpath($webmin_path . "/" . $module_directory . "/lang/".$lang)); 555 558 556 559 //fill $text with the content of $text_mod
