Changeset 250
- Timestamp:
- 06/05/07 17:10:46 (1 year ago)
- Files:
-
- trunk/webmin/lsc/command_detail.php (modified) (3 diffs)
- trunk/webmin/lsc/command_history_detail.php (modified) (3 diffs)
- trunk/webmin/lsc/command_on_host_detail.php (modified) (8 diffs)
- trunk/webmin/lsc/connection_error.cgi (modified) (2 diffs)
- trunk/webmin/lsc/include/command_launcher.inc.php (modified) (6 diffs)
- trunk/webmin/lsc/include/commands.inc.php (modified) (1 diff)
- trunk/webmin/lsc/include/commands_on_host.inc.php (modified) (6 diffs)
- trunk/webmin/lsc/include/exec.inc.php (modified) (3 diffs)
- trunk/webmin/lsc/include/file.inc.php (modified) (1 diff)
- trunk/webmin/lsc/include/scheduler.inc.php (modified) (1 diff)
- trunk/webmin/lsc/include/ssh.inc.php (modified) (7 diffs)
- trunk/webmin/lsc/include/widget.inc.php (modified) (3 diffs)
- trunk/webmin/lsc/killparent.sh (added)
- trunk/webmin/lsc/lang/en (modified) (1 diff)
- trunk/webmin/lsc/lang/fr (modified) (1 diff)
- trunk/webmin/lsc/open_session.inc.php (modified) (2 diffs)
- trunk/webmin/lsc/repository.cgi (modified) (5 diffs)
- trunk/webmin/lsc/start_command_on_host.php (modified) (1 diff)
- trunk/webmin/lsc/tmpl/en/command_detail_page.tpl (modified) (3 diffs)
- trunk/webmin/lsc/tmpl/en/command_on_host_detail_page.tpl (modified) (4 diffs)
- trunk/webmin/lsc/tmpl/en/connection_error_page.tpl (modified) (1 diff)
- trunk/webmin/lsc/tmpl/en/home_group_and_profile_page.tpl (modified) (1 diff)
- trunk/webmin/lsc/tmpl/en/home_one_host_page.tpl (modified) (2 diffs)
- trunk/webmin/lsc/tmpl/en/widget_where_I_m_connected.tpl (modified) (1 diff)
- trunk/webmin/lsc/tmpl/en/widget_where_I_m_connected_group_and_profile.tpl (modified) (1 diff)
- trunk/webmin/lsc/tmpl/fr/command_detail_page.tpl (modified) (2 diffs)
- trunk/webmin/lsc/tmpl/fr/command_on_host_detail_page.tpl (modified) (3 diffs)
- trunk/webmin/lsc/tmpl/fr/home_one_host_page.tpl (modified) (2 diffs)
- trunk/webmin/lsc/xprobe_safe (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/webmin/lsc/command_detail.php
r227 r250 78 78 */ 79 79 $query="SELECT 80 DATE_FORMAT(date_created, '%d-%m-%Y à%H:%i:%s'),81 DATE_FORMAT(start_date, '%d-%m-%Y à%H:%i:%s'),82 DATE_FORMAT(end_date, '%d-%m-%Y à%H:%i:%s'),80 DATE_FORMAT(date_created, '%d-%m-%Y %H:%i:%s'), 81 DATE_FORMAT(start_date, '%d-%m-%Y %H:%i:%s'), 82 DATE_FORMAT(end_date, '%d-%m-%Y %H:%i:%s'), 83 83 title, 84 84 start_file, … … 121 121 $template->set_var("COMMAND_PATH_SOURCE",$database->f("path_source")); 122 122 if ($database->f("create_directory")=="enable") { 123 $template->set_var("COMMAND_CREATE_DIRECTORY", "oui");124 } else { 125 $template->set_var("COMMAND_CREATE_DIRECTORY", "non");123 $template->set_var("COMMAND_CREATE_DIRECTORY",$text{"yes"}); 124 } else { 125 $template->set_var("COMMAND_CREATE_DIRECTORY",$text{"no"}); 126 126 } 127 127 128 128 if ($database->f("start_script")=="enable") { 129 $template->set_var("COMMAND_START_SCRIPT", "oui");130 } else { 131 $template->set_var("COMMAND_START_SCRIPT", "non");129 $template->set_var("COMMAND_START_SCRIPT", $text{"yes"}); 130 } else { 131 $template->set_var("COMMAND_START_SCRIPT", $text{"no"}); 132 132 } 133 133 … … 146 146 147 147 if ($database->f("start_inventory")=="enable") { 148 $template->set_var("COMMAND_START_INVENTORY", "oui");149 } else { 150 $template->set_var("COMMAND_START_INVENTORY", "non");148 $template->set_var("COMMAND_START_INVENTORY",$text{"yes"}); 149 } else { 150 $template->set_var("COMMAND_START_INVENTORY",$text{"no"}); 151 151 } 152 152 153 153 if ($database->f("wake_on_lan")=="enable") { 154 $template->set_var("COMMAND_WAKE_ON_LAN", "oui");155 } else { 156 $template->set_var("COMMAND_WAKE_ON_LAN", "non");154 $template->set_var("COMMAND_WAKE_ON_LAN",$text{"yes"}); 155 } else { 156 $template->set_var("COMMAND_WAKE_ON_LAN",$text{"no"}); 157 157 } 158 158 trunk/webmin/lsc/command_history_detail.php
r227 r250 83 83 */ 84 84 $query="SELECT 85 DATE_FORMAT(date_created, '%d-%m-%Y à%H:%i:%s'),86 DATE_FORMAT(start_date, '%d-%m-%Y à%H:%i:%s'),87 DATE_FORMAT(end_date, '%d-%m-%Y à%H:%i:%s'),85 DATE_FORMAT(date_created, '%d-%m-%Y %H:%i:%s'), 86 DATE_FORMAT(start_date, '%d-%m-%Y %H:%i:%s'), 87 DATE_FORMAT(end_date, '%d-%m-%Y %H:%i:%s'), 88 88 title, 89 89 start_file, … … 124 124 $template->set_var("COMMAND_PATH_SOURCE",$database->f("path_source")); 125 125 if ($database->f("create_directory")=="enable") { 126 $template->set_var("COMMAND_CREATE_DIRECTORY", "oui");127 } else { 128 $template->set_var("COMMAND_CREATE_DIRECTORY", "non");126 $template->set_var("COMMAND_CREATE_DIRECTORY",$text{"yes"}); 127 } else { 128 $template->set_var("COMMAND_CREATE_DIRECTORY",$text{"no"}); 129 129 } 130 130 131 131 if ($database->f("start_script")=="enable") { 132 $template->set_var("COMMAND_START_SCRIPT", "oui");133 } else { 134 $template->set_var("COMMAND_START_SCRIPT", "non");132 $template->set_var("COMMAND_START_SCRIPT", $text{"yes"}); 133 } else { 134 $template->set_var("COMMAND_START_SCRIPT", $text{"no"}); 135 135 } 136 136 … … 149 149 150 150 if ($database->f("start_inventory")=="enable") { 151 $template->set_var("COMMAND_START_INVENTORY", "oui");152 } else { 153 $template->set_var("COMMAND_START_INVENTORY", "non");151 $template->set_var("COMMAND_START_INVENTORY",$text{"yes"}); 152 } else { 153 $template->set_var("COMMAND_START_INVENTORY",$text{"no"}); 154 154 } 155 155 156 156 if ($database->f("wake_on_lan")=="enable") { 157 $template->set_var("COMMAND_WAKE_ON_LAN", "oui");158 } else { 159 $template->set_var("COMMAND_WAKE_ON_LAN", "non");157 $template->set_var("COMMAND_WAKE_ON_LAN",$text{"yes"}); 158 } else { 159 $template->set_var("COMMAND_WAKE_ON_LAN",$text{"no"}); 160 160 } 161 161 trunk/webmin/lsc/command_on_host_detail.php
r227 r250 85 85 SELECT 86 86 id_command, 87 DATE_FORMAT(next_launch_date, '%d-%m-%Y %H:%i:%s'), 87 88 current_state, 88 89 uploaded, 89 90 executed, 90 91 deleted, 91 host 92 host, 93 number_attempt_connection_remains 92 94 FROM 93 95 ".COMMANDS_ON_HOST_TABLE." … … 123 125 } 124 126 127 $template->set_var("COMMAND_RUN_DATE", $database->f(1)); 125 128 $template->set_var("UPLOADED_ICON", return_icon($database->f("uploaded"))); 126 129 $template->set_var("EXECUTED_ICON", return_icon($database->f("executed"))); … … 129 132 $template->set_var("EXECUTED", $text[$database->f("executed")]); 130 133 $template->set_var("DELETED", $text[$database->f("deleted")]); 134 $template->set_var("ATTEMPTS", $database->f("number_attempt_connection_remains")); 131 135 132 136 switch ($database->f("current_state")) { … … 228 232 */ 229 233 $query="SELECT 230 DATE_FORMAT(date_created, '%d-%m-%Y à%H:%i:%s'),231 DATE_FORMAT(start_date, '%d-%m-%Y à%H:%i:%s'),232 DATE_FORMAT(end_date, '%d-%m-%Y à%H:%i:%s'),234 DATE_FORMAT(date_created, '%d-%m-%Y %H:%i:%s'), 235 DATE_FORMAT(start_date, '%d-%m-%Y %H:%i:%s'), 236 DATE_FORMAT(end_date, '%d-%m-%Y %H:%i:%s'), 233 237 title, 234 238 start_file, … … 249 253 webmin_username 250 254 FROM 251 ".COMMANDS_TABLE." 255 ".COMMANDS_TABLE." 252 256 WHERE 253 id_command=\"".$id_command."\" 257 id_command=\"".$id_command."\" 254 258 "; 255 259 … … 272 276 $template->set_var("COMMAND_PATH_SOURCE",$database->f("path_source")); 273 277 if ($database->f("create_directory")=="enable") { 274 $template->set_var("COMMAND_CREATE_DIRECTORY", "oui");275 } else { 276 $template->set_var("COMMAND_CREATE_DIRECTORY", "non");278 $template->set_var("COMMAND_CREATE_DIRECTORY",$text{"yes"}); 279 } else { 280 $template->set_var("COMMAND_CREATE_DIRECTORY",$text{"no"}); 277 281 } 278 282 279 283 if ($database->f("start_script")=="enable") { 280 $template->set_var("COMMAND_START_SCRIPT", "oui");281 } else { 282 $template->set_var("COMMAND_START_SCRIPT", "non");284 $template->set_var("COMMAND_START_SCRIPT", $text{"yes"}); 285 } else { 286 $template->set_var("COMMAND_START_SCRIPT", $text{"no"}); 283 287 } 284 288 … … 294 298 $template->set_var("COMMAND_END_DATE",$database->f(2)); 295 299 } 300 296 301 $template->set_var("COMMAND_TARGET",$database->f("target")); 297 302 298 303 if ($database->f("start_inventory")=="enable") { 299 $template->set_var("COMMAND_START_INVENTORY", "oui");300 } else { 301 $template->set_var("COMMAND_START_INVENTORY", "non");304 $template->set_var("COMMAND_START_INVENTORY",$text{"yes"}); 305 } else { 306 $template->set_var("COMMAND_START_INVENTORY",$text{"no"}); 302 307 } 303 308 304 309 if ($database->f("wake_on_lan")=="enable") { 305 $template->set_var("COMMAND_WAKE_ON_LAN", "oui");306 } else { 307 $template->set_var("COMMAND_WAKE_ON_LAN", "non");310 $template->set_var("COMMAND_WAKE_ON_LAN",$text{"yes"}); 311 } else { 312 $template->set_var("COMMAND_WAKE_ON_LAN",$text{"no"}); 308 313 } 309 314 … … 344 349 SELECT 345 350 id_command_history, 346 DATE_FORMAT(date, '%d-%m-%Y Ã%H:%i:%s') as date,351 DATE_FORMAT(date, '%d-%m-%Y %H:%i:%s') as date, 347 352 state, 348 353 stderr, trunk/webmin/lsc/connection_error.cgi
r227 r250 40 40 41 41 if ($session->ping_error) { 42 $template->set_var("PING", "échec");43 $template->set_var("TEST_SSH", "non testé");44 $template->set_var("TEST_AUTOFS", "non testé");42 $template->set_var("PING", $text{"failed"}); 43 $template->set_var("TEST_SSH", $text{"not_tested"}); 44 $template->set_var("TEST_AUTOFS", $text{"not_tested"}); 45 45 $template->set_var("SSH_COMMAND", ""); 46 46 $template->set_var("SSH_RETURN_VAL", ""); … … 48 48 49 49 } else { 50 $template->set_var("PING", "succès");50 $template->set_var("PING", $text{"success"}); 51 51 if ($session->error_ssh_failed) { 52 $template->set_var("TEST_SSH", "échec");53 $template->set_var("TEST_AUTOFS", "non testé");52 $template->set_var("TEST_SSH", $text{"failed"}); 53 $template->set_var("TEST_AUTOFS", $text{"not_tested"}); 54 54 } else { 55 $template->set_var("TEST_SSH", "succès");55 $template->set_var("TEST_SSH", $text{"success"}); 56 56 57 if ($session->error_autofs_failed) $template->set_var("TEST_AUTOFS", "échec");58 else $template->set_var("TEST_AUTOFS", "succès");57 if ($session->error_autofs_failed) $template->set_var("TEST_AUTOFS", $text{"failed"}); 58 else $template->set_var("TEST_AUTOFS", $text{"success"}); 59 59 } 60 60 trunk/webmin/lsc/include/command_launcher.inc.php
r238 r250 187 187 188 188 // Launch $start_command 189 190 189 unset($output);unset($return_var);unset($return_var);unset($stdout);unset($stderr); 191 190 lsc_ssh( … … 394 393 return; 395 394 } 395 } 396 397 /* No OS detected yet, let's retry */ 398 if ($this->command->path_destination == "") { 399 debug(2, "LSC_Command_Launcher->execute: os detect"); 400 $this->session->initialize_os_type(); 401 $this->command->path_destination = $this->session->tmp_path; 402 debug(2, "LSC_Command_Launcher->execute: path=".$this->session->tmp_path); 396 403 } 397 404 … … 536 543 lsc_command_on_host_set_current_state($this->id_command_on_host, "done"); 537 544 } 545 546 /* handle repeats */ 547 $this->repeat_resched(); 538 548 } 539 549 … … 551 561 552 562 $mac = get_mac_address_from_full_hostname($this->command_on_host->host); 553 563 $coh = $this->command_on_host; 564 554 565 if ( $mac != "" ) { 555 $remains_connection_attempt = lsc_command_on_host_get_remains_connection_attempt($this->id_command_on_host);566 $remains_connection_attempt = $coh->number_attempt_connection_remains; 556 567 while($remains_connection_attempt > 0) { 557 $this->command_on_host->refresh(); 558 559 if ( 560 ($this->command_on_host->current_state=="stop") || 561 ($this->command_on_host->current_state=="pause") 562 ) { 568 $coh->refresh(); 569 570 if ( ($coh->current_state=="stop") || 571 ($coh->current_state=="pause")) { 563 572 return 0; 564 573 } … … 634 643 if ($this->command_on_host->next_launch_date == "0000-00-00 00:00:00") { 635 644 lsc_command_on_host_set_next_launch_date($this->id_command_on_host, date("Y-m-d H:i:s")); 645 } 646 647 if ($remains_connection_attempt > 0) { 648 /* more attempts: schedule a retry */ 649 $coh->update_next_launch_date( 650 "next_launch_date + interval ".intval($this->command->next_connection_delay)." minute" 651 ); 652 } else { 653 /* no more attempts remaining, check if periodic */ 654 $this->repeat_resched(); 636 655 } 637 638 lsc_command_on_host_adjust_next_launch_date( 639 $this->id_command_on_host, 640 "+ interval ".$this->command->next_connection_delay." minute" 641 ); 642 656 643 657 return -1; 644 658 … … 668 682 } 669 683 684 /* check if a task is periodic, and reschedule it */ 685 function repeat_resched() 686 { 687 $coh = $this->command_on_host; 688 689 if ($this->command->repeat == 0) { 690 return; 691 } 692 if ($coh->end_date != "0000-00-00 00:00:00") { 693 if (strtotime($coh->end_date) < time()) { 694 /* stop after end date */ 695 return; 696 } 697 } 698 /* to re-schedule: next_date = start_date + interval */ 699 $coh->update_next_launch_date("start_date + interval 30 minute"); 700 $coh->start_date = $coh->next_launch_date; 701 $coh->number_attempt_connection_remains = $this->command->max_connection_attempt; 702 $coh->current_state = "scheduled"; 703 $coh->uploaded = "TODO"; 704 $coh->executed = "TODO"; 705 $coh->deleted = "TODO"; 706 $coh->update(); 707 /* should set state done if next > end_date */ 708 } 709 710 /* wake on lan */ 670 711 function wake_on_lan_mac($mac) 671 712 { trunk/webmin/lsc/include/commands.inc.php
r238 r250 763 763 } 764 764 765 // should we kill the running job if available ? 766 767 $query = sprintf( 768 " 769 UPDATE 770 %s 771 SET 772 current_state = \"stop\", 773 current_pid = -1 774 WHERE 775 id_command = \"%s\" and 776 ( 777 current_state = \"not_reachable\" or 778 current_state = \"scheduled\" or 779 current_state = \"upload_failed\" or 780 current_state = \"execution_failed\" or 781 current_state = \"delete_failed\" or 782 current_state = \"inventory_failed\" 783 ) 784 ", 785 COMMANDS_ON_HOST_TABLE, 786 $id_command 787 ); 788 789 $database->query($query); 765 $database->query("SELECT id_command_on_host FROM ".COMMANDS_ON_HOST_TABLE. 766 " WHERE id_command = \"$id_command\";"); 767 768 // stop and kill each job 769 while ( $database->next_record() ) { 770 lsc_command_on_host_set_stop($database->f("id_command_on_host")); 771 } 772 790 773 } 791 774 trunk/webmin/lsc/include/commands_on_host.inc.php
r238 r250 39 39 var $deleted; /**< is command deleted ? */ 40 40 var $next_launch_date; /**< when this command will be started (YYYY-MM-DD HH:MM:SS) */ 41 var $number_attempt_connection_remains; /**< TODO*/41 var $number_attempt_connection_remains; /**< number of attempts */ 42 42 var $next_attempt_date_time; /**< php time function value */ 43 43 var $current_pid = -1; … … 401 401 402 402 /** 403 * Adjust next launch date 404 * 405 * @param $id_command_on_host 406 * @param new next attempt date time value 407 * 408 */ 409 function update_next_launch_date($date) { 410 global $database; 411 412 $query = sprintf("UPDATE %s 413 SET next_launch_date = %s 414 WHERE id_command_on_host = \"%s\" ", 415 COMMANDS_ON_HOST_TABLE, 416 $date, 417 $this->id_command_on_host 418 ); 419 420 $database->query($query); 421 $this->refresh(); 422 } 423 /** 403 424 * Return in array command history of current command on host 404 425 * … … 692 713 } 693 714 694 /**695 * Adjust next launch date696 *697 * @param $id_command_on_host698 * @param new next attempt date time value699 *700 */701 function lsc_command_on_host_adjust_next_launch_date($id_command_on_host, $new_date_time)702 {703 global $database, $DEBUG;704 705 if (!isset($database)) {706 $database = new LSC_DB();707 if ($DEBUG >= 1) $database->Debug = true;708 }709 710 $query = sprintf(711 "712 UPDATE713 %s714 SET715 next_launch_date = next_launch_date %s716 WHERE717 id_command_on_host = \"%s\"718 ",719 COMMANDS_ON_HOST_TABLE,720 $new_date_time,721 $id_command_on_host722 );723 724 $database->query($query);725 }726 727 715 function lsc_command_on_host_set_current_state($id_command_on_host, $new_state) 728 716 { … … 956 944 %s 957 945 SET 958 current_state = \"pause\", 959 current_pid = \"-1\" 946 current_state = \"pause\" 960 947 WHERE 961 948 id_command_on_host = \"%s\" and … … 1003 990 $database->next_record(); 1004 991 $current_state = $database->f("current_state"); 1005 if ( 1006 ($current_state == "not_reachable") || 1007 ($current_state == "scheduled") || 1008 ($current_state == "upload_failed") || 1009 ($current_state == "execution_failed") || 1010 ($current_state == "delete_failed") || 1011 ($current_state == "inventory_failed") || 1012 ($current_state == "upload_in_progress") || 1013 ($current_state == "execution_in_progress") || 1014 ($current_state == "delete_in_progress") || 1015 ($current_state == "inventory_in_progress") 1016 ) { 1017 if ( $database->f("current_pid") != -1 ) { 1018 posix_kill($database->f("current_pid"), 9); 1019 } 1020 1021 $query = sprintf( 1022 " 992 if ( ($current_state != "done") ) { 993 if ( $database->f("current_pid") > 1 ) { 994 system("./killparent.sh ".$database->f("current_pid")); 995 //posix_kill($database->f("current_pid"), 9); 996 } 997 998 $query = sprintf(" 1023 999 UPDATE 1024 1000 %s … … 1027 1003 current_pid = \"-1\" 1028 1004 WHERE 1029 id_command_on_host = \"%s\" 1030 ", 1005 id_command_on_host = \"%s\" ", 1031 1006 COMMANDS_ON_HOST_TABLE, 1032 1007 $id_command_on_host trunk/webmin/lsc/include/exec.inc.php
r227 r250 48 48 { 49 49 $keychain = get_keychain(); 50 51 $ssh_command ="$keychain ssh -o StrictHostKeyChecking=no -o Batchmode=yes -o PasswordAuthentication=no ".$user."@".$ip." \"".$command."\" 2>&1";52 50 53 /* 54 exec($ssh_command, $output, $return_var); 55 $stdout=""; 56 if (count($output)>0) { 57 $separator=""; 58 foreach($output as $line) { 59 $stdout.=$separator.$line; 60 $separator="\n"; 61 } 62 } 63 */ 51 /* -tt forces tty allocation so that signals like SIGINT 52 will be properly sent to the remote host */ 53 $ssh_command ="$keychain ssh -tt -o StrictHostKeyChecking=no -o Batchmode=yes -o PasswordAuthentication=no ".$user."@".$ip." \"".$command."\" 2>&1"; 64 54 65 55 $handle = popen($ssh_command, "r"); … … 76 66 } 77 67 } 78 pclose($handle); 79 $handle = popen ("echo $?", "r"); 80 $return_var = fread($handle, 10); 81 pclose($handle); 68 $return_var = pclose($handle); 82 69 $stdout = $output; 83 $stderr = ""; // TODO 70 $stderr = ""; // TODO. Problem: only one stream read with popen 71 if ($return_var != 0) $stderr .= "*** Exit code: $return_var ***"; 84 72 $command = $ssh_command; 85 73 } … … 90 78 function lsc_scp($user, $ip, $source, $destination, &$output, &$return_var, &$stdout, &$stderr, &$scp_command) 91 79 { 92 $opts = "-o Batchmode=yes -o StrictHostKeyChecking=no ";80 $opts = "-o Batchmode=yes -o StrictHostKeyChecking=no -r"; 93 81 94 82 $destination = ereg_replace(" ", "\\ ", $destination); trunk/webmin/lsc/include/file.inc.php
r227 r250 1113 1113 1114 1114 /** 1115 * to send file via the POST method e1115 * to send file via the POST method 1116 1116 */ 1117 1117 function LSC_fileSend($session, $path) trunk/webmin/lsc/include/scheduler.inc.php
r238 r250 223 223 "0000-00-00 00:00:00", 224 224 "root", 225 $REMOTE_USER ,225 $REMOTE_USER."@".$_SERVER['REMOTE_ADDR'], 226 226 $desc, 227 227 false, trunk/webmin/lsc/include/ssh.inc.php
r227 r250 118 118 /* safe defaults */ 119 119 $this->root_path = CYGWIN_WINDOWS_ROOT_PATH; 120 $this->tmp_path = $this->root_path."/c/lsc"; 121 122 /* Initialise mac adress */ 120 $this->tmp_path = $config['path_destination'];; 121 debug(1, sprintf("Default path : '%s'", $this->tmp_path)); 122 123 /* Initialize mac address */ 123 124 $this->mac = $mac; 124 debug(1, sprintf("Mac ad ress : '%s'", $mac));125 debug(1, sprintf("Mac address : '%s'", $mac)); 125 126 126 127 /* Load ether file */ … … 187 188 $ls_command = "ls ".MOUNT_EXPLORER."/".$this->user."@".$this->ip."/"; 188 189 189 lsc_ssh( 190 $this->user, 191 $this->ip, 190 lsc_exec( 192 191 $ls_command, 193 192 $this->ssh_array_output, … … 208 207 } 209 208 210 /* Set connection user home path */211 if ($home == "") {209 /* Set connection user home path. Not Used */ 210 /* if ($home == "") { 212 211 $this->home = $this->LSC_getHomePath(); 213 212 } else { 214 213 $this->home = $home; 215 } 214 }*/ 216 215 217 216 debug(1, sprintf("User home path : %s", $this->home)); … … 399 398 function initialize_os_type($known_type = "") 400 399 { 400 global $config; 401 401 402 $random = mt_rand(); 402 403 if ($known_type === false) { … … 405 406 if ($known_type == "") { 406 407 unset($output); unset($return_var); unset($stdout); unset($stderr); 407 lsc_exec(" xprobe2 -M 6 ".$this->ip." 2>&1", $output, $return_var, $stdout, $stderr);408 lsc_exec("./xprobe_safe ".$this->ip, $output, $return_var, $stdout, $stderr); 408 409 $key = LSC_arrayEreg("Running OS", $output); 409 410 $type = $output[$key]; … … 411 412 $type = $known_type; 412 413 } 414 debug(2, "OS Type:".$type); 413 415 if ( strpos ( $type, "Windows" ) !== FALSE) { 414 416 $this->platform = "Windows"; 417 $this->tmp_path = $config[path_destination]; 415 418 return; 416 419 } elseif ( strpos ( $type, "Linux" ) !== FALSE) { … … 420 423 return; 421 424 } 422 $this->platform = "Other"; // keep the default root path in case it's a windows system 425 $this->platform = "Other/N.A."; 426 $this->tmp_path = ""; 423 427 } 424 428 trunk/webmin/lsc/include/widget.inc.php
r227 r250 457 457 )); 458 458 459 $template->set_block("widget_standard_host_actions", "SCRIPT_LIST", "rows ");459 $template->set_block("widget_standard_host_actions", "SCRIPT_LIST", "rows_ha"); 460 460 foreach( $script_list as $script ) { 461 461 $template->set_var("FILENAME", $script["filename"]); 462 462 $template->set_var("TITLE", isset($script["title".$lang]) ? $script["title".$lang] : $script["title"]); 463 $template->parse("rows ", "SCRIPT_LIST", true);463 $template->parse("rows_ha", "SCRIPT_LIST", true); 464 464 } 465 465 … … 604 604 605 605 if ($command->create_directory_enable) { 606 $template->set_var("COMMAND_CREATE_DIRECTORY", "Activ é");607 } else { 608 $template->set_var("COMMAND_CREATE_DIRECTORY", "D ésactivé");606 $template->set_var("COMMAND_CREATE_DIRECTORY", "Activ?"); 607 } else { 608 $template->set_var("COMMAND_CREATE_DIRECTORY", "D?sactiv?"); 609 609 } 610 610 611 611 if ($command->start_script_enable) { 612 $template->set_var("COMMAND_START_SCRIPT", "Activ é");613 } else { 614 $template->set_var("COMMAND_START_SCRIPT", "D ésactivé");612 $template->set_var("COMMAND_START_SCRIPT", "Activ?"); 613 } else { 614 $template->set_var("COMMAND_START_SCRIPT", "D?sactiv?"); 615 615 } 616 616 … … 944 944 945 945 if ($command->create_directory_enable) { 946 $template->set_var("COMMAND_CREATE_DIRECTORY", "Activ é");947 } else { 948 $template->set_var("COMMAND_CREATE_DIRECTORY", "D ésactivé");946 $template->set_var("COMMAND_CREATE_DIRECTORY", "Activ?"); 947 } else { 948 $template->set_var("COMMAND_CREATE_DIRECTORY", "D?sactiv?"); 949 949 } 950 950 951 951 if ($command->start_script_enable) { 952 $template->set_var("COMMAND_START_SCRIPT", "Activ é");953 } else { 954 $template->set_var("COMMAND_START_SCRIPT", "D ésactivé");952 $template->set_var("COMMAND_START_SCRIPT", "Activ?"); 953 } else { 954 $template->set_var("COMMAND_START_SCRIPT", "D?sactiv?"); 955 955 } 956 956 trunk/webmin/lsc/lang/en
r227 r250 57 57 success=success 58 58 failed=failed 59 not_tested=not tested trunk/webmin/lsc/lang/fr
r227 r250 57 57 success=succès 58 58 failed=échoué 59 not_tested=pas testé trunk/webmin/lsc/open_session.inc.php
r227 r250 14 14 * Open the session 15 15 */ 16 16 17 if ($_COOKIE["session"][$getmac]["platform"]!="") { 17 18 $session = new LSC_Session( … … 23 24 ); 24 25 } else { 25 $session = new LSC_Session($getmac, "root", !$isgroup); 26 $ping_enable = !$isgroup; 27 if (strstr($_SERVER['REQUEST_URI'], "repository.cgi")) $ping_enable = false; 28 $session = new LSC_Session($getmac, "root", $ping_enable); 26 29 } 27 30 trunk/webmin/lsc/repository.cgi
r227 r250 246 246 247 247 foreach($_POST["select_to_copy"] as $i) { 248 $item=$_POST["filename"][$i]; 249 if (is_dir($path_source."/".$item)) { 250 $files = array_merge( 251 $files, 252 return_all_files_of_directory_recursive( 253 $path_source."/".$item, 254 $item."/" 255 ) 256 ); 257 } else { 258 array_push($files, $item); 259 } 248 // push files even if they are directories since they will 249 // be uploaded with a 'scp -r' 250 $item = $_POST["filename"][$i]; 251 array_push($files, $item); 260 252 if ( $_POST["select_to_execute"] == $i ) { 261 253 $start_file = $item; …
