コード例 #1
0
ファイル: Devices-Write.php プロジェクト: pl0o0f/nedi-puppet
        echo $row;
        ?>
 Devices (<?php 
        echo $query;
        ?>
)</td></tr>
</table>
	<?php 
    } elseif ($scm or $con) {
        $fd = @fopen("log/cmd_{$_SESSION['user']}.php", "w") or die("{$errlbl} {$wrtlbl} log/cmd_{$_SESSION['user']}.php");
        fwrite($fd, Buildcmd('', $cfgos, 1));
        fclose($fd);
        echo "<h2>{$actlbl} {$lstlbl}</h2>\n";
        foreach ($devip as $dv => $ip) {
            flush();
            echo "<h3>{$dv} " . DevCli($ip, $devpo[$dv], 1) . "</h3>";
            $cred = strstr($guiauth, '-pass') ? "{$_SESSION['user']} {$pwd}" : "{$devlo[$dv]} dummy";
            $cred = addcslashes($cred, ';$!');
            $out = system("perl {$nedipath}/inc/devwrite.pl {$nedipath} {$ip} {$devpo[$dv]} {$cred} {$devos[$dv]} log/cmd_{$_SESSION['user']}", $err);
            echo "<iframe style=\"display:block;\" class=\"textpad txta code\" " . ($ndev == 1 ? 'height="800"' : '') . " src=\"log/cmd_{$_SESSION['user']}-{$ip}.log\"></iframe>";
            $cstr = preg_replace('/\\n|"|\'/', ' ', $cmds);
            if (strlen($cstr) > 40) {
                $cstr = substr($cstr, 0, 40) . "...";
            }
            $msg = "User {$_SESSION['user']} wrote {$cstr}";
            if ($err) {
                $lvl = 150;
                $msg = "User {$_SESSION['user']} wrote {$cstr} causing errors";
            } else {
                $lvl = 100;
                $msg = "User {$_SESSION['user']} wrote {$cstr} successfully";
コード例 #2
0
ファイル: Nodes-Create.php プロジェクト: pl0o0f/nedi-puppet
 if ($iso) {
     $cmds .= "echo ide1:0.present = \\\"TRUE\\\" >> {$vmpath}/{$nvm}.vmx\n";
     $cmds .= "echo ide1:0.fileName = \\\"{$iso}\\\" >> {$vmpath}/{$nvm}.vmx\n";
     $cmds .= "echo ide1:0.deviceType = \\\"cdrom-image\\\" >> {$vmpath}/{$nvm}.vmx\n";
     $cmds .= "echo ide1:0.startConnected = \\\"TRUE\\\" >> {$vmpath}/{$nvm}.vmx\n";
 }
 if ($vnc) {
     $cmds .= "echo remotedisplay.vnc.port = \\\"" . ($vnc + 5900) . "\\\" >> {$vmpath}/{$nvm}.vmx\n";
     $cmds .= "echo remotedisplay.vnc.enabled = \\\"TRUE\\\" >> {$vmpath}/{$nvm}.vmx\n";
     $cmds .= "echo remotedisplay.vnc.password = \\\"{$vnp}\\\" >> {$vmpath}/{$nvm}.vmx\n";
 }
 if ($dly) {
     $cmds .= "echo bios.bootDelay = \\\"" . $dly * 1000 . "\\\" >> {$vmpath}/{$nvm}.vmx\n";
 }
 $cmds .= "vim-cmd solo/registervm {$vmpath}/{$nvm}.vmx {$nvm}\n";
 echo "<h3>{$dev} " . DevCli($dip, $dpo, 1) . "</h3>\n";
 $cred = strstr($guiauth, '-pass') ? "{$_SESSION['user']} {$pwd}" : "{$dlg} dummy";
 $cred = addcslashes($cred, ';$!');
 if ($_GET['add']) {
     $fd = @fopen("log/cmd_{$_SESSION['user']}.php", "w") or die("{$errlbl} {$wrtlbl} log/cmd_{$_SESSION['user']}");
     fwrite($fd, $cmds);
     fclose($fd);
     $out = system("perl {$nedipath}/inc/devwrite.pl {$nedipath} {$dip} {$dpo} {$cred} ESX log/cmd_{$_SESSION['user']}", $err);
     echo "<iframe style=\"display:block;\" class=\"textpad warn code\" src=\"log/cmd_{$_SESSION['user']}-{$dip}.log\"></iframe>";
     $cstr = preg_replace('/\\n|"|\'/', ' ', $cmds);
     if (strlen($cstr) > 40) {
         $cstr = substr($cstr, 0, 40) . "...";
     }
     $msg = "User {$_SESSION['user']} wrote {$cstr}";
     if ($err) {
         $lvl = 150;